query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Store a newly created user in storage.
public function store() { if (!$this->userService->create(Input::all())) { return Redirect::back()->withErrors($this->userService->errors())->withInput(); } Alert::success('User successfully created!')->flash(); return Redirect::route('dashboard.users.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n\t{\n\t\t$user = $this->user->store( Input::all() );\n\t}", "public function store()\n {\n $attributes = request()->validate([\n 'name' => 'required|max:255',\n 'username' => 'required|unique:users,username',\n 'email' => 'required|email|max:255|unique:users,email',\n 'password' => 'required',\n ]);\n $user = User::create($attributes);\n\n // Auth facades\n auth()->login($user);\n }", "public function store()\n {\n // Save post data in $user var\n $user = $_POST;\n \n // Create a password, set created_by ID and set the date of creation\n $user['password'] = password_hash('Gorilla1!', PASSWORD_DEFAULT);\n $user['created_by'] = Helper::getUserIdFromSession();\n $user['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n UserModel::load()->store($user);\n }", "public function store()\n {\n request()->validate([\n 'first_name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'phone' => 'required|numeric|digits:10|unique:users',\n 'password' => 'required|string|min:8|confirmed',\n ]);\n\n User::create(request()->only('first_name', 'last_name', 'email', 'phone') + [\n 'type' => 'user',\n 'password' => Hash::make(request()->password),\n ]);\n\n return redirect('users')->with('status', 'User created.');\n }", "public function store(CreateUserRequest $request)\n {\n $user = $this->usersRepo->storeNew($request->all());\n\n // Upload avatar\n $this->uploadAvatar($request, $user);\n\n \\Alert::success('CMS::users.msg_user_created');\n return redirect()->route('CMS::users.edit', $user->id);\n }", "public function store()\n\t{\n\t\t// Validate the form input\n\t\t$this->userUpdateForm->validate(Input::all());\n\n\t\textract(Input::only('username', 'email', 'password', 'first_name', 'last_name'));\n\n\t\t$user = $this->execute(\n\t\t\tnew RegisterUserCommand($username, $email, $password, $first_name, $last_name)\n\t\t);\n\n\t\tFlash::success($user->username . ' was successfully created');\n\t\treturn Redirect::back();\n\t}", "public function store()\n\t{\n\t\t// save the new user\n\t\t// TODO : limit the admin to 3 accounts only\n\t\t$this->user->create(array(\n\t\t\t\t\t\t\t\t\t'user_username' =>\tInput::get('user_username'),\n\t\t\t\t\t\t\t\t\t'user_password_md5' => \tmd5(Input::get('user_password')),\n\t\t\t\t\t\t\t\t\t'password' => \tHash::make(Input::get('user_password')),\n\t\t\t\t\t\t\t\t\t'user_role' \t=>\tInput::get('user_role')\n\t\t\t\t\t\t\t));\n\n\t\t$users = $this->user->all();\n\t\treturn Redirect::to('settings/system-users')\n\t\t\t\t\t\t->with('users',$users)\n\t\t\t\t\t\t->with('flash_msg','User has been successfully created !');\n\t}", "public function store(StoreUserRequest $request) {\n\t\t$data = $request->only([\n\t\t\t\"name\",\n\t\t\t\"email\",\n\t\t]);\n\n\t\tif($request->has('password')) {\n\t\t $data['password'] = bcrypt($request->input('password'));\n }\n $user = User::create($data);\n\n if($request->has(\"images\")) {\n $user->files()->sync($request->input(\"images\"));\n }\n\n return $this->item($user, $this->transformer);\n }", "public function store()\n {\n $this->authorize('create', User::class);\n\n $validated = request()->validate([\n 'name' => 'required|string|max:255',\n 'username' => 'required|string|max:255|min:5|unique:users',\n 'email' => 'nullable|string|max:255|email|unique:users',\n 'password' => 'required|string|min:8',\n 'roles' => 'required|array',\n 'roles.*' => 'exists:roles,id',\n 'projects' => 'required|array|min:1',\n 'projects.*' => 'nullable|exists:projects,id',\n 'timezone' => 'required|timezone',\n 'phone' => 'nullable|string',\n ]);\n\n $user = User::make($validated);\n\n $user->password = Hash::make($validated['password']);\n $user->save();\n\n $user->roles()->sync($validated['roles']);\n $user->projects()->sync($validated['projects']);\n\n return redirect()->route('users.index')->with('message', 'Новый пользователь успешно создан!');\n }", "public function store(\n\t\tUserCreateRequest $request\n\t\t)\n\t{\n//dd($request);\n\t\t$this->user->store($request->all());\n\t\tFlash::success( trans('kotoba::account.success.create') );\n\t\treturn redirect('admin/users');\n\t}", "public function store(Requests\\CreateUserRequest $request)\n {\n $user = \\App\\User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'bio' => $request->bio,\n 'password' => bcrypt($request->password)\n ])->attachRole($request->role);\n\n /**\n * Notifying user that he's account was created and that he can start using it\n */\n Notification::send([$user], new \\App\\Notifications\\AccountCreated());\n\n return redirect()->route('users.index')->with('success', 'User created successfully.');\n }", "public function store()\n {\n $input = Input::only('first_name', 'last_name', 'email', 'password');\n $command = new CreateNewUserCommand($input['email'], $input['first_name'], $input['last_name'], $input['password']);\n $this->commandBus->execute($command);\n return Redirect::to('/profile');\n }", "public function store(Requests\\StoreUserRequest $request)\n {\n $input = $request->all();\n\n $input['profile_photo'] = 'default.jpg';\n\n if ($request->hasFile('profile_photo') && $request->file('profile_photo')->isValid()) {\n $input['profile_photo'] = $this->photoUpload($request);\n }\n\n $input['password'] = bcrypt($request['password']);\n\n $user = User::create($input);\n\n if ($input['profile_photo'] != 'default.jpg') {\n $photo = new Photo(['file_name' => $input['profile_photo']]);\n $user->photos()->save($photo);\n }\n\n return redirect('admin/users')->with('message', 'User successfully created!');\n }", "public function store()\n {\n // Validate form\n $validator = User::registrationValidation();\n $this->validate(request(), $validator);\n\n // Register user\n $registrationParams = User::registrationParams();\n $user = User::create(request($registrationParams));\n\n // Log in user\n User::loginUser($user);\n\n // Redirect to home page\n return redirect('/');\n }", "public function store(UserCreateRequest $request)\n {\n $this->checkAdmin();\n\n $this->userRepository->store($request->all());\n\n return redirect()->route('users.index')->withOk(\"L'utilisateur a été créer.\");\n }", "public function store()\n\t{\n\t\t$activate_data = array(\n\t\t\t\"activate\" => 1,\n\t\t\t\"activated_at\" => $this->datetime->format(\"Y-m-d H:i:s\")\n\t\t);\n\n\t\t$user = $this->user->create(array_merge(Input::all(), $activate_data));\n\n\t\tif($user)\n\t\t{\n\t\t\treturn Redirect::route(\"users.index\");\n\t\t}\n\n\t\treturn Redirect::back()->withInput()->withErrors($this->user->errors());\n\t}", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "public function store(UserCreateRequest $request)\n {\n $user = $this->repository->create($request->all());\n return $this->success($user, trans('messages.users.storeSuccess'), ['code' => Response::HTTP_CREATED]);\n }", "public function store()\n\t {\n $newUserInfo = Input::all();\n\n $newUserInfo['username'] = $newUserInfo['name'];\n $newUserInfo['email'] = $newUserInfo['email'];\n $newUserInfo['password'] = Hash::make(\"password\");\n\n $user = User::create($newUserInfo);\n\n return Response::json(array(\n \"id\" => $user->id\n ));\n }", "public function store(UserCreateRequest $request)\n {\n $user = User::make($request->all());\n\n $user->password = config('custom.default_user_pass');\n $user->save();\n\n return $this->storeResponse(new UserResource($user));\n }", "public function store(CreateUserRequest $request)\n {\n $data = $request->only('name', 'email', 'password');\n $data['password'] = Hash::make($data['password']);\n $data['user_type'] = $request->get('is_admin') ? User::$ADMIN : User::$DATAENTRANT;\n User::create($data);\n return redirect()->to('users')->withSuccess('User Account Created');\n }", "public function store(UserCreateRequest $request)\n {\n try {\n $this->userService->store($request->all());\n Session::flash('message', 'Користувач успішно створений!');\n return redirect()->route('users.index');\n } catch (\\Throwable $e) {\n throw $e;\n }\n }", "public function store() \n\t{\n\t\t$input = Input::all();\n\t\t$validation = $this->validator->on('create')->with($input);\n\n\t\tif ($validation->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles(\"orchestra::users/create\"))\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($validation);\n\t\t}\n\n\t\t$user = App::make('orchestra.user');\n\t\t$user->status = User::UNVERIFIED;\n\t\t$user->password = $input['password'];\n\n\t\t$this->saving($user, $input, 'create');\n\n\t\treturn Redirect::to(handles('orchestra::users'));\n\t}", "public static function store()\n {\n $user = User::getUser(Authentication::$user_email);\n Tutor::create_tutor($user->getEmail(), '', 0);\n }", "public function store(CreateUserRequest $request)\n {\n\n // Try creating new user\n $newUser = User::createUserWithProfile($request->all());\n\n // Event new registered user\n event(new Registered($newUser));\n // Send user registered notification\n $newUser->sendUserRegisteredNotification();\n\n // Check if user need to verify email if not app will try to login the new user\n if (config('access.users.verify_email')) {\n // Send Email for Verification\n $newUser->sendEmailVerificationNotification();\n }\n\n return $newUser->sendResponse();\n }", "public function store(UserRequest $request) {\n $user = $this->service()->create($request->all());\n return $this->created($user);\n }", "public function store(CreateRequest $request, User $user)\n {\n $login_user = auth()->user();\n\n // if( in_array( $login_user->role, [ 'super-admin', 'institute' ] ) ) {\n // $request->setOffset('institute_id', $login_user->institute_id );\n // }\n \n $user = $user->createUser( $request->except( '_token') );\n\n return redirect()->route('admin.users.edit', $user->id )\n ->withMessage('User Created Successfully');\n\n }", "public function store(UserRequest $request)\n {\n $this->authorize('create', User::class);\n\n $input = $request->all();\n\n $person = Person::create($input);\n $input['person_id'] = $person->id;\n\n $user = User::create($input);\n\n if ($request->has('center')) {\n $center = Center::abbreviation($request->get('center'))->first();\n if ($center) {\n $user->setCenter($center);\n }\n }\n if ($request->has('role')) {\n $role = Role::find($request->get('role'));\n if ($role) {\n $user->roleId = $role->id;\n }\n }\n if ($request->has('active')) {\n $user->active = $request->get('active') == true;\n }\n if ($request->has('require_password_reset')) {\n $user->requirePasswordReset = $request->get('require_password_reset') == true;\n }\n $user->save();\n\n return redirect('admin/users');\n }", "public function store(UserRequest $request User $user)\n {\n $user->create($request->all());\n return redirect()->route('admin.users.index');\n }", "public function store(Request $request, User $user)\n\t{\t\n\t\t$user->create($request->all());\n\t\t$user->save();\n\t\t$user->attachRole($request->input('role'));\n\t}", "public function store()\n\t{\n $user = new User();\n $user->name = Input::get('name');\n $user->email = Input::get('email');\n $user->mobile = Input::get('mobile');\n $user->save();\n echo json_encode(array('msg' => 'success', 'id' => $user->id));\n\t}", "public function store()\n {\n $user = request()->validate(User::$validationRules);\n\n request()->merge(array_map(\"trim\", array_map(\"strip_tags\", $user)));\n\n User::forceCreate($user);\n \n return redirect()->route('users.index')->with('form_success', 'You have successfully created new user entry.');\n }", "public function store(CreateUserRequest $request)\n {\n $request->storeUser();\n toastr()->success('User successfully created.');\n\n return redirect()->route('users.index');\n }", "public function store(CreateUserRequest $request)\n {\n $input = $request->all();\n\n $input['password'] = bcrypt('password');\n $input['api_token'] = str_random(60);\n\n $profile = $input['profile'];\n $profile['driver_id'] = strtoupper(uniqid());\n unset($input['profile']);\n\n if ($request->hasFile('file')) {\n $file = $request->file('file');\n $path = $file->store('documents');\n\n $profile['document_file'] = $path;\n }\n\n\n if ($request->hasFile('picture')) {\n $file = $request->file('picture');\n $path = $file->store('documents');\n\n $profile['profile_picture'] = $path;\n }\n unset($input['file']);\n unset($input['picture']);\n\n $user = User::create($input);\n $user->profile()->create($profile);\n\n return redirect('/users');\n }", "public function store(UserCreateRequest $request)\n {\n try {\n\n DB::beginTransaction();\n\n $data = $request->all();\n\n $birthday_date = Carbon::parse($data['birthday_date']);\n $data['birthday_date']=$birthday_date->format('Y-m-d');\n\n $data['full_name'] = $data['name'] . ' ' . $data['last_name'];\n\n $people = People::create($data);\n\n $user = User::create([\n 'name' => $data['full_name'],\n 'email' => $data['email'],\n 'people_id' => $people->id,\n 'password' => Hash::make($data['password']),\n 'email_verified_at' => date('Y-m-d H:i:s'),\n ]);\n\n $role = Role::findOrFail($data['role_id']);\n\n $user->assignRole($role->name);\n\n $this->saveUserLog($user);\n\n DB::commit();\n\n return $this->successResponse(new UserResource($user), Response::HTTP_CREATED);\n } catch (\\Exception $e) {\n DB::rollBack();\n return $this->errorResponse(\"Couldn't store data\", Response::HTTP_BAD_REQUEST);\n }\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'name'\t\t\t\t=>\t'required|min:3|regex:/^[a-zA-Z][a-zA-Z ]*$/',\n\t\t\t'username'\t\t\t=>\t'required|min:3|unique:users|regex:/^[A-Za-z0-9_]{1,15}$/',\n\t\t\t'password'\t\t\t=>\t'required|min:6',\n\t\t\t'retype-password'\t=> \t'required|min:6|same:password',\n\t\t\t'email'\t\t\t\t=>\t'required|email|unique:users'\n\t\t);\n\n\t\t$validator = Validator::make(Request::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::back()\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Request::except('password'));\n\t\t} else {\n\n\t\t\t$user = new User;\n\n\t\t\t$user->name = Request::get('name');\n\t\t\t$user->username = Request::get('username');\n\t\t\t$user->password = Hash::make(Request::get('password'));\n\t\t\t$user->email = Request::get('email');\n\n\t\t\t$user->save();\n\n\t\t\t// Redirect\n\t\t\tSession::flash('message', 'Account created!');\n\t\t\treturn Redirect::to('auth/login');\n\t\t}\n\t}", "public function store(UserRequest $request)\n {\n $user = User::create($request->allWithHashedPassword());\n\n $user->setType($request->input('type'));\n\n flash(trans('users.messages.created'));\n\n return redirect()->route('dashboard.users.show', $user);\n }", "public function store(UserRequest $request)\n {\n $this->user = new User;\n return $this->props($request)\n ->save()\n ->redirect($request,'Created');\n }", "public function store(UserStoreRequest $request)\n {\n $user = new User();\n $user->fill($request->except([\n 'avatar',\n 'roles',\n ]));\n\n if ($request->hasFile('avatar')) {\n // if upload avatar\n $user = $user->uploadAvatar($request->file('avatar'));\n }\n\n $user->save();\n\n // sync roles\n $user->roles()->sync($request->get('roles'));\n\n $request->session()->flash('success', 'Пользователь успешно добавлен');\n\n return redirect(route('admin.users.index'));\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'username' => 'required|between:3,20',\n\t\t\t'email' => 'required|email|confirmed|unique:users,email',\n\t\t\t'password' => 'required|min:6|alpha_num|confirmed'\n\t\t);\n\n\t\t$validation = Validator::make(Input::all(), $rules);\n\n\t\tif($validation->fails()) {\n\t\t\treturn Redirect::back()->withErrors($validation);\n\t\t}\n\n\t\t$user = new User;\n\t\t$user->username = Input::get('username');\n\t\t$user->email = Input::get('email');\n\t\t$user->password = Hash::make(Input::get('password'));\n\n\t\tif($user->save()){\n\t\t\tAuth::login($user);\n\t\t\tif(Auth::check()) {\n\t\t\t\treturn Redirect::to('user/'.$user->id);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn Redirect::back()->with('flash_error', \"Impossible de connecter l'utilisateur\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn Redirect::back()->with('flash_error', \"Impossible d'enregistrer l'utilisateur\");\n\t\t}\n\t}", "public function store(StoreRequest $request)\n {\n $user = $this->userService->new($request->merge([\n 'is_verified' => 1,\n 'password' => bcrypt($request->get('password')),\n 'image' => $request->has('photo') ? $this->uploadImage($request->file('photo'), $this->folder) : null,\n ])->all());\n\n if ($user) {\n $user->roles()->sync((array)$request->get('roles'));\n }\n\n flash('success', 'User successfully created.');\n return $this->redirect($request);\n }", "public function store(UserCreateRequest $request)\n {\n $user = $this->userRepository->store($request->all());\n\n return redirect('user')->withOk(\"L'utilisateur \" . $user->name . \" a été créé.\");\n }", "public function store(UserRequest $request)\n {\n $user = new User();\n $user->name = $request->input(\"name\");\n $user->email = $request->input(\"email\");\n $user->current_password = $request->input(\"password\");\n $user->password = Hash::make($request->input(\"password\"));\n $user->phone_number = $request->input(\"phone_number\");\n $user->job_title = $request->input(\"job_title\");\n $user->day_off = $request->input(\"day_off\");\n $user->section = $request->input(\"section\");\n $user->nationality_id = $request->input(\"nationality_id\");\n\n if (isset($request->photo) && $request->photo != \"\") {\n $user->photo = UploadImageService::uploadImage($_FILES['photo'], 'uploads/users');\n }\n if (isset($request->active)) {\n $user->active = $request->input(\"active\");\n }\n\n $user->save();\n\n // attach role\n RoleService::attachNewUserRole($user, $request->role_id);\n\n\n return redirect()->route('users.index')->with('message', 'user created successfully.');\n }", "public function store(UserCreateRequest $request)\n {\n $data = $request->toArray();\n $data['password'] = Hash::make($data['password']);\n User::create($data);\n\n return redirect()->route('users.index')->with('success', 'User successfully added!');\n }", "public function store(Request $request, StoreUserPost $user) {\n $this->model->addUser($request->all());\n Controller::FlashMessages('The user has been added', 'success');\n return redirect('/users');\n }", "public function store(Requests\\CreateUserRequest $request)\n {\n $request->permission_id = $this->userRepository->getPermissionRepository()->getAll()->get(1)->id;\n $created = $this->userRepository\n ->create($request);\n\n if(!$created){\n return redirect('/users/systemusers')->withErrors('User creation failed.');\n }\n\n return redirect('/users/systemusers')->withMessage('New user has been created successfully.');\n }", "public function store()\n {\n $data = $this->request->all();\n $validator = $this->validateRequest($data);\n \n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();\n } else {\n $user = User::create($data);\n return redirect('/')->with('success', 'Account has been created successfully');\n }\n }", "public function store()\n\t{\n\t\t$user = new User;\n\n\t\t$user->name = Request::input('user.name');\n\t\t\n\t\t$user->email = Request::input('user.email');\n\n\t\t$user->password = bcrypt(Request::input('user.password'));\n\n\t\t$user->save();\n\n\t\treturn ['user'=>$user];\n\t}", "public function store(UserStoreRequest $request) {\n $user = new User;\n $user->name = $request->name;\n $user->email = $request->email;\n if ($user->save()) {\n \\Session::flash('flash_message_success', 'User added.');\n return redirect()->back();\n } else {\n \\Session::flash('flash_message_error', 'User not added');\n return redirect()->back();\n }\n }", "public function store(UserStoreRequest $request)\n {\n if (User::create([\n 'name' => $request->name,\n 'first_name' => $request->first_name,\n 'email' => $request->email,\n 'password' => Hash::make($request->password),\n 'api_token' => Str::random(100)\n ])) {\n return response()->json([\n 'success' => \"User has been created with success\"\n ], 200);\n }\n }", "public function store(StoreUser $request)\n {\n // Create new user and save it\n $user = User::create([\n 'name' => request('name'),\n 'email' => request('email'),\n 'password' => bcrypt(request('password')),\n ]);\n\n // Attach the role to user\n $user->attachRole(request('role'));\n\n return redirect()->route('users');\n }", "public function store(FormUserCreateRequest $request)\n {\n $user = new User();\n $user->name = $request->name;\n $user->surname = $request->surname;\n $user->email = $request->email;\n $user->role = $request->role;\n $user->department_id = $request->department;\n $user->active = $request->active;\n $user->password = Hash::make($request->password);\n $saved = $user->save();\n if($saved)\n return response()->json(['success' => true, 'message' => 'Usuario registrado exitosamente.'], 200);\n }", "public function store()\n\t{\n\t\t$userdata = Input::all();\n\n $rules = array(\n 'first_name' => 'required|alpha',\n 'last_name' => 'required|alpha',\n 'email' => 'required|email|unique:users',\n 'password' => 'confirmed',\n 'password_confirmation' => ''\n );\n\n $validator = Validator::make($userdata, $rules);\n\n if ($validator->fails())\n {\n $response = array(\n\t\t\t\t'message' \t\t=> 'The user could not need added',\n\t\t\t\t'data'\t\t\t=> $validator->messages()->toArray(),\n\t\t\t\t'status' \t \t=> 400 \n\t\t\t);\n\t\t\treturn Response::make($response, 400);\n\t\t}\n\n $user = new User();\n $user->fill(Input::except('_token', 'password_confirmation'));\n $userdata['password'] = (isset($userdata['password']))?$userdata['password']:\"password\";\n $user->password = Hash::make($userdata['password']);\n $user->save();\n\n /* Audit Log */ \n Log::info('New user: ' . $userdata['email']);\n \n $response = array(\n\t\t\t'message' \t\t=> 'The user has successfully been added..',\n\t\t\t'data'\t\t\t=> $user->toArray(),\n\t\t\t'status' \t \t=> 200 \n\t\t);\n\t\treturn Response::make($response, 200);\n \t\n\t}", "public function store(UserCreateRequest $request)\n {\n $user = User::create(array_merge($request->all(), [\n 'password' => Hash::make($request->password),\n 'user_id' => $request->user()->id,\n ]));\n\n return (new UserResource($user))->additional(['message' => 'User was created']);\n }", "public function store(CreateUserRequest $request)\n {\n $input = $request->all();\n\n $user = $this->userRepository->create($input);\n\n Flash::success('User saved successfully.');\n\n return redirect(route('users.index'));\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function store(CreateUserRequest $request)\n {\n $input = $request->all();\n\n $this->userRepository->create($input + ['admin' => 0]);\n\n Flash::success('User saved successfully.');\n\n return redirect(route('users.index'));\n }", "public function store()\n {\n $valid = User::isValid(Input::all());\n \n if($valid === true) {\n // Ensure that password is set\n if(Input::get('password') == null) {\n return $this->respondConflict(\"password must be set\");\n }\n \n // Check for if user has already been created\n try {\n User::create(array(\n \"firstname\" => Input::get(\"first\"),\n \"lastname\" => Input::get(\"last\"),\n \"email\" => Input::get(\"email\"),\n \"password\" => Hash::make(Input::get(\"password\"))\n ));\n } catch (Exception $e) {\n return $this->respondConflict(\"User already exists\");\n }\n \n return $this->respond(array(\"message\" => \"User Created\"));\n \n } else {\n return $this->respondConflict($valid);\n }\n }", "public function store(UserCreateRequest $request): UserResource\n {\n /* Convert request to array */\n $data = $request->all();\n\n /* Hashing password */\n $data['password'] = bcrypt($request->input('password'));\n\n /* Store data to database */\n $user = User::create($data);\n\n /* Send Register email to the user */\n event(new Registered($user));\n\n activity(\"Admin\")\n ->on($user)\n ->withProperties([\n ['IP' => $request->ip()],\n ['user_data' => $request->all()],\n ])\n ->log('Store a user');\n\n return new UserResource($user->loadMissing('plans'));\n }", "public function store(UserCreateRequest $request)\n {\n $name = $request->name;\n $email = $request->email;\n $createFail = $this->user->createNewUser($name, $email);\n if ($createFail[0]) {\n $error = 'Add duplicate user ' . $createFail[1] . '!';\n return $this->serverResponse($error, null);\n } else {\n $success = 'Add user \\'' . $name . '\\' success';\n return $this->serverResponse(null, $success);\n }\n }", "public function store(UserCreateRequest $request)\n {\n $user=$request['nombre'];\n $u=strtoupper($user[0]).strtolower($request['apellido']);\n User::create([\n 'nombre' => trim(strtoupper($request['nombre'])),\n 'apellido' => trim(strtoupper($request['apellido'])),\n 'ci' => $request['ci'],\n 'telef1' => $request['telef1'],\n 'telef2' => $request['telef2'],\n 'direccion' => trim(strtoupper($request['direccion'])),\n 'email' => trim(strtoupper($request['email'])),\n 'password' => bcrypt($u),\n 'name_user' => $u,\n 'rol' => $request['rol'],\n ]);\n Session::flash('message', 'Los datos se guardaron exitosamente');\n return Redirect::to('/usuario');\n }", "public function store(StoreUserRequest $request)\n {\n try {\n return $this->respondSuccess([\n 'message' => 'User created successfully',\n 'data' => $this->transformer->transform($this->repository->create($request->all()))\n ]);\n } catch (\\Exception $exception) {\n return $this->respondError(['message' => $exception->getMessage()]);\n }\n }", "public function store(StoreUserRequest $request)\n {\n $password = Str::upper(Str::random(6));\n\n $user = User::create([\n 'email' => ($request->validated()['email']),\n 'title' => ($request->validated()['title']),\n 'firstname' => ucwords($request->validated()['firstname']),\n \n 'middlename' => ucwords($request->validated()['middlename']),\n 'lastname' => ucwords($request->validated()['lastname']),\n 'nickname' => ucwords($request->validated()['nickname']),\n\n 'certificate_name' => ucwords($request->validated()['certificate_name']),\n 'contactno' => ($request->validated()['contactno']),\n 'address' => ucwords($request->validated()['address']),\n\n 'occupation' => ucwords($request->validated()['occupation']),\n 'sex' => $request->validated()['sex'],\n 'birthday' => ($request->validated()['birthday']),\n\n 'department_id' => ($request->validated()['department']),\n 'course_id' => ($request->validated()['course']),\n 'section_id' => ($request->validated()['section']),\n 'year' => ($request->validated()['year']),\n\n 'institution' => ucwords($request->validated()['institution']),\n 'username' => $request->validated()['username'],\n 'temppassword' => $password,\n 'password' => Hash::make($password),\n 'role' => $request->validated()['role'],\n ]);\n \n if($user){\n $name = $user->firstname.\" \".$user->lastname;\n\n session()->flash('success', $name.':Created Successfully');\n\n return response()->json([\n 'success' => true,\n 'message' => $name.': Created Successfully'\n ]);\n }\n\n }", "public function store(CreateUserRequest $request)\n {\n $input = $request->all();\n\n $user = $this->userRepository->create($input);\n \n Flash::success('Usuario creado con éxito.');\n\n return redirect(route('users.index'));\n }", "public function store(UserCreateRequest $request)\n {\n try {\n\n $user = User::create($request->all());\n $user->roles()->sync($request->roles);\n\n return redirect()->route('admin.users.show', ['id' => $user->id])->with(['type' => 'success', 'message' => __('messages.success.store')]);\n } catch (\\Exception $e) {\n\n return redirect()->back()->with(['type' => 'danger', 'message' => __('messages.danger.create')])->withInput();\n }\n }", "public function store(UserRequest $request)\n {\n\n $data = $request->all();\n\n if (isset($request->status)) {\n $data['status'] = 1;\n }\n\n $data['password'] = Hash::make($request->password);\n\n $this->user->create($data);\n\n flash('Usuário criado com sucesso!')->success();\n\t return redirect()->route('admin.users.index');\n\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'username'=> 'required|alpha_dash|min:3|unique:users,username',\n\t\t\t'display_name'=> 'required',\n\t\t\t'email'=>'email',\n\t\t\t'password'=> 'required',\n\t\t\t'repeat_password'=> 'required|same:password'\n\t\t);\t\n\n\t\t$validation= Validator::make(Input::all(), $rules);\n\n\t\tif ($validation ->fails()) {\n\t\t\treturn Redirect::to('register')\n\t\t\t\t->withErrors($validation)\n\t\t\t\t->withInput(Input::all());\n\t\t}\n\n\t\t$user = new User;\n\t\t$user->username = Input::get('username');\n\t\t$user->password = Hash::make(Input::get('password'));\n\t\t$user->display_name = Input::get('display_name');\n\t\t$user->email = Input::get('email');\n\t\t$user->role = 'user';\n\t\t$user->token = sha1(uniqid());\n\t\t$user->status = 'pending';\n\t\t$user->save();\n\n\t\treturn Redirect::to('/')\n\t\t\t->with('message','User Created, Waiting for Approval');\n\t}", "public function store(CreateUserRequest $request)\n {\n return $this->respondCreated(\n User::create(request()->all())\n );\n }", "public function store(UsersCreateRequest $request)\n {\n $user = User::create($request->all());\n $user->generalPassword($request->get('password'));\n $user->uploadAvatar($request->file('avatar'));\n $user->toggleAdmin($request->get('is_admin'));\n\n return redirect()->route('users.index');\n }", "public function store(CreateUserRequest $request, NewUser $newUser)\n {\n $this->authorize('create_users');\n $newUser->save();\n return redirect()->route('admin.user.index');\n }", "public function store(UserRequest $request)\n { \n $user = User::register([\n 'first_name' => $request->first_name, \n 'last_name' => $request->last_name, \n 'email' => $request->email, \n 'password' => bcrypt(str_random(20)),\n 'address' => $request->address,\n 'address2' => $request->address2,\n 'city' => $request->city,\n 'state' => $request->state,\n 'zip' => $request->zip,\n 'image' => $request->file('image')->store('avatars'),\n 'phone' => $request->phone,\n 'phone2' => $request->phone2,\n 'url' => $request->url,\n 'activate_token' => strtolower(str_random(64)),\n ]);\n\n Auth::user()->subscription('main')->incrementQuantity();\n \n flash('You added a user! Your new user was sent an email with their email and password. Your billing will now be updated.','success');\n return redirect()->route('users.index');\n }", "public function store(UserRequest $request)\n {\n $user = User::create(array_merge($request->only('email', 'name'), [\n 'password' => bcrypt($request->get('new_password')),\n 'password_expired_at' => $request->has('password_expired') ? now() : null,\n ]));\n\n //權限\n $user->roles()->sync($request->input('role'));\n\n return redirect()->route('user.index')->with('success', '會員已建立');\n }", "public function store(UserCreateRequest $request)\n {\n User::Create([\n 'name' => $request['name']\n , 'email' => $request['email']\n , 'password' => $request['password']\n ]);\n\n Session::flash('message', 'Usuario creado correctamente');\n return Redirect::to('/user');\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$validation = Validator::make($input, User::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$this->user->create($input);\n\n\t\t\treturn Redirect::route('users.index');\n\t\t}\n\n\t\treturn Redirect::route('users.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "public function store()\n {\n $data = request()->validate([\n 'name' => ['bail', 'required', 'between:2,100'],\n 'surname' => ['bail', 'required', 'between:2,100'],\n 'id_card' => ['bail', 'required', 'numeric', 'integer', 'digits_between:1,8', Rule::unique('users')],\n 'email' => ['bail', 'required', 'email', Rule::unique('users')],\n 'password' => ['bail', 'required', 'alpha_dash', 'between:6,16'],\n 'phone_number' => ['bail', 'required', 'numeric', 'digits:11'],\n 'address' => ['bail', 'required', 'between:5,200'],\n 'toAdmin' => '',\n ]);\n\n $user = User::create([\n 'name' => $data['name'],\n 'surname' => $data['surname'],\n 'id_card' => $data['id_card'],\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'phone_number' => $data['phone_number'],\n 'address' => $data['address'],\n ]);\n if (isset($data['toAdmin']) && $data['toAdmin']) {\n $user->is_admin = 1;\n $user->update();\n }\n return redirect(route('admin.users'));\n }", "public function store(CreateUserRequest $request)\n {\n //\n $input = $request->all();\n\n $input['password'] = bcrypt($request->password);\n\n User::create($input);\n\n return redirect('/dashboard/users');\n }", "public function store()\n\t{\n\t\t$request = Request::input();\t\n\t\t$user = new User;\n\t\t$user->username = $request['username'];\n\t\t$user->password = Hash::make($request['password']);\n\t\t$user->email = $request['email'];\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('/user');\n\n\t}", "public function store(StoreUser $request)\n {\n $this->authorize('create', User::class);\n\n $data = $request->validated();\n $data['password'] = \\Hash::make($data['password']);\n $user = User::create($data);\n\n if ($user) {\n return redirect()->route('user.edit', compact('user'))->with('notice', [\n 'type' => 'success',\n 'dismissible' => true,\n 'content' => __('Berhasil membuat pengguna baru.'),\n ]);\n } else {\n return redirect()->back()->with('notice', [\n 'type' => 'danger',\n 'dismissible' => true,\n 'content' => __('Gagal membuat pengguna baru.'),\n ]);\n }\n }", "public function store(UserRequest $request)\n {\n $user = new User($request->all());\n $user->password = bcrypt($request->password);\n $user->deleted = 0;\n $user->save();\n $user->roles()->attach(Role::where('name', $request->role)->first());\n //Flash::success('Se ha registrado de manera exitosa!'); \n return redirect()->route('users.index');\n }", "public function store(UserRequest $request)\n {\n $user = new User();\n $user->first_name = trim($request->input('first_name'));\n $user->last_name = trim($request->input('last_name'));\n $user->username = trim($request->input('username'));\n $user->active = ($request->input('active') == \"on\") ? 1 : 0;\n $user->password = bcrypt(trim($request->input('password')));\n $user->email = trim($request->input('email'));\n $user->mobile = trim($request->input('mobile'));\n if ($user->save()) {\n createSessionFlash('User Create', 'SUCCESS', 'User create successfully');\n } else {\n createSessionFlash('User Create', 'FAIL', 'Error in User create');\n }\n return redirect('admin/users');\n }", "public function store(UserRequest $request)\n {\n $firstName = $request->input('first-name');\n $lastName = $request->input('last-name');\n\n $newItem = new User();\n $newItem->first_name = $firstName;\n $newItem->last_name = $lastName;\n $newItem->name = $firstName . ' ' . $lastName;\n $newItem->email = $request->email;\n $newItem->mobile = $request->mobile;\n $newItem->password = bcrypt($request->password);\n $newItem->active = (isset($request->active)) ? $request->active : 0;\n\n if ($newItem->save()) {\n return redirect()->route('admin.user.index')->with(['success' => 'Success in saving item.']);\n }\n return redirect()->back()->withErrors(['Error when saving, please try again.'])->withInput();\n }", "public function store(UserStoreRequest $request)\n {\n $user = User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => $request->password,\n ]);\n \n //$user->roles()->sync($request->input('roles', []));\n\n if($request->file('image')){\n $url = Storage::put('images', $request->file('image'));\n $user->image()->create([\n 'url' => $url\n ]);\n }\n if($request->roles){\n $user->roles()->attach($request->roles);\n }\n if($user){\n return redirect('usuario')->with('success', 'Nuevo usuario creado con exito');\n }\n else{\n return redirect('usuario/crear')->with('error', 'Error al crear al usuario');\n }\n }", "public function store()\n\t{\n\t\tif (Auth::user()->role == 'Admin') {\n\t\t\t$input = Input::all();\n\t\t\t$validation = Validator::make($input, User::$rules);\n\n\t\t\tif ($validation->passes()){\n\t\t\t\t$user = new User();\n\t\t\t\t$user->username = Input::get('username');\n\t\t\t\t$user->email = Input::get('email');\n\t\t\t\t$user->password = Hash::make(Input::get('password'));\n\t\t\t\t$user->role = Input::get('role');\n\t\t\t\t$user->save();\n\t\t\t\t\n\t\t\t\tFlash::success('User Created');\n\t\t\t\treturn Redirect::route('users.index');\n\t\t\t}\n\t\t\t\t\n\t\t\treturn Redirect::route('users.create')\n\t\t\t\t->withInput()\n\t\t\t\t->withErrors($validation);\n\t\t}\n\t\tFlash::error('Your account is not authorized to view this page');\n\t\treturn Redirect::to('home');\t\n\t}", "public function store(Request $request, User $user)\n {\n \tif(Auth::user()->type == 1){\n $user->create($request->merge(['password' => Hash::make($request->get('password'))])->all());\n \tsession()->flash('mensagem', 'Usuário inserido com sucesso!');\n \t\n return redirect()->route('users.index');\n \t}\n else\n return redirect()->route('login'); \n }", "private function create()\n {\n return $this->db->putUser($this->getDefaultAttributes());\n }", "public function store()\n {\n $validator = Validator::make(Input::all(), User::rules(), [], User::attributes());\n\n if ($validator->fails()) {\n return Redirect::action('Admin\\UserController@create')->withErrors($validator)->withInput();\n }\n\n $model = new User;\n $model->title = Input::get('title');\n $model->content = Input::get('content');\n $model->audit = Input::get('audit');\n if($model->save()){\n Request::session()->flash('info', '系统用户创建成功!');\n }\n return Redirect::action('Admin\\UserController@index');\n }", "public function store(NewUserRequest $request)\n {\n $attribute = [\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => $request->password,\n 'address' => '',\n 'phone' => '',\n 'is_admin' => true,\n ];\n $users = $this->userRepository->create($attribute);\n\n Session::flash('success', @trans('message.success.user.create_user'));\n\n return redirect()->route('admin.user.index');\n }", "public function store(UserRequest $request)\n {\n return $this->userService->save($request->validated());\n }", "public function store(UserRequest $request)\n {\n $uuid = Str::uuid()->toString();\n $request['uuid'] = $uuid;\n $request['password'] = Hash::make($request->password);\n $user = new User();\n $user = $user->create($request->all());\n $user->assignRole(config('fanbox.roles.admin'));\n\n return redirect()->route('admin.admins.edit', $user->id)->with('success', trans('admin/messages.admin_add'));\n }", "public function store()\n {\n $attributes = request()->validate([\n 'name' => [\n 'required',\n 'max:255',\n ],\n 'username' => [\n 'required',\n 'max:255',\n 'min:3',\n 'unique:users,username',\n ],\n 'email' => [\n 'required',\n 'email',\n 'max:255',\n 'unique:users,username',\n ],\n 'password' => [\n 'required',\n 'min:7',\n 'max:255',\n ],\n ]);\n\n /**\n * bcrypt()\n *\n * We must pass through the user's password through the bcrypt function to\n * hash it.\n */\n $attributes['password'] = bcrypt($attributes['password']);\n\n /**\n * create($attributes)\n *\n * You can pass the $attributes variable which will pass the POST array into\n * the create method.\n */\n $user = User::create($attributes);\n\n /**\n * Registration successful message\n *\n * We can create a quick message to inform user registration was successful.\n * session()->flash()\n * The session flash method saves a key/value that will only be stored for 1\n * request.\n *\n * This statement can be shorthanded using the redirect()->with() method.\n *\n * session()->flash(\"success\", \"Your registration was successful!\");\n */\n\n /**\n * User login\n *\n * Once a user has been created, we can create a session for them and sign\n * them in immediately. We call the auth() function which extends the\n * Auth::class that contains session related methods.\n */\n auth()->login($user);\n\n return redirect('/')->with(\"success\", \"Your registration was successful!\");\n\n }", "public function store(CreateUserRequest $request)\n {\n $request['birthday'] = Carbon::parse($request['birthday'])->format('Y-m-d');\n $request['password'] = bcrypt($request->password);\n User::create($request->all());\n return redirect()->route('admin.users.index')->with('message', __('user.admin.create.create_success'));\n }", "public function store(Request $request)\n {\n return $this->user->create($request->all());\n }", "public function store(UserRequest $request)\n {\n $user = User::create($request->getValues());\n\n $user->roles()->sync($request->getRoles());\n\n flash('Uživatel úspěšně vytvořen.', 'success');\n return redirect()->route('admin.users');\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$input['password']=Hash::make($input['password']);\n\n\t\t$validation = Validator::make($input, User::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$user = new User();\t\t\t\n\t\t\t$user->username = Input::get('username');\n\t\t\t$user->desusuario = Input::get('desusuario');\t\t\n\t\t\t$user->rolusuario = Input::get('rolusuario');\t\t\n\t\t\t$user->estado = 'ACT';\t\t\n\t\t\t$user->password = Hash::make(Input::get('password'));\t\t\n\t\t\t//$user->usuario_id = Input::get('usuario_id');\n\t\t\t$user->usuario_id = 1;\n\t\t\t$user->save();\n\n\t\t\t//$this->user->create($input); obviar el modo automatico\n\n\t\t\treturn Redirect::route('users.index');\n\t\t}\n\n\t\treturn Redirect::route('users.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "public function store(StoreRequestNewUser $request)\n {\n // dd($request);\n $user = new User();\n $user->name = $request->name;\n $user->lastname = $request->lastname;\n // 'password' => Hash::make($data['password']),\n $user->password = Hash::make($request->password);\n $user->email = $request->email;\n $user->save();\n Mail::to($request->email)->send(new CreateNewUser($user, $request->password));\n Session::flash('status_add_utilisateur', 'Employé créé avec succès.');\n return redirect()->route('admin');\n }", "public function store(UserRequest $request)\n {\n User::query()->create($request->validated());\n return redirect(route('users.index'));\n }", "public function store(UsersCreateRequest $request)\n {\n $user = new User();\n $user->name = trim($request->name);\n $user->email = trim($request->email);\n $user->role_id = trim($request->role_id);\n $user->password = trim(bcrypt($request->password));\n $user->phone = trim($request->phone);\n $saveAll = $user->save();\n if($saveAll){\n Session::flash('user_inserted', 'User Successfully Registered');\n return redirect('/user/create');\n }else{\n Session::flash('user_not_inserted', 'User Could not Registered');\n return redirect('/user/create');\n }\n }", "public function store(SaveUserRequest $request): Response\n {\n $this->authorize(Abilities::CREATE, new User());\n\n $user = $this->userService->store($request->getUserData());\n\n return $this->response->item($user, $this->transformer);\n }", "public function store(CreateUserRequest $request)\n {\n DB::beginTransaction();\n try{\n $user = new User($request->only('full_name','dni','phone','user','bank_account_number','role','group_id','sponsor_id'));\n $user->password= bcrypt($request->password);\n\n if(env('APP_DEBUG')){\n $user->created_at = session('day');\n }\n if(Auth::user()->role == 'admin'){\n $user->admin_id = Auth::user()->id;\n }\n if(Auth::user()->role == 'sponsored'){\n $user->admin_id = Auth::user()->admin_id;\n }\n $user->save();\n DB::commit();\n return response(['message' => 'Se ha creado el usuario corrrectamente','redirect'=>route('user.index')]);\n }catch(QueryException $e){\n DB::rollBack();\n return response(['message'=> 'QueryException :'.$e->getMessage(),'type' => 'error']);\n }catch(Exception $e){\n DB::rollBack();\n return response(['message'=> 'Exception :'.$e->getMessage(),'type' => 'error']);\n }\n }", "public function store(CreateUserRequest $request)\n {\n\n $user = new User;\n $user->name = $request->name;\n $user->username = $request->username;\n $user->email = $request->email;\n $user->roles = json_encode($request->roles);\n $user->password = Hash::make($request->password);\n if($request->file('avatar')){\n $file = $request->file('avatar')->store(\n 'avatars','public'\n );\n $user->avatar = $file;\n }\n $user->save();\n return redirect(route('user.index'))->with('status','User berhasil Ditambahkan !');\n }" ]
[ "0.7976019", "0.7892408", "0.75398266", "0.7396547", "0.730262", "0.7286644", "0.72544193", "0.7203232", "0.7188256", "0.717765", "0.71588266", "0.7143239", "0.7140904", "0.7129696", "0.7113036", "0.70371896", "0.7034208", "0.7021662", "0.69979644", "0.6986915", "0.6983948", "0.6968529", "0.6957226", "0.69487566", "0.69430554", "0.69338095", "0.6926845", "0.6924243", "0.6921828", "0.6912957", "0.6904417", "0.6896068", "0.6891253", "0.687641", "0.6866979", "0.6858421", "0.6850499", "0.68464094", "0.68457645", "0.6845196", "0.6843941", "0.6835274", "0.6832635", "0.6831365", "0.6829152", "0.68236727", "0.68222016", "0.6818112", "0.67963344", "0.67959553", "0.67934394", "0.6790925", "0.67883563", "0.67837596", "0.6781742", "0.6777723", "0.67762953", "0.6774284", "0.6773764", "0.676977", "0.67697537", "0.67595494", "0.6758262", "0.67580855", "0.6752909", "0.6748542", "0.67473966", "0.6743783", "0.67337745", "0.6732995", "0.6730204", "0.6726312", "0.6720341", "0.6715742", "0.67127955", "0.6711096", "0.67084706", "0.67079085", "0.670712", "0.66961527", "0.66864765", "0.66864157", "0.6684634", "0.6680929", "0.668066", "0.6676444", "0.6672451", "0.66698223", "0.6668953", "0.6667799", "0.6665442", "0.6653847", "0.6653159", "0.66526693", "0.6651623", "0.66509926", "0.6648248", "0.66476846", "0.66468847", "0.66445273" ]
0.711512
14
Show the form for editing a user
public function edit($crypt_id) { $user = $this->userRepo->get(Crypt::decrypt($crypt_id)); $available_roles = $this->userService->getAvailableRolesForSelect(Auth::user()->getLevel()); return View::make('user.edit', compact('user', 'available_roles'))->withEditForm(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }", "protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function edit()\n {\n return view(config('const.template.user.edit'), ['user' => User::find($this->guard()->id())]);\n }", "public function edit()\n\t{\n\t\treturn view('admin.users.edit')->with('user', $this->user);\n\t}", "function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}", "public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n \n $user = UserModel::load()->get($userId);\n\n return View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => $user,\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function edit()\n {\n return view('user.edit', [\n 'user' => Auth::user()\n ]);\n }", "public function edit()\n {\n $id = Auth::user()->id;\n $user = User::find($id);\n return view('user.edit', compact('user'));\n }", "public function editUser(UserEditForm $form, User $user);", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n\t{\n\t\t$user = App::make('user.current');\n\t\treturn View::make('shared.user.edit-user', $user->toArray());\n\t}", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('auth.user.edit')->with('user', auth()->user());\n }", "public function edit() {\r\n \tif (isset($_SESSION['userid'])) {\n \t $user=$this->model->getuser($_SESSION['userid']);\n \t $this->view->set('user', $user[0]);\n \t $this->view->edit();\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function edit()\n {\n $user = Auth::user();\n\n $data = [\n 'user' => $user,\n 'canEditSurname' => ($this->getGender($user->id_number) == 'F')\n ];\n\n return view('pages.user.edit', $data);\n }", "public function edit()\n {\n $user = User::where('id', Auth::user()->id)->get();\n return view('admin/edituser', compact('user', 'id')); \n }", "public function edituser(){\n\t\t$id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/edit_londontec_users';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Edit Londontec users',\n\t\t\t'londontec_users' => $this->setting_model->Get_Single('londontec_users','user_id',$id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function edit()\n {\n $user = User::where(\"email\",request(\"email\"))->get()->first();\n return view(\"admin.editUser\",compact(\"user\"));\n }", "public function actionEdit() {\n\n\t\t$userId = User::checkLogged();\n\t\t$user = User::getUserById($userId);\n\t\t$first_name = $user['first_name'];\n\t\t$last_name = $user['last_name'];\n\t\t$result = false;\n\n\t\tif (isset($_POST['submit'])) {\n\t\t\t$first_name = $_POST['first_name'];\n\t\t\t$last_name = $_POST['last_name'];\n\n\t\t\t$errors = array();\n\n\t\t\tif ($error = Validator::checkName($first_name)) $errors['first_name'] = $error;\n\t\t\tif ($error = Validator::checkName($last_name)) $errors['last_name'] = $error;\n\n\t\t\tif (empty($errors)) {\n\t\t\t\t$result = User::edit($userId, $first_name, $last_name);\n\t\t\t}\n\t\t}\n\t\t$pageTitle = \"Edit Details\";\n\t\trequire_once(ROOT . '/views/account/edit.php');\n\n\t\treturn true;\n\t}", "public function actionEdit()\r\n {\r\n $userId = User::checkLogged();\r\n\r\n $user = User::getUserById($userId);\r\n\r\n // new user info valiables\r\n $name = $user['name'];\r\n $password = $user['password'];\r\n\r\n $result = false;\r\n\r\n // form processing\r\n if (isset($_POST['submit'])) {\r\n $name = $_POST['name'];\r\n $password = $_POST['password'];\r\n\r\n $errors = false;\r\n\r\n // validate fields\r\n if (!User::checkName($name))\r\n $errors[] = 'Имя должно быть длиннее 3-х символов';\r\n\r\n if (!User::checkPassword($password))\r\n $errors[] = 'Пароль должен быть длиннее 5-ти символов';\r\n\r\n // save new data \r\n if ($errors == false)\r\n\r\n $result = User::edit($userId, $name, $password);\r\n }\r\n\r\n // attach specified view\r\n require_once(ROOT . '/app/views/cabinet/edit.php');\r\n return true;\r\n }", "public function edit()\n {\n /*get the user form auth*/\n $user = auth()->user();\n /*return view with that user*/\n return view('user.edit', compact('user'));\n }", "public function getPostEditUser()\n {\n // Render login page if not logged in.\n if (!$this->di->get(\"session\")->has(\"account\")) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $title = \"Edit\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n $user = new User();\n $username = $this->di->get(\"session\")->get(\"account\");\n $user->setDb($this->di->get(\"db\"));\n $user->find(\"username\", $username);\n\n $form = new EditUserForm($this->di, $user);\n\n $form->check();\n\n $data = [\n \"form\" => $form->getHTML(),\n ];\n\n $view->add(\"user/edit\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function edit()\n {\n $id=session()->get('user')->id;\n \n $user = User::find($id);\n $form=[\n \"value\" => \"update\",\n \"name\" => \"Edit Profile\",\n \"submit\" => \"Save\"\n ];\n\n return view('profile.form',compact('user','form'));\n }", "public function editAction(): void {\n View::renderTemplate('Profile/edit.twig', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n\t{\n\t\t\t$id = Auth::id();\n\t\t\n\t\t $userCardio = User::find($id)->UserCardio;\n\n\n // show the edit form and pass the userStat\n return View::make('userCardio.edit')\n ->with('userCardio', $userCardio);\n\t\t\n\t}", "public function editAction()\n {\n // Check logged\n $userId = UserModel::checkLogged();\n \n //We get user data\n $user = UserModel::getUserById($userId);\n \n \n $name = $user['name'];\n \n \n $result = false;\n \n // Form processing\n if (isset($_POST['submit'])) {\n \n // Getting data from the form\n $name = $_POST['name'];\n $password = $_POST['password'];\n \n \n // Form error flag\n $errors = false;\n \n // If necessary, you can validate the values as needed\n if (!UserModel::checkName($name)) {\n $errors[] = 'The name must not be shorter than 2 characters';\n }\n \n if (!UserModel::checkPassword($password)) {\n $errors[] = 'Password must not be shorter than 6 characters';\n }\n \n if ($errors == false) {\n $result = UserModel::edit($userId, $name, $password);\n }\n }\n \n // Connect the view\n $this->view('header.tpl');\n $this->view('view.tpl', ['user' => $user,\n 'result' => $result]\n );\n $this->view('footer.tpl');\n \n return true;\n }", "public function edit()\n {\n $user = Auth::user();\n\n return view('users.edit', ['user' => $user]);\n }", "public function edit(){\n\n \treturn View::make('users.edit');\t\n }", "public function edit()\n {\n $user = Auth::user();\n\n return view('users.edit', compact('user'));\n }", "public function editAction()\n\t {\n\t \t$id \t\t\t= (int) $this->getRequest()->getParam('id');\n\t \t$userService \t= new User_Service_User();\n\t \t$user\t\t\t= $userService->read( $id );\n\t \tif( !$user instanceof User_Model_User){\n\t \t\t$this->addSystemError('L\\'utilisateur n\\'existe pas');\n\t \t\t$this->_redirect( '/User/index/list');\n\t \t}\n\t \t$form \t\t\t= new User_Form_Edituser();\n\t \t$form->setAction( '/User/index/edit/id/' . $id);\n\t \tif( $this->getRequest()->isPost() ){\n\t \t\tif( $form->isValid( $this->getRequest()->getPost() ) ){\n\t\t\t\tif( $userService->update( $id, $form->getValues() )){\n\t\t\t\t\t$this->addSystemSuccess('Utilisateur mis à jour');\n\t\t\t\t} else {\n\t\t\t\t\t$this->addSystemError('Echec de la mise à jour');\n\t\t\t\t}\n\t \t\t} else {\n\t \t\t\t$this->addSystemError('Le formulaire contient des erreurs');\n\t \t\t}\n\t \t} else {\n\t\t\t$userData \t\t= array( 'login' => $user->getLogin(),\n\t\t\t\t\t\t\t\t\t 'nom' => $user->getNom(),\n\t\t\t\t\t\t\t\t\t 'prenom' => $user->getPrenom(),\n\t\t\t\t\t\t\t\t\t 'email' => $user->getEmail(),\n\t\t\t\t\t\t\t\t\t 'telephone' => $user->geTtelephone(),\n\t\t\t\t\t\t\t\t\t 'civilite' => $user->getcivilite() \n\t\t\t\t\t\t\t\t\t);\n\t\t\t$form->populate( $userData );\n\t \t}\n\t\t$this->view->form = $form;\n\t }", "public function edit()\n {\n //$user =User::find($id);\n $user =\\Auth::user();\n return view('users.edit',[\n 'title' =>'プロフィール編集',\n 'user'=>$user,\n ]);\n }", "public function edit(UserEditFormRequest $request) {\n $user = User::findOrFail($request->id);\n $data['user'] = $user;\n Former::populate($user);\n return view('users.edit', $data );\n }", "public function edit(User $user) //mostra formulário de edição de um usuário\n {\n $form = \\FormBuilder::create(UserForm::class,[\n 'url' => route('admin.users.update', ['user' => $user->id]),\n 'method' => 'PUT',\n 'model' => $user\n ]); //classe de formulario, url de ação do formulario e método http\n\n return view('admin.users.edit', compact('form'));\n }", "public function edit($id)\n {\n return view('admin-master.user.input', [\n 'user' => User::findOrFail($id)\n ]);\n }", "public function edit($user_id)\n\t{\n\t\t//\n\t}", "public function editForm( $id )\n {\n $user = User::find($id);\n return view('dashboard.admin.userEditForm', compact('user'));\n }", "public function edit($user) {\n\t\t$this->authorize('edit', $user);\n\t\treturn view(Config::get('boxtar.editUser'), compact('user'));\n\t}", "public function edit()\n {\n $user = Auth::user();\n // dd($user);\n return view('user.update', compact('user'));\n }", "public function edit()\n {\n $user = \\App\\User::find((Auth::user()->id));\n \n return view('auth.editAccount',['user'=>$user]);\n }", "public function edit(User $user) {\n\t\t$this->accessible();\n\n\t\treturn view('users.modify', compact('user'));\n\t}", "public function edit($id)\n {\n $user = User::whereId($id)->first();\n\n return $this->renderOutputAdmin(\"users.form\", [\n \"user\" => $user,\n \"route\" => route(\"admin.users.update\", [\"id_user\" => $id]),\n \"update\" => true\n ]);\n }", "public function edit($id)\n { \n $user = User::find($id);\n return view('admin.page.user.edit',compact('user'));\n \n }", "public function editAction()\n {\n $identity = Zend_Auth::getInstance()->getIdentity();\n $users = new Users_Model_User_Table();\n $row = $users->getById($identity->id);\n\n $form = new Users_Form_Users_Profile();\n $form->setUser($row);\n\n if ($this->_request->isPost()\n && $form->isValid($this->_getAllParams())) {\n\n $row->setFromArray($form->getValues());\n $row->save();\n\n $row->login(false);\n\n $this->_helper->flashMessenger('Profile Updated');\n $this->_helper->redirector('index');\n }\n $this->view->form = $form;\n }", "public function edit()\n {\n $user = User::where('id',auth()->id())->first();\n return view('super.profile.edit', [\n 'edit' => $user,\n ]);\n }", "public function edit(User $user)\n {\n \n }", "public function editLoggedIn()\n {\n return view('users.edit')->with('user', Auth::user());\n }", "public function edit(User $user)\n {\n return view ('users.edit', compact('user'));\n\n }", "public function edit($id = 0)\n {\n if ($id) {\n $user = User::find($id);\n return view('users.usersform')->withUser($user);\n }\n }", "public function edit($id)\n {\n $user=user::find(1);\n return View('admin.user.edit',['record'=>$user]);\n }", "public function edit($id) {\n \t$user = User::frontuser()->find($id);\n \tif(!empty($user)) {\n \t\t$data = ['menu_users' => true];\n \t\t$data['user'] = $user;\n \t\treturn view('manage.user', $data);\n \t}\n \telse {\n \t\treturn view('manage.errors.404');\n \t}\n }", "public function edit($id)\n {\n\t\t$user\t= AdminUser::find((int)$id);\n\t\tif(empty($user))\n\t\t\treturn redirect('admin/adminuser/user')->withErrors('没有此用户');\n\n return view('admin.adminuser.userForm', [\n\t\t\t'bdb'\t=> [['name'=>'后台用户管理'], ['name'=>'编辑用户'],], \n\t\t\t'roles'\t=> Role::all(),\n\t\t\t'user'\t=> $user,\n\t\t\t]);\n }", "public function edit($id) {\n View::share('title', 'Felhasználó módosítása');\n $this->layout->content = View::make('admin.users.edit')->with('user', User::find($id));\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n\n $loggedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $this->getIdentity()->getId() );\n\n $editedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $id );\n\n $form = $this->createForm('\\Panel\\Form\\User\\User', array(\n 'loggedUserRole' => $loggedUser->getRole(),\n 'editedUserRole' => $editedUser->getRole(),\n ));\n\n if($id)\n {\n $form = $form->bindObjectById($id);\n }\n\n $request = $this->getRequest();\n if ($request->isPost())\n {\n $data = array(\n 'name' => $request->getPost()->name,\n 'email' => $request->getPost()->email,\n 'phone' => $request->getPost()->phone,\n 'birthDate' => $request->getPost()->birthDate,\n 'height' => $request->getPost()->height,\n 'tmrModifier' => $request->getPost()->tmrModifier,\n 'goalWeight' => $request->getPost()->goalWeight,\n 'personality' => $request->getPost()->personality,\n 'activityLevel' => $request->getPost()->activityLevel,\n 'isFemale' => $request->getPost()->isFemale,\n 'status' => $request->getPost()->status,\n 'role' => $request->getPost()->role,\n );\n\n if($request->getPost()->password!='')\n {\n $data['password'] = $request->getPost()->password;\n }\n\n $form->setData($data);\n\n if ($form->isValid())\n {\n $entityManager = $this->getEntityManager();\n\n $user = $form->getObject();\n\n if($request->getPost()->password!='')\n {\n $user->setPassword($request->getPost()->password);\n }\n\n $userFromEmail = $entityManager\n ->getRepository('Core\\Entity\\User')\n ->findOneBy(array('email' => $user->getEmail()));\n\n if($userFromEmail==null || $userFromEmail->getId()==$user->getId())\n {\n $entityManager->persist($user);\n $entityManager->flush();\n\n $this->flashMessenger()->addSuccessMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User has been modified.\")\n );\n\n if( $id)\n {\n return $this->redirect()->toRoute(\n 'panel/user/:id', array('id' => $id)\n );\n }\n else\n {\n return $this->redirect()->toRoute('panel/user');\n }\n }\n else\n {\n $form->setData($request->getPost());\n\n $this->flashMessenger()->addErrorMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User hasn't been modified. E-mail already exists.\")\n );\n }\n }\n }\n\n $view = new ViewModel();\n $view->setVariable('user', $form->getObject());\n $view->setVariable('form', $form);\n\n return $view;\n }", "public function edit($id)\n {\n $user = \\App\\User::find($id);\n\n return view('webcontrol.user.edit', compact('user'));\n }", "public function edit($id) {\n $user = User::find($id);\n return view('backend.user.edit', compact('user'))->with('active', 'user');\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }" ]
[ "0.84471935", "0.83827776", "0.8321912", "0.82228756", "0.821246", "0.80734587", "0.8070351", "0.8056989", "0.8054402", "0.80113125", "0.79563457", "0.7928251", "0.7919669", "0.7904967", "0.7873921", "0.78688926", "0.7856105", "0.7856105", "0.7853337", "0.77720857", "0.7761481", "0.7752181", "0.77470607", "0.7736574", "0.7724484", "0.77200043", "0.7704795", "0.7698304", "0.7694244", "0.7686328", "0.76856583", "0.76823825", "0.76660764", "0.76623666", "0.76311827", "0.7624793", "0.76154447", "0.75783336", "0.7576839", "0.75494015", "0.752349", "0.75206697", "0.75203264", "0.7518138", "0.7500989", "0.7489697", "0.7480716", "0.74793774", "0.7475388", "0.7465056", "0.7462368", "0.74613047", "0.7459203", "0.7454809", "0.7449875", "0.7445645", "0.74404126", "0.74388885", "0.74248874", "0.7422988", "0.74227333", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594", "0.74134594" ]
0.0
-1
Update the specified resource in storage.
public function update($crypt_id) { $user_id = Crypt::decrypt($crypt_id); if (!$this->userService->update($user_id, Input::all())) { return Redirect::back()->withErrors($this->userService->errors())->withInput(); } Alert::success('User successfully updated!')->flash(); return Redirect::route('dashboard.users.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($crypt_id) { $user_id = Crypt::decrypt($crypt_id); if (!$this->userService->delete($user_id)) { return Redirect::back()->withErrors($this->userService->errors())->withInput(); } Alert::success('User successfully deleted!')->flash(); return Redirect::route('dashboard.users.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Disable the specified user
public function disable($crypt_id) { $user_id = Crypt::decrypt($crypt_id); if (!$this->userService->disable($user_id)) { return Redirect::back()->withErrors($this->userService->errors())->withInput(); } Alert::success('User successfully disabled!')->flash(); return Redirect::route('dashboard.users.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function disable_user() \n {\n $conn = $this->conn;\n $login = $this->login;\n \n $params = array($login);\n $query = \"UPDATE users SET enabled = -1 WHERE login = ?\";\n \n $rs = $conn->Execute($query, $params);\n \n if (!$rs) \n { \n return FALSE;\n }\n \n $infolog = array($login);\n Log_action::log(93, $infolog);\n \n return TRUE;\n }", "public function disable()\n {\n $id=$this->seguridad->verificateInt($_REQUEST['delete_id']);\n $token = $_REQUEST['token'];\n $option = $this->seguridad->verificateInt(intval($_REQUEST['option']));\n if($id && $token && $option)\n {\n parent::DisableUser($id,$token,$option);\n }\n return;\n }", "function admin_disable($id = null) {\n\n\t\t$user = $this->User->read(null, $id);\n\n\t\t/**\n\t\t * Read the \"Status\" component for more informations.\n\t\t * Dir : controllers/components/status.php\n\t\t */\n\t\tif (!empty($user)) {\n\n\t\t\t$user['User']['status'] = 1;\n\n\t\t\t/**\n\t\t\t * Change the user status.\n\t\t\t * Redirect the administrator to index page.\n\t\t\t */\n\t\t\tif ($this->User->save($user)) {\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been disabled.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t}\n\t\t}\n\n\t}", "Public Function disableUser($ID)\n\t{\n\t\t$this->_db->exec(\"UPDATE bevomedia_user SET enabled = 0 WHERE id = $ID\");\n\t}", "public function disable($user_id = 0)\n {\n header('Content-Type: application/json'); //set response type to be json\n admin_session_check();\n if(!$user_id) show_404();\n $user = $this->users_model->get_record($user_id);\n if(!isset($user->user_id))\n {\n $ajax_response = array('type' => AJAX_RESPONSE_TYPE_ERROR, 'message' => get_alert_html($this->lang->line('error_invalid_request'), ALERT_TYPE_ERROR));\n echo json_encode($ajax_response);\n exit();\n }\n if($user->user_id == $this->session->userdata('user_id'))\n {\n $ajax_response = array('type' => AJAX_RESPONSE_TYPE_ERROR, 'message' => get_alert_html($this->lang->line('error_disable_self'), ALERT_TYPE_ERROR));\n echo json_encode($ajax_response);\n exit();\n }\n $this->users_model->update_user_status($user_id, USER_STATUS_INACTIVE);\n $ajax_response = array('type' => AJAX_RESPONSE_TYPE_SUCCESS, 'message' => get_alert_html($this->lang->line('success_user_disabled'), ALERT_TYPE_SUCCESS));\n echo json_encode($ajax_response);\n }", "public function disable(User $user){\n return $this->respond($user->disable());\n }", "function disable($target_username) {\n $this->stmnt('UPDATE USERS SET DISABLED=\\'yes\\', TIMESTAMP_CHANGE = NOW() WHERE MONK_ID = \\'' . $target_username . '\\'');\n }", "public function user_disable($username,$isGUID=false){\n if ($username===NULL){ return (\"Missing compulsory field [username]\"); }\n $attributes=array(\"enabled\"=>0);\n $result = $this->user_modify($username, $attributes, $isGUID);\n if ($result==false){ return (false); }\n \n return (true);\n }", "public function disable();", "public function disable()\n {\n $user = User::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n $user->status = 2;\n $user->confirmation_code = NULL;\n $user->save();\n return Redirect::to('logout');\n }", "public function disable_user(Request $request)\n {\n $user = User::findOrFail($request->id);\n $user->estado = '0';\n $user->save();\n }", "public function disable($disabledByUserId = null)\n\t{\n\t\tif (!$disabledByUserId) {\n\t\t\tif (auth()->user()) $disabledByUserId = auth()->id();\n\t\t}\n\n\t\tif ($disabledByUserId) {\n\t\t\t$this->disabled_by_user_id = $disabledByUserId;\n\t\t}\n\n\t\t$this->disabled_at = now();\n\t\t$this->setRememberToken(null);\n\n\t\t$this->save();\n\t}", "public function deactivate($username);", "public function disable_couch_user() {\n $query = 'UPDATE couchs ';\n $query .= 'SET enabled=FALSE ';\n $query .= 'WHERE user_id=' . $this->id;\n\n $connection = get_connection();\n $query_result = $connection->query($query);\n\n $connection->close();\n\n return $query_result;\n }", "public function disable() {}", "public function disableAccount($userId) {\n\n if (Auth::user()->id == $userId) {\n return response()->json([\n 'title' => 'Ooops.',\n 'message' => 'Nu îți poți dezactiva contul tău.',\n ], 422);\n }\n\n User::where('id', $userId)->update([\n 'disabled' => true\n ]);\n\n return response()->json([\n 'title' => 'Succes!',\n 'message' => 'Contul a fost dezactivat!'\n ]);\n }", "public function disable( $name );", "public function onDisable() {\n\t}", "function disable_user($email) {\n // Build the query\n $query = \"UPDATE UserAccount SET enabled=0 WHERE email = ?\";\n // Execute the query\n $result = $this->db->query($query, $email);\n // Check if the row was affected\n if ($this->db->affected_rows() == 1) {\n $message = \"Success: account disabled.\";\n } else {\n $message = \"Error: failed to disable account.\";\n }\n // Return the result message\n return $message;\n }", "function disable_salesperson($user_id) {\n\n $conn = db_connect();\n\n // Prepared statement for selecting salesperson dropdown options\n $disable_salesperson_stmt = pg_prepare(\n $conn,\n \"disable_salesperson_stmt\",\n \"UPDATE users SET enabled = false, type = 'd' WHERE id = $user_id;\"\n );\n\n $result = pg_execute($conn, \"disable_salesperson_stmt\", array());\n}", "public function disable_user(User $user)\n {\n $this->authorize('disable_user', User::class);\n $user->active = 0;\n $user->save();\n\n if($user->verify_if_current_user_account_is_disabled())\n {\n auth()->logout();\n return redirect('/');\n }\n\n return redirect()->route('edit_user_path', $user->id);\n }", "public function disableUser(User $user) {\n // Disable user\n $user->api_token = '';\n $user->status = 'disabled';\n $user->save();\n\n return new Response([\n 'message' => 'User Disabled',\n 'user' => $user\n ]);\n }", "function disableAccount($userID, $enabled)\n {\n if ($enabled)\n {\n $newStatus = 0;\n }\n else\n {\n $newStatus = 1;\n }\n return $this->data->updateUserStatus($userID, $newStatus);\n }", "function disable()\n{\n\t$args = func_get_args();\n\tif (is_array($args[0])) $args = $args[0];\n\t$this->enable($args, false);\n}", "function _deactivate_user() {\n\t\t$sql=\"SELECT GROUP_CONCAT(id_user) as id FROM \".TABLE_PREFIX.\"user WHERE DATEDIFF(current_date(),last_login) = \".$this->_input['day'].\" AND id_admin <> 1 \";\n\t\t$ids= getsingleindexrow($sql);\n\t\tif($this->_input['day'] && $this->_input[\"flag\"] == 1){\n\t\t if($ids['id']!=\"\"){\n\t\t\t $arr['user_status']=0;\n\t\t\t $this->obj_user->update_this(\"user\",$arr,\"id_user IN (\".$ids['id'].\")\");\n\t\t\t $this->obj_user->update_this(\"meme\",$arr,\"id_user IN (\".$ids['id'].\")\");\n\t\t\t $this->obj_user->update_this(\"reply\",$arr,\"id_user IN (\".$ids['id'].\")\");\n\t\t\t $this->obj_user->update_this(\"caption\",$arr,\"id_user IN (\".$ids['id'].\")\");\n\t\t\t print \"Succesfully Done\";\n\t\t }else{\n\t\t\t print \"No user found\";\n\t\t\t exit;\n\t\t }\n\t\t }else{\n\t\t if($ids['id']!=\"\"){\n\t\t\t $arr=explode(\",\", $ids['id']);\n\t\t\t for($x=0;$x<count($arr);$x++){\n\t\t\t $del=$this->unlink_files($arr[$x]);\n\t\t\t }\n\t\t\t $this->obj_user->deleteuser($ids['id']);\n\t\t }\n\t\t}\n\t}", "function deactivateUser($userid)\n {\n $data= array(\n 'status' => 0\n );\n $this->db->where('id', $userid);\n $this->db->update('user', $data);\n }", "static public function disableUser($dsn, $username)\n\t{\n\t\t$driver = QuickBooks_Utilities::driverFactory($dsn);\n\t\t\n\t\treturn $driver->authDisable($username);\n\t}", "public function disabledEnabled(Users $user)\n {\n if ($user->isEnabled()) {\n $user->setEnabled(false);\n } else {\n $user->setEnabled(true);\n }\n\n $this->getEntityManager()->flush($user);\n }", "public static function disable(){\n self::$disabled = true; \n self::$enabled = false;\n }", "function disableAdministrator($id) {\r\n\r\n\t\t$this->query('UPDATE admins SET `enabled` = 0 WHERE id= '. $id .';');\r\n\r\n\t}", "public function disable() {\n\t\t$this->update(TRUE);\n\t}", "public function is_user_disabled() \n {\n $conn = $this->conn;\n $login = $this->login;\n \n $clogin = $conn->GetOne(\"SELECT login FROM users WHERE login = '\".$login.\"' AND expires > '\".gmdate('Y-m-d H:i:s').\"'\");\n \n if ($clogin == '') \n {\n $this->conn->Execute(\"UPDATE users SET enabled=0 WHERE login= '\".$login.\"'\");\n }\n \n $conf = $GLOBALS['CONF'];\n $lockout_duration = intval($conf->get_conf(\"unlock_user_interval\")) * 60; \n \n \n $params = array($login);\n $query = \"SELECT * FROM users WHERE login = ? AND enabled <= 0\";\n \n $rs = $conn->Execute($query, $params); \n \n if (!$rs) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n \n return FALSE;\n }\n \n if (!$rs->EOF) \n {\n // User must be unlocked by admin\n if ($lockout_duration == 0 || $rs->fields['enabled'] == 0) \n { \n return TRUE; \n }\n \n //Auto-enable if account lockout duration expires\n if (time() - strtotime($rs->fields['last_logon_try']) >= $lockout_duration) \n {\n $conn->Execute('UPDATE users SET enabled = 1 WHERE login=?', $params);\n \n return FALSE;\n }\n \n return TRUE;\n }\n \n return FALSE;\n }", "function ff_disable_feature_for_user( $feature, $user_id = 0 )\n\t{\n\t\tff_FeatureFlags::getInstance()->getFeature( $feature )->removeFromUser( $user_id );\n\t}", "function unlockAccount($userid){\n $query = \"UPDATE users_account SET status ='Active' WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $userid\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }", "public function disableAccountForAuthFailures($user_id){\r\n\tglobal $pdo;\r\n\ttry{\r\n\t$update = $pdo->prepare(\"UPDATE users \r\n\tSET `status_reason` = ?, `status` = 0\r\n\tWHERE id = ?\");\r\n\t$update->execute(array('auth_failure', $user_id));\r\n\t}\r\n\tcatch(PDOException $e){\r\n\t\t$this->setError($e->getMessage());\r\n\t\treturn false;\r\n\t}\r\n\t// Also remove failed login attempts\r\n\t// from the log table\r\n\t$this->user_id = $user_id;\r\n $this->removeFailedLoginAttempts();\r\n\t$this->user_id = null;\r\n\treturn true;\r\n}", "public function disable(): void\n {\n $this->disabled = true;\n }", "public function disable()\n {\n $this->enabled = false;\n }", "function disableAccount($accountId)\n\t\t{\n\t\t\tmysql_query(\"UPDATE argus_accounts SET status = 'DISABLED' WHERE account_id = '\".$accountId.\"' AND status = 'ENABLED'\") or die(mysql_error());\n\t\t\t\n\t\t\treturn;\n\t\t}", "function deactivateUser()\n {\n // Sets the value of activated to no\n $int = 0;\n\n $mysqli = $this->conn;\n\n /* Prepared statement, stage 1: prepare */\n if (!($stmt = $mysqli->prepare(\"UPDATE User SET\n \t\t\tactiveUser = ?\n \t\t\t\tWHERE ID = ?\"))\n ) {\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n }\n\n /* Prepared statement, stage 2: bind and execute */\n\n if (!($stmt->bind_param(\"ii\",\n $int,\n $this->id))\n ) {\n echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n }\n\n if (!$stmt->execute()) {\n echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\n }\n\n }", "function toggle_user($username,$force_disable=false){\n\n\t//Toggle enable status\n\t$my_row=array();\n\t$row =_user_load_user($username);\n\t//var_dump($row);\n\tif ($row['STATUS']==\"1\"){\n\t\t$my_row['ABILITATO']=\"0\";\n\t\t$enab = \"DISABLED\";\n\t}else{\n\t\t$my_row['ABILITATO']=\"1\";\n\t\t$enab = \"ENABLED\";\n\t}\n\tif($force_disable){\n\t\t$my_row['ABILITATO']=\"0\";\n\t\t$enab = \"DISABLED\";\n\t}\n\t$my_row['USERID'] = $row['USERID'];\n\t//var_dump($my_row);\n\t$retval = true;\n\t$table = \"UTENTI\";\n\t$action = ACT_MODIFY;\n\t$keys = array('USERID');\n\t//common_add_message(print_r($row,true),INFO);\n\tif (db_form_updatedb($table, $my_row, $action, $keys)){\n\t\t//common_add_message(\"Privilege $enab\", INFO);\n\t}else{\n\t\t//common_add_message(\"Error during privilege toggling\", ERROR);\n\t\t$retval = false;\n\t}\n\tif($retval){\n\t\tdb_commit();\n\n\t}\n\tif(isAjax()){\n\t\techo json_encode(array(\"sstatus\" => $retval ? \"ok\" : \"ko\", \"return_value\"=>$retval));\n\t\tdb_close();die();\n\t}\n\telse {\n\t\tdb_close();\n\t\treturn $retval;\n\t}\n}", "function disable($target = 'core');", "function noUser() {\n\t}", "public function disable(Module $module);", "public function stopImpersonateUser(): void\n {\n $this->impersonateUser = null;\n }", "public function disabled();", "public function disabled();", "protected function toggleDisableAction() {}", "public function disable_hotspot_user($id){\n $input = array(\n 'command' => '/ip/hotspot/user/disable',\n 'id' => $id\n );\n return $this->query($input); \n }", "function deactivate($uID=\"\") {\n if(!$uID) {\n echo \"Need uID to deactivate!! - error dump from User_class.php\";\n exit;\n }\n $SQL = \"UPDATE User \".\n \"SET Active = '0' \".\n \"WHERE ID = $uID\";\n mysqli_query($this->db_link, $SQL);\n\n }", "public function toggle_enabled_user($conn, $user) \n { \n Ossim_db::check_connection($conn);\n \n $params = array($user);\n $query = \"SELECT enabled FROM users WHERE login = ?\";\n \n $rs = $conn->Execute($query, $params);\n \n if (!$rs) \n { \n return FALSE;\n } \n \n $enabled = ($rs->fields['enabled'] <= 0) ? 1 : 0;\n \n if($enabled == 1) \n {\n $clogin = $conn->GetOne(\"SELECT login FROM users WHERE login = '\".$user.\"' AND expires > '\".gmdate('Y-m-d H:i:s').\"'\");\n \n if ($clogin == '') \n {\n if ($conn->Execute(\"UPDATE users SET expires = '2200-01-01 00:00:00' WHERE login = '\".$user.\"'\") === FALSE) \n { \n return FALSE;\n }\n }\n }\n\n $query = \"UPDATE users SET enabled = $enabled WHERE login = ?\";\n $rs = $conn->Execute($query, $params);\n \n if (!$rs) \n { \n return FALSE;\n }\n \n return TRUE; \n }", "function isDisabled($useraccountcontrol) {\n\t$accountdisable = 0x0002 & $useraccountcontrol;\t\n\n if ($accountdisable == 2) {\n\t\treturn true;\n } \t\t\n \n return false;\n}", "public function disableTwoFactorAuth()\n {\n if (! Authy::isEnabled($this->theUser)) {\n return redirect()->route('profile')\n ->withErrors(trans('app.2fa_not_enabled_for_this_user'));\n }\n\n Authy::delete($this->theUser);\n\n $this->theUser->save();\n\n event(new TwoFactorDisabled);\n\n return redirect()->route('profile')\n ->withSuccess(trans('app.2fa_disabled'));\n }", "function revoke_super_admin($user_id)\n {\n }", "public function toggleUserLock($userid) {\n\t\t$adminModel = $this->loadModel('admin');\n\t\t$user = $adminModel->getUser($userid);\n\t\tif ($user->user_status == 1) {\n\t\t\t$adminModel->setUserStatus($userid, 2);\n\t\t} elseif ($user->user_status == 2) {\n\t\t\t$adminModel->setUserStatus($userid, 1);\n\t\t}\n\t\theader('Location: '.URL.'admin/users');\n\t}", "function wp_revoke_user($id)\n {\n }", "public static function disable() {\n\t\tself::$enabled = false;\n\t}", "function disableAuth($value = true){\n\t\t$GLOBALS['amfphp']['disableAuth'] = $value;\n\t}", "function uservalidationbyadmin_disable_new_user($hook, $type, $value, $params) {\n\t$user = elgg_extract('user', $params);\n\n\t// no clue what's going on, so don't react.\n\tif (!$user instanceof ElggUser) {\n\t\treturn;\n\t}\n\n\t// another plugin is requesting that registration be terminated\n\t// no need for uservalidationbyadmin\n\tif (!$value) {\n\t\treturn $value;\n\t}\n\n\t// has the user already been validated?\n\tif (elgg_get_user_validation_status($user->guid) == true) {\n\t\treturn $value;\n\t}\n\n\t// disable user to prevent showing up on the site\n\t// set context so our canEdit() override works\n\telgg_push_context('uservalidationbyadmin_new_user');\n\t$hidden_entities = access_get_show_hidden_status();\n\taccess_show_hidden_entities(TRUE);\n\n\t// Don't do a recursive disable. Any entities owned by the user at this point\n\t// are products of plugins that hook into create user and might need\n\t// access to the entities.\n\t// @todo That ^ sounds like a specific case...would be nice to track it down...\n\t$user->disable('uservalidationbyadmin_new_user', FALSE);\n\n\t// set user as unvalidated and send out validation email\n\telgg_set_user_validation_status($user->guid, FALSE);\n\tuservalidationbyadmin_request_validation($user->guid);\n\n\telgg_pop_context();\n\taccess_show_hidden_entities($hidden_entities);\n\n\treturn $value;\n}", "public static function disable()\n {\n self::$_enabled = FALSE;\n }", "public function disable_reservation_user() {\n $query = 'UPDATE reservations ';\n $query .= 'SET state_id = 3 ';\n $query .= 'WHERE state_id IN (1,2) ';\n $query .= 'AND user_id=' . $this->id;\n\n $connection = get_connection();\n $query_result = $connection->query($query);\n\n $connection->close();\n\n return $query_result;\n }", "public function disableTwoFactorWithRequest($userId, $request)\n {\n return $this->start()->uri(\"/api/user/two-factor\")\n ->urlSegment($userId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->delete()\n ->go();\n }", "private function deactivateUser($conn){\n\t\t\t$postdata = file_get_contents(\"php://input\");\n\t\t\t$request = json_decode($postdata);\n\t\t\t$user_id = $request->user_id; \n\t\t\tif($user_id > 0){\n\t\t\t\t$query = 'Update users set user_status = 1 WHERE user_id = '.$user_id;\t\t\t\n\t\t\t\t$sql = $conn->query($query); \n\t\t\t\t$query2 = 'SELECT playlist_id FROM playlist where user_id = '.$user_id;\n\t\t\t\t$sql2 = $conn->query($query2);\n\t\t\t\tif($sql2->num_rows > 0){\n\t\t\t\t\t$result = $sql2->fetch_assoc();\n\t\t\t\t\t$query3 = 'Update playlist set playlist_status = 1 WHERE playlist_id = '.$result['playlist_id'];\t\t\t\n\t\t\t\t\t$sql3 = $conn->query($query3);\n\t\t\t\t\t$query4 = 'Update rel_playlist_tracks set rel_playlist_tracks_status = 1 WHERE playlist_id = '.$result['playlist_id'];\n\t\t\t\t\t$sql4 = $conn->query($query4); \n\t\t\t\t\t$this->response('',200);\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$this->response('',204);\n\t\t\t\t\n\t\t\t}else\n\t\t\t\t$this->response('',204); \n\t\t}", "public function disable(): bool {}", "private function deactivate_user($id) {\n\t\t//Update user table\n\t\t$query = \"UPDATE users SET deactivated='1' WHERE id='$id'\";\n\t\t$update_database = mysqli_query($this->con, $query);\n\t\t//Insert into User History for Documentation\n\t\t$employee_id = $this->check_employee_id($id);\n\t\t$query = \"INSERT INTO user_history (employee_id, access_prior, access_after, updated_by, note) VALUES ('$employee_id','0', '0', 'System', 'Account Deactivated due to 180 days of No Access.')\";\n\t\t$insert_database = mysqli_query($this->con, $query);\n\t}", "public static function disable(): void\n {\n self::$isEnabled = false;\n }", "public static function disable(): void\n {\n static::$_enabled = false;\n }", "public function closeUser()\n {\n $this->isUser = false;\n }", "private function userUnblock()\n\t{\n\t\t// Make sure the payment is complete\n\t\tif($this->state != 'C') return;\n\t\t\n\t\t// Make sure the subscription is enabled\n\t\tif(!$this->enabled) return;\n\t\t\n\t\t// Paid and enabled subscription; enable the user if he's not already enabled\n\t\t$user = JFactory::getUser($this->user_id);\n\t\tif($user->block) {\n\t\t\t// Check the confirmfree component parameter and subscription level's price\n\t\t\t// If it's a free subscription do not activate the user.\n\t\t\tif(!class_exists('AkeebasubsHelperCparams')) {\n\t\t\t\trequire_once JPATH_ADMINISTRATOR.'/components/com_akeebasubs/helpers/cparams.php';\n\t\t\t}\n\t\t\t$confirmfree = AkeebasubsHelperCparams::getParam('confirmfree', 0);\n\t\t\tif($confirmfree) {\n\t\t\t\t$level = FOFModel::getTmpInstance('Levels', 'AkeebasubsModel')\n\t\t\t\t\t->getItem($this->akeebasubs_level_id);\n\t\t\t\tif($level->price < 0.01) {\n\t\t\t\t\t// Do not activate free subscription\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$updates = array(\n\t\t\t\t'block'\t\t\t=> 0,\n\t\t\t\t'activation'\t=> ''\n\t\t\t);\n\t\t\t$user->bind($updates);\n\t\t\t$user->save($updates);\n\t\t}\n\t}", "public function disableCredential($id): void;", "public function actionDisable()\n\t{\n\t\t// can be requested over GET, so check for the token manually\n\t\t$this->_checkCsrfFromToken($this->_input->filterSingle('_xfToken', XenForo_Input::STRING));\n\t\n\t\t$fieldId = $this->_input->filterSingle('field_id', XenForo_Input::UINT);\n\t\treturn $this->_switchFormActiveStateAndGetResponse($fieldId, 0);\n\t}", "public function admin_disable($id = null) {\n\n\t\t\t/*disable rendering of view*/\n\t\t\t$this->autoRender = false;\n\n\t\t\t/*set activity as \"Disable\"*/\n\t\t\t$act=array('activ'=>'0');\n\n\t\t\t/*save activity parameter to table \"modules\"*/\n\t\t\t$this->Module->id=$id;\n\t\t\t$this->Module->save($act);\n\n\t\t\t/*back to method \"admin_index\"*/\n\t\t\t$this->redirect(array('action' => 'admin_index'));\n\t\t\t}", "public function disable_powered_by() {\n\t\tupdate_option( 'algolia_powered_by_enabled', 'no' );\n\t}", "public function disableTwoFactorAuth(): void\n {\n $this->twoFactorAuth->flushAuth()->delete();\n\n event(new Events\\TwoFactorDisabled($this));\n }", "public function deactivateUser($userId)\n {\n return $this->start()->uri(\"/api/user\")\n ->urlSegment($userId)\n ->delete()\n ->go();\n }", "public function disableAction(Request $request, $id)\n {\n //$form = $this->createDeleteForm($id);\n //$form->handleRequest($request);\n //if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('RegistroEventosCoreBundle:Usuario')->find($id);\n \n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Usuario entity.');\n }\n \n if ($entity == $this->get('security.context')->getToken()->getUser()) {\n return $this->redirect($this->generateUrl('usuarios'));\n }\n \n $entity->setBaja(TRUE);\n $entity->setEnabled(FALSE);\n $em->persist($entity);\n $em->flush();\n //}\n\n return $this->redirect($this->generateUrl('usuarios'));\n }", "public function deactivateUser($user_id)\n\t{\n\t\tif($this->getUserStatusId($user_id) === 2 || $this->getUserStatusId($user_id) === 1)\n\t\t{\n\t\t\t$this->where('id', '=', $user_id)->update(['user_status' => 3]);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function enableUserAndGroupSupport(){\n\t\treturn false;\n\t}", "public function disablePostAuthentication()\n {\n $this->sessionStorage->user['twofactor_activated'] = false;\n }", "function user_disable_free_gacha(int $user_id)\r\n{\r\n\tglobal $DATABASE;\r\n\tglobal $UNIX_TIMESTAMP;\r\n\t\r\n\t$DATABASE->execute_query('INSERT OR IGNORE INTO `free_gacha_tracking` VALUES (?, ?)', 'ii', $user_id, $UNIX_TIMESTAMP - ($UNIX_TIMESTAMP % 86400) + 86400);\r\n}", "public function disableForUser($feature)\n {\n $f = $this->getFeature($feature);\n if ($f == null) return;\n\n if ($this->state && $f->canChange()) {\n $this->state->setFeatureEnabled($feature, false);\n }\n }", "public function logOff();", "function lockout($username = \"\") {\n\t\tglobal $wpdb;\n\n\t\t$ip = $this->get_user_ip();;\n\n\t\t$username = sanitize_user($username);\n\n\t\t$user = get_user_by( 'login', $username );\n\n\t\tif ( !$user ) { \n\t\t\t$user = new stdClass();\n\t\t\t$user->ID = 0;\n\t\t}\n\n\t\t$sql = \"insert into \" . $this->lock_table . \" (user_id, lockdown_date, release_date, lockdown_IP) \" .\n\t\t\t \"values ('\" . $user->ID . \"', NOW(), date_add( NOW(), interval \" .\n\t\t\t $this->ll_options['lockout_length'] . \" MINUTE), '\" . $wpdb->escape($ip) . \"')\";\n\n\t\t$wpdb->query($sql);\n\n\t\tif ( 'yes' == $this->ll_options['notify_admins'] )\n\t\t\t$this->ll_notify_admins( $ip, $username );\n\n\t}", "public function inactiveUser($user_id)\r\n\t{\r\n\t\t$data=array('status'=>0);\r\n\t\t$where=$this->getAdapter()->quoteInto('user_id=?',$user_id);\r\n\t\t$this->update($data,$where);\r\n\t}", "function only_empty_user_disabled($nameModule = \"\",$type_rol = \"\") {\n\t\tif ($type_rol == \"Admin\") {\n\t\t\techo \"<script> document.getElementById('all_download_actived_log').style.display = 'none'; </script>\";\n\t\t}\n\t\techo \"<center><div class='panel panel-primary'>\n\t\t\t\t<div class='panel-heading'>\n\t\t\t\t\t<h3 class='panel-title'>Aviso!</h3>\n\t\t\t\t</div>\n\t\t\t\t<div class='panel-body'>\n\t\t\t\t\t<h4>En este momento no hay $nameModule Inactivos en el sistema. </h4>\n\t\t\t\t</div>\n\t\t\t</div></center>\";\n\t}", "public function executeDisabled()\n {\n }", "public function banUser(){\n if($this->adminVerify()){\n\n }else{\n echo \"Vous devez avoir les droits administrateur pour accéder à cette page\";\n }\n }", "function cancel_user($user_id, $password) {\n global $sql;\n $res = $sql->sql_select_array_query(\"SELECT * FROM `user` WHERE id = '{$user_id}' AND status = 1\");\n if (count($res) >= 1) {\n $user = $res[0];\n $user_id = $user['id'];\n $email = $user['email'];\n if (hash('sha512', $password) === $user['password'] || $password === $user['password']) {\n // Passwords match - lets delete everything from this user\n // ToDo: Put it all in one query\n $sql->sql_delete('confirm', ['user_id' => $user_id]);\n $sql->sql_delete('forgot', ['user_id' => $user_id]);\n $sql->sql_delete('profile', ['user_id' => $user_id]);\n $sql->sql_delete('subscription', ['user_id' => $user_id]);\n $sql->sql_delete('playlist', ['user_id' => $user_id]);\n $sql->sql_delete('live', ['user_id' => $user_id]);\n $sql->sql_delete('movie', ['user_id' => $user_id]);\n $sql->sql_delete('episodes', ['user_id' => $user_id]);\n $sql->sql_delete('series_tmdb', ['user_id' => $user_id]);\n $sql->sql_delete('user', ['id' => $user_id]);\n $this->send_email(\n EMAIL['email'], \n $email, \n 'We are sad to see you go.', \n $this->account_canceled_body()\n );\n return true;\n }\n }\n return false;\n }", "function disableReceiver($uid, $bounce_type) {\n\t\treturn false;\n\t}", "static function unlock_account() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if ($hash = data('hash')) {\n\n # verificando se ha algum usuário com a hash.\n $user = $model::first(array(\n 'fields' => 'id, hash_unlock_account',\n 'where' => \"hash_unlock_account = '$hash'\"\n ));\n\n if (!empty($user)) {\n $user->hash_unlock_account = '';\n $user->login_attempts = 0;\n\n $user->edit() ?\n flash('Sua conta foi desbloqueada.') :\n flash('Algo ocorreu errado. Tente novamente mais tarte.', 'error');\n }\n }\n\n go('/');\n }", "protected function makeUserInactive($userModel)\n {\n $userModel->setIsActive(static::DATA_IS_INACTIVE);\n $userModel->getResource()->save($userModel);\n }", "function enableUser()\n {\n if($this->isAdmin() == TRUE)\n {\n echo(json_encode(array('status'=>'access')));\n }\n else\n {\n $userId = $this->input->post('userId');\n $userInfo = array('isDeleted'=>0,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->user_model->deleteUser($userId, $userInfo);\n \n if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }\n else { echo(json_encode(array('status'=>FALSE))); }\n }\n }", "public function logoff();", "public function modify_user($user);", "protected function unlock($user)\n {\n $newPass = bin2hex(random_bytes(6));\n $this->users->unlock(['id' => $user->getId(), 'pass' => $this->password->hash($newPass)]);\n $this->mail->send($this->mail->unlock($user, $newPass));\n }", "public function user_enable(Request $req, $id){\n $disabled = \\App\\DisabledUser::find($id);\n $user = new \\App\\User;\n $user->id = $disabled->user_id;\n $user->name = $disabled->name;\n $user->email = $disabled->email;\n $user->city = $disabled->city;\n $user->country = $disabled->country;\n $user->phone = $disabled->phone;\n $user->last_login = $disabled->last_login;\n $user->last_action = $disabled->last_action;\n $user->last_ip = $disabled->last_ip;\n $user->password = $disabled->password;\n $user->remember_token = $disabled->remember_token;\n $user->created_at = $disabled->created_at;\n $user->updated_at = $disabled->updated_at;\n $user->save();\n\n $disabled->delete();\n return back()->with('success', 'User Enabled !');\n }", "public function unblockUser($id)\n {\n $this->db->set('status_id', '0');\n $this->db->where('id', $id);\n $this->db->update('temp_user');\n return true;\n }", "function disable($watcherId);", "public function suspendUser($username)\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new SecurityDAO($dbObj);\n return $this->DAO->suspendUser($username);\n }", "public function setDisabled($disabled = true);", "function disable_visual_editor($userID) {\n\t\n\tglobal $wpdb;\n\t\n\t$wpdb->query(\"UPDATE `\" . $wpdb->prefix . \"usermeta` SET `meta_value` = 'false' WHERE `meta_key` = 'rich_editing'\");\n\t\n}" ]
[ "0.77412075", "0.763119", "0.74990755", "0.74603605", "0.7441408", "0.7396321", "0.7329298", "0.72992074", "0.6970542", "0.68814236", "0.6880678", "0.68108124", "0.6766278", "0.674026", "0.6729603", "0.6708145", "0.66689", "0.6606771", "0.6601288", "0.6593791", "0.6545925", "0.65271676", "0.64823663", "0.6464054", "0.64038193", "0.6399981", "0.6393149", "0.63908273", "0.6385871", "0.6378058", "0.6346863", "0.63355", "0.6322104", "0.6320945", "0.62973", "0.62922585", "0.62698525", "0.6260945", "0.6257782", "0.62408876", "0.62327313", "0.62108046", "0.61904645", "0.6175556", "0.61732805", "0.61732805", "0.61714005", "0.6166467", "0.61571", "0.6128749", "0.6115517", "0.61084235", "0.6105619", "0.61046284", "0.60392416", "0.603768", "0.6023406", "0.601878", "0.60183734", "0.5981804", "0.59735864", "0.59661907", "0.59632015", "0.59620583", "0.59618855", "0.59543484", "0.59295386", "0.5910058", "0.5894696", "0.58938277", "0.5890822", "0.58649087", "0.5857283", "0.58349925", "0.58328235", "0.5816555", "0.58083844", "0.5797382", "0.57836103", "0.5776489", "0.5767467", "0.575603", "0.5750014", "0.57247734", "0.5719176", "0.5719111", "0.57064176", "0.57028365", "0.5684433", "0.5667724", "0.5667553", "0.5665343", "0.5661519", "0.5661275", "0.5646794", "0.5641908", "0.5621751", "0.5618469", "0.5614994", "0.5612813" ]
0.61302066
49
Display the user profile form
public function profile() { $user = $this->userRepo->get(Auth::user()->id); return View::make('user.profile', compact('user'))->withShowTab(Input::get('tab')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function profileForm()\n {\n return view('turtle::auth.profile');\n }", "function profileForm(){\r\n\t\t$this->view('profileForm');\r\n\t}", "public function actionProfile()\n {\n $this->layout = 'headbar';\n $model = new User();\n $model = User::find()->where(['id' => 1])->one();\n $name = $model->name;\n $email = $model->email;\n $mobile = $model->contact;\n return $this->render('profile', [\n 'model' => $model,\n 'name' => $name,\n 'email' => $email,\n 'mobile' => $mobile,\n ]);\n }", "public function indexAction()\n {\n $identity = $this->_auth->getIdentity();\n $userId = $identity->getId();\n $userModel = new Model\\Users();\n $user = $userModel->getUser($userId);\n $form = new Form\\Profile();\n $form->populate($user->toArray());\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $result = $userModel->saveProfile($user, $form->getValues());\n if ($result) {\n $this->_helper->getHelper('FlashMessenger')->addMessage('Your profile saved.');\n $this->_helper->redirector->gotoUrlAndExit($this->getRequest()->getRequestUri());\n }\n }\n $this->view->profile = $form;\n }", "function display_user_profile_fields() {\r\n global $wpdb, $user_id, $wpi_settings;\r\n $profileuser = get_user_to_edit($user_id);\r\n\r\n include($wpi_settings['admin']['ui_path'] . '/profile_page_content.php');\r\n }", "public function indexAction(){\n\t\t$this->view->display('usermanagement/profile/profile_form.tpl');\t\t\n\t}", "public function profileAction() {\r\n $user = $this->getCurUser();\r\n return $this->render('AlbatrossUserBundle:User:profile.html.twig', array(\r\n 'userInfo' => $user,\r\n )\r\n );\r\n }", "public function profileForm()\n {\n return view('student.profile');\n }", "public function actionProfile()\r\n\t{\r\n\t\t//disable jquery autoload\r\n\t\tYii::app()->clientScript->scriptMap=array(\r\n\t\t\t'jquery.js'=>false,\r\n\t\t);\r\n\t\t$model = $this->loadUser();\r\n\t $this->render('profile',array(\r\n\t \t'model'=>$model,\r\n\t\t\t'profile'=>$model->profile,\r\n\t ));\r\n\t}", "public function profile() {\n\tif(!$this->user) {\n\t\tRouter::redirect(\"/users/login\");\n\t\t\n\t\t# Return will force this method to exit here so the rest of \n\t\t# the code won't be executed and the profile view won't be displayed.\n\t\treturn false;\n\t}\n \n # Setup view\n\t$this->template->content = View::instance('v_users_profile');\n\t$this->template->title = \"Profile of \".$this->user->first_name;\n \n #var_dump($this->user);\n \t\n\t# Render template\n\techo $this->template;\n }", "public function profileAction()\n {\n // Fetch the current logged in user. It's always present, since the firewall denies anonymous logins\n $user = $this->get('security.context')->getToken()->getUser();\n\n // Create form\n $form = $this->createForm(new UserType(), $user);\n $form->remove('username');\n\n// //@TODO We must make sure that the password fields are optional!\n// foreach ($form->get('password')->getChildren() as $item) {\n// $item->setRequired(true);\n// }\n\n $request = $this->getRequest();\n if ($request->getMethod() == 'POST') {\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $factory = $this->get('security.encoder_factory');\n $encoder = $factory->getEncoder($user);\n $password = $encoder->encodePassword($user->getPassword(), $user->getSalt());\n $user->setPassword($password);\n\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($user);\n $em->flush();\n\n $this->get('session')->setFlash('notice', 'Your profile has been updated!');\n\n // Redirect - This is important to prevent users re-posting\n // the form if they refresh the page\n return $this->redirect($this->generateUrl('WygUserBundle_user_profile'));\n }\n }\n\n return $this->render('WygUserBundle:User:form.html.twig', array(\n 'form' => $form->createView(),\n 'user' => $user,\n 'mode' => 'edit',\n ));\n }", "public function profile()\n\t{\n\t\t// echo $this->fungsi->user_login()->nik;\n\t\t$query = $this->user_m->get($this->fungsi->user_login()->nik);\n\t\t$data['data'] = $query->row();\n\t\t$this->template->load('template2', 'profile', $data);\n\t}", "function profileUser() {\n if (SSession::getInstance()->__isset(\"role\")) {\n $model = new UserModel;\n $result = $model->selectUser(SSession::getInstance()->mail);\n $this->view->show(\"profileView.php\", $result);\n } else {\n $this->view->show(\"indexView.php\");\n }\n }", "public function Profile()\n\t{\n\t\t$user = $this->user;\n\t\t$profileForm = new CForm(array(\n\t\t\t'action'\t=> $this->request->CreateUrl('user/profile'),\n\t\t\t),\n\t\tarray(\n\t\t\t'acronym'\t=> new CFormElementText('Acronym', array(\n\t\t\t\t'readonly'\t=> true,\n\t\t\t\t'value'\t\t=> $this->user->GetAcronym(),\n\t\t\t\t)\n\t\t\t),\n\t\t\t'OldPw'\t\t=> new CFormElementPassword('OldPw',array(\n\t\t\t\t'label'\t\t=> 'Old Password',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Pw'\t\t=> new CFormElementPassword('Pw', array(\n\t\t\t\t'label'\t\t=> 'Password',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Pw2'\t\t=> new CFormElementPassword('Pw2', array(\n\t\t\t\t'label'\t\t=> 'Password again',\n\t\t\t\t)\n\t\t\t),\n\t\t\tnew CFormElementSubmit('doChangePassword', array(\n\t\t\t\t'value'\t\t=> 'Change password',\n\t\t\t\t'callback'\t=> array($this, 'DoChangePassword'),\n\t\t\t\t)\n\t\t\t),\n\t\t));\n\t\t\n\t\t$profileForm->SetValidation('OldPw',array('not_empty'));\n\t\t$profileForm->SetValidation('Pw',array('not_empty'));\n\t\t$profileForm->SetValidation('Pw2',array('not_empty'));\n\t\t\n\t\t$profileForm->Check();\n\t\t\n\t\t$userProfileForm = new CForm(array(\n\t\t\t'action'\t=> $this->request->CreateUrl('user/profile')), array(\n\t\t\t'Name'\t\t=> new CFormElementText('Name', array(\n\t\t\t\t'label'\t\t=> 'Name:*',\n\t\t\t\t'value'\t\t=> $user['name'],\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Email'\t\t=> new CFormElementText('Email', array(\n\t\t\t\t'label'\t\t=> 'Email:*',\n\t\t\t\t'value'\t\t=> $user['email'],\n\t\t\t\t)\n\t\t\t),\n\t\t\tnew CFormElementSubmit('doSaveProfile', array(\n\t\t\t\t'value'\t\t=> 'Save',\n\t\t\t\t'callback'\t=> array($this, 'DoSaveProfile'),\n\t\t\t\t)\n\t\t\t),\n\t\t));\n\t\t\n\t\t$userProfileForm->SetValidation('Name',array('not_empty'));\n\t\t$userProfileForm->SetValidation('Email',array('not_empty'));\n\t\t\n\t\t$userProfileForm->Check();\n\t\t\n\t\t$this->views->SetTitle('Profile');\n\t\t$this->views->AddView('user/profile.tpl.php', array(\n\t\t\t'profileForm'\t\t=> $profileForm->GetHTML().$userProfileForm->GetHTMl(),\n\t\t\t'user'\t\t\t\t=> $this->user,\n\t\t\t'is_authenticated'\t=> $this->user['isAuthenticated'],\n\t\t\t),\n\t\t'primary'\n\t\t);\n\t}", "public function profile() {\n\t\tif($this->checkLoggedIn()) {\n\t\t\treturn $this->view->render('profile_view');\n\t\t}\n\t}", "public function profile()\n {\n if ($this->Session && $this->Permissions) {\n if($this->Session['admin'] == 1 || $this->Permissions['profielen'] == 'Y') {\n $data['Title'] = 'Gebruikers profiel';\n $data['Active'] = 4;\n $data['user'] = $this->user->getProfile();\n $data['logs'] = $this->Log->getUserLogs();\n $data['permissions'] = $this->rights->getUserRights();\n\n $this->load->view('components/admin_header', $data);\n $this->load->view('components/navbar_admin', $data);\n $this->load->view('admin/profile', $data);\n $this->load->view('components/footer');\n }\n } else {\n redirect('Admin', 'refresh');\n }\n }", "public function profile() {\n\n\n $userInfo = Auth::user();\n\n $User = User::find($userInfo->id);\n\n\n // show the edit form and pass the nerd\n return View::make('admin.profile.edit')\n ->with('User', $User);\n }", "public function myprofileAction()\n {\n \tZend_Registry::set('Category', Category::ACCOUNT);\n \tZend_Registry::set('SubCategory', SubCategory::NONE);\n\n $album = $this->_user->getProfileAlbum();\n if(!$album->isReadableBy($this->_user, $this->_acl)){\n $album = null;\n \t}\n\n $blog = $this->_user->getBlog();\n if(!$blog->isReadableBy($this->_user, $this->_acl)){\n $blog = null;\n \t}\n\n $this->view->profilee = $this->_user;\n $this->view->album = $album;\n $this->view->blog = $blog;\n $this->view->medias = $album->getItemSet();\n\n $this->renderScript('user/profile.phtml');\n }", "public function index()\n {\n $user = $this->getAuthenticatedUser();\n\n $this->setTitle(\"Profile - {$user->full_name}\");\n $this->addBreadcrumbRoute($user->full_name, 'admin::auth.profile.index');\n\n return $this->view('admin.profile.index', compact('user'));\n }", "function displayEditProfilePage() {\n\t\t\n\t\tglobal $firstName, $lastName, $age, $email, $visibility, $visibilities;\n\t\t\n\t\tprintf(\"<div class='post'>\");\n\t\tprintf(\"<h1> Edit Profile </h1>\");\n\t\t\n\t\t//edit profile form\n\t\tprintf('<form action=\"submitEditProfile.php\" method=\"post\" enctype=\"multipart/form-data\">');\n\t\tprintf('<br> First Name: <input type=\"text\" name=\"firstName\" value=\"%s\"/>', $firstName);\n\t\tprintf('<br> Last Name: <input type=\"text\" name=\"lastName\" value=\"%s\"/>', $lastName);\n\t\tprintf('<br> Age: <input type=\"text\" name=\"age\" value=\"%s\"/>', $age);\n\t\tprintf('<br> Email: <input type=\"text\" name=\"email\" value=\"%s\"/>', $email);\n\t\tprintf('<br> Type: <select name=\"type\"> <option value=\"client\">Client</option> <option value=\"nutritionist\">Nutritionist</option> </select>');\n\t\tprintf('<br> Visibility: <select name=\"visibility\">');\n\t\tforeach ($visibilities as &$level) {\n\t\t\tprintf('<option value=\"%s\" ', $level);\n\t\t\tif ($level == $visibility) {\n\t\t\t\tprintf('selected');\n\t\t\t}\n\t\t\tprintf('>%s</option>', $level);\n\t\t}\n\t\tprintf('</select>');\n\t\n\t\t//photo upload and submission form\n\t\tprintf('<br> <input type=\"submit\" name=\"submit\" value=\"Submit\"> </form>');\n\t\tprintf('<form action=\"submitEditProfile.php\" method=\"post\" enctype=\"multipart/form-data\"> Photo:');\n\t\tprintf('<input type=\"file\" name=\"fileToUpload\" id=\"fileToUpload\">');\n\t\tprintf('<input type=\"submit\" name=\"submitPhoto\" value=\"submitPhoto\">');\n\t\tprintf('</form>');\n\t\tprintf('</div>');\n\t}", "public function profile_edit() {\n $this->template->content = View::instance('v_users_profile_edit');\n $this->template->title = \"Edit Profile\";\n\n // Render the view\n echo $this->template;\n\n }", "public function profileAction()\n {\n \tZend_Registry::set('Category', Category::COMMUNITY);\n Zend_Registry::set('SubCategory', SubCategory::USERS);\n\n $userId = $this->_request->getParam(2, null);\n if(empty($userId)){\n throw new Lib_Exception_NotFound(\"No user id found for profile page\");\n }\n\n if($userId == $this->_user->{User::COLUMN_USERID}){\n \tZend_Registry::set('Category', Category::ACCOUNT);\n\t\t\tZend_Registry::set('SubCategory', SubCategory::NONE);\n }\n\n $table = new User();\n $user = $table->find($userId)->current();\n if(empty($user)){\n throw new Lib_Exception_NotFound(\"User '$userId' could not be found for profile page\");\n }\n\n $blog = $user->getBlog();\n if(!$blog->isReadableBy($this->_user, $this->_acl)){\n $blog = null;\n \t}\n\n $album = $user->getProfileAlbum();\n if(!$album->isReadableBy($this->_user, $this->_acl)){\n $album = null;\n \t}\n\n $this->view->profilee = $user;\n $this->view->album = $album;\n $this->view->blog = $blog;\n $this->view->medias = $album->getItemSet();\n }", "public function index()\n {\n $data = [\n 'user' => user_info(),\n 'formProfile' => [\n 'method' => 'PUT',\n 'url' => URL::route('admin-profile-update', 'profile'),\n 'files' => true,\n ],\n 'formPassword' => [\n 'method' => 'PUT',\n 'url' => URL::route('admin-profile-update', 'password'),\n ],\n 'skins' => config('ahloo.skins'),\n ];\n\n return view('backend.profile', $data);\n }", "public function profileAction() {\n $user = User::getCurrent();\n if (!$user instanceOf BaseUser) {\n throw new \\Exception (\"No current user in Profile action\");\n }\n $data = array();\n $user = $this->processPost($user);\n $formElements = array(\n 'uname'=>array('label'=>'User Name', 'name_segment'=>'uname',\n 'placeholder'=>'User Name',),\n 'email'=>array('label'=>'Email?', 'name_segment'=>'email',\n 'placeholder'=>'Email',),\n 'fname'=>array('label'=>'First Name', 'name_segment'=>'fname',\n 'placeholder'=>'Your First Name',),\n 'lname'=>array('label'=>'Last Name', 'name_segment'=>'lname',\n 'placeholder'=>'Your Last Name', ),\n 'profiles'=>array('input'=>'formset','subform'=>'profiles',\n 'name_segment'=>'profiles', 'class'=> 'doggy','create_label'=>'Create New',\n 'elements'=> array(\n 'profile_description'=>array('name_segment'=>'profile_description', \n 'data-stuff'=>'fromUserController', 'label' => 'Prof Desc',\n 'placeholder'=>\"Describe your profile\", ),\n 'profile_name'=>array('type'=>'text', 'name_segment'=>'profile_name',\n 'data-stuff'=>'fromUserController', 'label'=>'Prof Name',\n 'placeholder'=>\"Profile Name of Blue Blazer\", )\n ),\n ),\n );\n $formArgs = array('base_object'=>$user, 'elements'=>$formElements,\n 'name_segment'=>'user');\n $form = new BaseForm($formArgs);\n $form->bind($user);\n $data['form'] = $form;\n return $data;\n }", "public function myProfile()\n\t{\n\t\t//echo \"<pre>\";print_r($this->session->userdata());die;\n\t\tif($this->session->userdata('VB_USER_ID') == ''):\n\t\t\tredirect(base_url());\n\t\tendif;\n\t\t$this->layouts->set_title(stripcslashes('Profile | VBloggers'));\n\t\t$this->layouts->set_keyword(stripcslashes('Profile | VBloggers'));\n\t\t$this->layouts->set_description(stripcslashes('Profile | VBloggers'));\n\t\t\n\t\t$this->layouts->login_view('user/profile',array(),$data);\n\t}", "public function profile()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('profile');\n\n return $this->loadPublicView('user.profile', $breadCrumb['data']);\n }", "public function show()\n {\n $user_identifier = $this->session->userdata('identifier');\n $user_details = $this->user_m->read($user_identifier);\n $this->data['user_details'] = $user_details;\n $this->load_view('Profil Akun', 'user/profil');\n }", "public function profile() {\n $this->restrictToRoleId(2);\n \n // Exécute la view\n $this->show('user/profile');\n }", "public function setProfileInformation()\n {\n $view = \\Utility\\Singleton::getInstance(\"\\View\\Main\");\n\t\t$username=$view->get('userProfile');\n\t\t$this->getUserInformations($view,$username);\n\t\t$this->setResourcesUploaded($view,$username);\n\t\treturn $view->fetch('profile.tpl');\n\t}", "public function View_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId(),'view');\n\t}", "public function profile()\n\t{\n\t\treturn view('admin.profile');\n\t}", "public function profile($params = null)\n\t{\n\t\t$this->loadModel(\"user\");\n\t\t// On set la variable a afficher sur dans la vue\n\t\t$this->set('title', 'Profil');\n\t\t// On fait de rendu de la vue login.php\n\t\t$this->render('profile');\n\t}", "public function editprofile()\n {\n //make sure user is logged in\n Auth::checkAuthentication();\n $data = array('ajaxform'=>'load');\n \n //loads user data from session, gives save button(post)\n $this->View->render('user/editProfile',$data);\n }", "public function actionProfile()\n {\n $id = Yii::$app->user->identity->id;\n $model = \\app\\models\\User::findOne(['id' => $id]);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('kv-detail-success', 'Perubahan disimpan');\n return $this->redirect(Yii::$app->request->referrer); \n }\n\n return $this->render('profile', ['model' => $model]);\n }", "public function profile() {\n //Tomamos el campo del ususario\n $user = Auth::user();\n //Retornamos la vista con el profile\n return view('admin.users.profile', ['user' => $user]);\n }", "public function profile()\n {\n $user = User::find(Auth::id());\n return view('layouts.showuser_details')->with(['user' => $user]);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function profile()\n {\n $user = $this->user;\n return view('user.profile', compact('user'));\n }", "public function profile()\n {\n $view_data = [\n 'form_errors' => []\n ];\n // Check input data\n if ($this->input->is_post()) {\n $gender = '';\n\n if (!empty($this->input->post('sex'))) {\n $gender = $this->input->post('sex');\n }\n\n if(mb_strlen($this->input->post('nickname')) <= 10) {\n // Call API to register for parent\n $res = $this->_api('user')->update_profile([\n 'id' => $this->current_user->id,\n 'nickname' => $this->input->post('nickname'),\n 'sex' => $gender,\n ]);\n } else {\n $view_data['form_errors'] = ['nickname' => 'ニックネーム欄は10文字以内で入力してください'];\n }\n\n if (isset($res['result'])) {\n $this->session->set_flashdata('get_trophy', $res['result']['trophy']);\n $this->session->set_flashdata('get_point', $res['result']['point']);\n redirect('setting');\n return;\n } elseif (isset($res)) {\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n }\n $view_data['post'] = $this->input->post();\n\n }\n\n $user_res = $this->get_current_user_detail();\n\n $view_data['user'] = $user_res['result'];\n\n $this->_render($view_data);\n }", "public function admin_profile() {\n\n // nothing done here, everything happens in the view\n\n $user = $this->User->findById($this->Auth->user('id'));\n $this->set(compact('user'));\n }", "public function editprofile() {\n // If user is not logged in redirect them to login\n if(!$this->user){\n \n die('Members Only <a href=\"/users/login\">Login</a>');\n\n }\n # Create a new View instance\n $this->template->content3=View::instance('v_users_editprofile'); \n # Page title \n $this->template->title= APP_NAME. \":: Edit Profile\";\n // add required js and css files to be used in the form\n $client_files_head=Array('/js/languages/jquery.validationEngine-en.js',\n '/js/jquery.validationEngine.js',\n '/css/validationEngine.jquery.css'\n );\n $this->template->client_files_head=Utils::load_client_files($client_files_head);\n\n\n # Pass information to the view instance\n # Render View \n echo $this->template;\n\n }", "function profile()\n\t{\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Set the client information to display in the view\n\t\t$this->set(compact('user'));\n\t}", "public function profile($user_name = NULL) {\n\n\n if(!$this->user){\n //Router::redirect('/');\n die('Members Only <a href=\"/users/login\">Login</a>');\n\n }\n\n $this->template->content=View::instance('v_users_profile'); \n // $content=View::instance('v_users_profile'); \n $this->template->title= APP_NAME. \" :: Profile :: \".$user_name;\n \n $q= 'Select * \n From users \n WHERE email=\"'.$user_name.'\"';\n $user= DB::instance(DB_NAME)->select_row($q);\n\n $this->template->content->user=$user;\n \n # Render View \n echo $this->template;\n\n \n }", "private function _displayEditProfile($tpl = null){\n JHtml::_('jresearchhtml.validation');\n $mainframe = JFactory::getApplication();\n $user = JFactory::getUser();\n \n \t//Get the model\n \t$model = $this->getModel();\n \t\n \t$form = $this->get('Form');\n // get the Data\n $data = $this->get('Data');\n\n if(empty($data)){\n JError::raiseWarning(1, JText::_('JRESEARCH_NOT_EXISTING_PROFILE'));\n return;\n }\n \n // Bind the Data\n $form->bind($data);\n\n $this->assignRef('form', $form);\n $this->assignRef('data', $data);\n\n $mainframe->triggerEvent('onBeforeRenderJResearchEntityForm', array($data, 'member'));\n \n parent::display($tpl);\n \n $mainframe->triggerEvent('onAfterRenderJResearchEntityForm', array($data, 'member'));\n }", "public function user_profile() {\n $data['title'] = 'User Profile';\n return view('user-dashboard.user-profile', $data);\n }", "public function profileAction()\n {\n if (!$this->auth->isAuthorizedVisitor()) {\n $this->response->setStatusCode(404);\n $this->flashSession->error(t(\"Sorry! We can't seem to find the page you're looking for.\"));\n\n $this->dispatcher->forward([\n 'controller' => 'posts',\n 'action' => 'index',\n ]);\n\n return;\n }\n\n $user = $this->userService->findFirstById($this->auth->getUserId());\n\n if (!$user || !$this->userService->isActiveMember($user)) {\n $this->response->setStatusCode(404);\n $this->flashSession->error(t('Attempt to access non-existent user.'));\n\n $this->dispatcher->forward([\n 'controller' => 'posts',\n 'action' => 'index',\n ]);\n\n return;\n }\n\n $form = new UserForm($user);\n\n if ($this->request->isPost()) {\n // Validate the form and assign the values from the user input\n $form->bind($this->request->getPost(), $user);\n\n if (!$form->isValid()) {\n $messages = [];\n $this->response->setStatusCode(400);\n foreach ($form->getMessages() as $message) {\n $messages[] = (string) $message->getMessage();\n }\n $this->flashSession->error(implode('<br>', $messages));\n } else {\n // @todo Process missed fields\n $user->setFirstname($this->request->getPost('firstname', 'striptags'));\n $user->setLastname($this->request->getPost('lastname', 'striptags'));\n $user->setEmail($this->request->getPost('email', 'email'));\n // $user->setUsername($this->request->getPost('username', 'striptags'));\n $user->setBirthdate($this->request->getPost('birthDate'));\n $user->setBio($this->request->getPost('bio', 'trim'));\n $user->setTwitter($this->request->getPost('twitter'));\n $user->setGithub($this->request->getPost('github'));\n\n if (!$user->save()) {\n $messages = [];\n $this->response->setStatusCode(400);\n foreach ($user->getMessages() as $message) {\n $messages[] = (string) $message->getMessage();\n }\n $this->flashSession->error(implode('<br>', $messages));\n return;\n }\n\n $this->response->setStatusCode(200);\n $this->flashSession->success(t('Profile successfully updated.'));\n $this->refreshAuthSession($user->toArray());\n }\n }\n\n $this->tag->setTitle(t('Edit Profile'));\n\n $this->view->setVars([\n 'form' => $form,\n 'object' => $user,\n 'email' => $user->getEmail(),\n ]);\n\n $script = '\n\n Dropzone.options.myAwesomeDropzone = {\n paramName: \"file\", // The name that will be used to transfer the file\n maxFilesize: 2, // MB\n maxfilesreached : 1,\n maxFiles: 1,\n maxThumbnailFilesize: 1,\n uploadMultiple: false,\n accept: function(file, done) {\n if (file.name == \"justinbieber.jpg\") {\n done(\"Naha, you dont.\");\n }\n else { done(); }\n }\n };\n\n\n ';\n\n $this->assets->addInlineJs($script);\n $this->assets->addInlineCss('#avatarUpload { border:1px; min-height:150px; padding:0px; } #avatarUpload .dz-message {margin:0px; padding:0 1rem} #avatarUpload .dz-preview {margin:0px; padding:0 1rem} ');\n\n\n }", "public function actionIndex() {\r\n $userID = $this->checkLogged();\r\n $user = new User;\r\n $user = $user->getUserById($userID);\r\n $username = $user->firstname;\r\n\r\n $mainCategories = $this->mainCategories;\r\n $brands = $this->brands;\r\n\r\n include_once ROOT . '/views/profile/profile.php';\r\n }", "public function profileAction() {\n\t\t$this->view->assign('account', $this->accountManagementService->getProfile());\n\t}", "public function profile()\n {\n $user_id = auth()->user()->id;\n $user = User::find($user_id);\n if (auth()->user()->id !== $user->id){\n return back ('user.edit')->with('error', 'Unauthorized Access');\n }\n return view ('user.edit')->with('user', $user);\n }", "public function index()\n {\n $user = Auth::user();\n return view('profile-user', ['user' => $user]);\n }", "public function userAction()\n {\n \n $request = $this->getRequest();\n\n $inline\t= $request->getParam('inline');\n \n if($inline){\n\t $pix\t= Point_Model_Picture::getInstance();\n\t //$pix->makeThumbnail('');\n\t /*\n\t * Check if user is logged-in and act accordingly\n\t */\n\t $viewRenderer\t= Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true);\n\t \t$viewRenderer->setResponseSegment('userPane');\n\t \t\n\t \t$auth\t= Zend_Auth::getInstance();\n\t \t$this->view->username = Point_Model_User::getInstance()->fullname();\n\t\n\t \tif ($auth->hasIdentity()){ // We are to render the login profile menu\n\t \t\n\t \t$this->_helper->viewRenderer->render('userminipane');\n\t \n\t } else { // render 'Sign in' page\n\t\t \n\t\t /* create the dialog for user */\n\t\t \t$this->_prepareLoginDialog();\n\t\t \t$this->_helper->viewRenderer->render('-login');\n\t }\n\t \n } else { // accidentally called!!!\n \t$this->_helper->viewRenderer->setNoRender();\n \t$this->_redirect('/');\n }\n \n $this->_helper->viewRenderer->setNoRender(true);\n// $this->_helper->layout->disableLayout();\n\n }", "public function profile()\n {\n return view('users.edit');\n }", "public function show()\n {\n $user = User::findOrFail($this->auth->user()->id);\n return view('admin.admin-users.profile', compact('user'));\n }", "public function profile()\n\t{\n\t\t$data['user'] = $this->session->userdata('user');\n\t\t$data['admin'] = $this->Admin->getClientById($data['user'][\"user_id\"]);\n\t\t$data['title'] = \"Admin Profile\";\n\n\t\t$this->load->view('layouts/header.php', $data);\n\t\t$this->load->view('admin/index.php');\n\t\t$this->load->view('layouts/footer.php');\n\t}", "public function profile()\n {\n\t$oUser = Auth::user();\n return view('profile', ['oUser' => $oUser, 'active' => 'profile_link']);\n }", "public function profile()\n {\n $user= Auth::user();\n return view('admin.users.edit-profile-details',compact('user'));\n }", "public function actionProfile()\n {\n $searchModel = new ProfileSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('profile', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function profile() {\r\n\r\n\t\t$this->input->set('view', 'childprofile');\r\n\r\n\t\treturn parent::display();\r\n\t}", "public function Index()\n\t{\n\t\t$this->views->SetTitle('User Profile');\n\t\t$this->views->AddView('user/index.tpl.php', array(\n\t\t\t'is_authenticated'\t=> $this->user['isAuthenticated'],\n\t\t\t'user'\t\t\t\t=> $this->user,\n\t\t\t'allow_create_user'\t=> $this->config['create_new_users'],\n\t\t\t),\n\t\t'primary'\n\t\t);\n\t}", "public function showUpdateProfile()\n {\n return view('moderator.profile');\n }", "public function profile()\r\n {\r\n // get the current user info\r\n $user = Auth::user();\r\n $data['item'] = [\r\n 'email' => $user->email,\r\n 'first_name' => $user->first_name,\r\n 'middle_name' => $user->middle_name,\r\n 'last_name' => $user->last_name,\r\n 'phone_1' => $user->phone_1,\r\n 'phone_2' => $user->phone_2,\r\n ];\r\n\r\n return View::make('user/profile')->with('data', $data);\r\n }", "public function showProfile()\n {\n\t\t$user = User::all();\n\n return View::make('users', array('users' => $user));\n }", "public function myprofile() {\n \n \treturn view('backend.user.myprofile');\n\n }", "public function profile()\n {\n return view('account.account.profile');\n }", "function index() \n { \n $data['profile_info'] = $this->tank_auth->get_user_by_id($this->tank_auth->get_user_id(),TRUE);\n $data['profile_detail'] = $this->tank_auth->get_user_profile_detail($this->tank_auth->get_user_id()); \t \n $this->_template($data,$templatename='profile'); \n }", "public function index()\n {\n return view('admin.users.profile')->with('user', Auth::user());\n }", "public function profile() {\n $data = ['title' => 'Profile'];\n return view('pages.admin.profile', $data)->with([\n 'users' => $this->users\n ]);\n }", "public function showProfile()\n {\n return view('users.profile');\n }", "public function index()\n {\n //Gladys: Get all the user info.\n \t$user = $this->userRepo->getAllUserInfo(Auth::user()->getId());\n \n return view('pages.profile.profile')->with('userData', $user);\n }", "public function profileEdit()\n {\n\t$oUser = Auth::user();\n return view('profile_edit', ['oUser' => $oUser, 'active' => 'profile_link']);\n }", "public function profile()\n {\n return view('profile');\n }", "private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }", "public function displayRegisterForm()\n {\n // charger le HTML de notre template\n require OPROFILE_TEMPLATES_DIR . 'register-form.php';\n }", "function get_profile_form($user) {\n \n $language = $this->get_user_language($user);\n $options = NewsletterSubscription::instance()->get_options('profile', $language);\n\n $buffer = '';\n\n $buffer .= '<div class=\"tnp tnp-profile\">';\n $buffer .= '<form action=\"' . $this->build_action_url('ps') . '\" method=\"post\" onsubmit=\"return newsletter_check(this)\">';\n $buffer .= '<input type=\"hidden\" name=\"nk\" value=\"' . esc_attr($user->id . '-' . $user->token) . '\">';\n\n $buffer .= '<div class=\"tnp-field tnp-field-email\">';\n $buffer .= '<label>' . esc_html($options['email']) . '</label>';\n $buffer .= '<input class=\"tnp-email\" type=\"text\" name=\"ne\" required value=\"' . esc_attr($user->email) . '\">';\n $buffer .= \"</div>\\n\";\n\n\n if ($options['name_status'] >= 1) {\n $buffer .= '<div class=\"tnp-field tnp-field-firstname\">';\n $buffer .= '<label>' . esc_html($options['name']) . '</label>';\n $buffer .= '<input class=\"tnp-firstname\" type=\"text\" name=\"nn\" value=\"' . esc_attr($user->name) . '\"' . ($options['name_rules'] == 1 ? ' required' : '') . '>';\n $buffer .= \"</div>\\n\";\n }\n\n if ($options['surname_status'] >= 1) {\n $buffer .= '<div class=\"tnp-field tnp-field-lastname\">';\n $buffer .= '<label>' . esc_html($options['surname']) . '</label>';\n $buffer .= '<input class=\"tnp-lastname\" type=\"text\" name=\"ns\" value=\"' . esc_attr($user->surname) . '\"' . ($options['surname_rules'] == 1 ? ' required' : '') . '>';\n $buffer .= \"</div>\\n\";\n }\n\n if ($options['sex_status'] >= 1) {\n $buffer .= '<div class=\"tnp-field tnp-field-gender\">';\n $buffer .= '<label>' . esc_html($options['sex']) . '</label>';\n $buffer .= '<select name=\"nx\" class=\"tnp-gender\">';\n $buffer .= '<option value=\"f\"' . ($user->sex == 'f' ? ' selected' : '') . '>' . esc_html($options['sex_female']) . '</option>';\n $buffer .= '<option value=\"m\"' . ($user->sex == 'm' ? ' selected' : '') . '>' . esc_html($options['sex_male']) . '</option>';\n $buffer .= '<option value=\"n\"' . ($user->sex == 'n' ? ' selected' : '') . '>' . esc_html($options['sex_none']) . '</option>';\n $buffer .= '</select>';\n $buffer .= \"</div>\\n\";\n }\n\n // Profile\n for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {\n if ($options['profile_' . $i . '_status'] == 0) {\n continue;\n }\n\n $buffer .= '<div class=\"tnp-field tnp-field-profile\">';\n $buffer .= '<label>' . esc_html($options['profile_' . $i]) . '</label>';\n\n $field = 'profile_' . $i;\n\n if ($options['profile_' . $i . '_type'] == 'text') {\n $buffer .= '<input class=\"tnp-profile tnp-profile-' . $i . '\" type=\"text\" name=\"np' . $i . '\" value=\"' . esc_attr($user->$field) . '\"' .\n ($options['profile_' . $i . '_rules'] == 1 ? ' required' : '') . '>';\n }\n\n if ($options['profile_' . $i . '_type'] == 'select') {\n $buffer .= '<select class=\"tnp-profile tnp-profile-' . $i . '\" name=\"np' . $i . '\"' .\n ($options['profile_' . $i . '_rules'] == 1 ? ' required' : '') . '>';\n $opts = explode(',', $options['profile_' . $i . '_options']);\n for ($j = 0; $j < count($opts); $j++) {\n $opts[$j] = trim($opts[$j]);\n $buffer .= '<option';\n if ($opts[$j] == $user->$field)\n $buffer .= ' selected';\n $buffer .= '>' . esc_html($opts[$j]) . '</option>';\n }\n $buffer .= '</select>';\n }\n\n $buffer .= \"</div>\\n\";\n }\n\n // Lists\n $lists = $this->get_lists_for_profile($language);\n $tmp = '';\n foreach ($lists as $list) {\n\n $tmp .= '<div class=\"tnp-field tnp-field-list\">';\n $tmp .= '<label><input class=\"tnp-list tnp-list-' . $list->id . '\" type=\"checkbox\" name=\"nl[]\" value=\"' . $list->id . '\"';\n $field = 'list_' . $list->id;\n if ($user->$field == 1) {\n $tmp .= ' checked';\n }\n $tmp .= '><span class=\"tnp-list-label\">' . esc_html($list->name) . '</span></label>';\n $tmp .= \"</div>\\n\";\n }\n\n if (!empty($tmp)) {\n $buffer .= '<div class=\"tnp-lists\">' . \"\\n\" . $tmp . \"\\n\" . '</div>';\n }\n\n $extra = apply_filters('newsletter_profile_extra', array(), $user);\n foreach ($extra as $x) {\n $buffer .= '<div class=\"tnp-field\">';\n $buffer .= '<label>' . $x['label'] . \"</label>\";\n $buffer .= $x['field'];\n $buffer .= \"</div>\\n\";\n }\n \n $local_options = $this->get_options('', $this->get_user_language($user));\n\n // Privacy\n $privacy_url = NewsletterSubscription::instance()->get_privacy_url();\n if (!empty($local_options['privacy_label']) && !empty($privacy_url)) {\n $buffer .= '<div class=\"tnp-field tnp-field-privacy\">';\n if ($privacy_url) {\n $buffer .= '<a href=\"' . $privacy_url . '\" target=\"_blank\">';\n }\n\n $buffer .= $local_options['privacy_label'];\n\n if ($privacy_url) {\n $buffer .= '</a>';\n }\n $buffer .= \"</div>\\n\";\n }\n\n $buffer .= '<div class=\"tnp-field tnp-field-button\">';\n $buffer .= '<input class=\"tnp-submit\" type=\"submit\" value=\"' . esc_attr($local_options['save_label']) . '\">';\n $buffer .= \"</div>\\n\";\n\n $buffer .= \"</form>\\n</div>\\n\";\n\n return $buffer;\n }", "public function index()\n {\n return view('user.profile')\n ->withUser(Auth::user());\n }", "function show() {\n // Process request with using of models\n $user = Service::get_authorized_user();\n // Make Response Data\n if ($user !== NULL) {\n $data = [\n 'profile' => $user,\n ];\n $view = 'user/show';\n return $this->render($view, $data);\n } else {\n return Application::error403();\n }\n}", "private function display()\n\t{\n\t\t//get member params\n\t\t$rparams = new \\Hubzero\\Config\\Registry($this->member->get('params'));\n\n\t\t//get profile plugin's params\n\t\t$params = $this->params;\n\t\t$params->merge($rparams);\n\n\t\t$xreg = null;\n\n\t\t$fields = Components\\Members\\Models\\Profile\\Field::all()\n\t\t\t->including(['options', function ($option){\n\t\t\t\t$option\n\t\t\t\t\t->select('*')\n\t\t\t\t\t->ordered();\n\t\t\t}])\n\t\t\t->where('action_edit', '!=', Components\\Members\\Models\\Profile\\Field::STATE_HIDDEN)\n\t\t\t->ordered()\n\t\t\t->rows();\n\n\t\tif (App::get('session')->get('registration.incomplete'))\n\t\t{\n\t\t\t$xreg = new \\Components\\Members\\Models\\Registration();\n\t\t\t$xreg->loadProfile($this->member);\n\n\t\t\t$check = $xreg->check('update');\n\n\t\t\t// Validate profile data\n\t\t\t// @TODO Move this to central validation model (e.g., registraiton)?\n\n\t\t\t// Compile profile data\n\t\t\t$profile = array();\n\t\t\tforeach ($fields as $field)\n\t\t\t{\n\t\t\t\t$profile[$field->get('name')] = $this->member->get($field->get('name'));\n\t\t\t}\n\n\t\t\t// Validate profile fields\n\t\t\t$form = new Hubzero\\Form\\Form('profile', array('control' => 'profile'));\n\t\t\t$form->load(Components\\Members\\Models\\Profile\\Field::toXml($fields, 'edit', $profile));\n\t\t\t$form->bind(new Hubzero\\Config\\Registry($profile));\n\n\t\t\tif (!$form->validate($profile))\n\t\t\t{\n\t\t\t\t$check = false;\n\n\t\t\t\tforeach ($form->getErrors() as $key => $error)\n\t\t\t\t{\n\t\t\t\t\tif ($error instanceof Hubzero\\Form\\Exception\\MissingData)\n\t\t\t\t\t{\n\t\t\t\t\t\t$xreg->_missing[$key] = (string)$error;\n\t\t\t\t\t}\n\n\t\t\t\t\t$xreg->_invalid[$key] = (string)$error;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If no errors, redirect to where they were going\n\t\t\tif ($check)\n\t\t\t{\n\t\t\t\tApp::get('session')->set('registration.incomplete', 0);\n\t\t\t\tApp::redirect($_SERVER['REQUEST_URI']);\n\t\t\t}\n\t\t}\n\n\t\t$view = $this->view('default', 'index')\n\t\t\t->set('params', $params)\n\t\t\t->set('option', 'com_members')\n\t\t\t->set('profile', $this->member)\n\t\t\t->set('fields', $fields)\n\t\t\t->set('completeness', $this->getProfileCompleteness($fields, $this->member))\n\t\t\t->set('registration_update', $xreg);\n\n\t\treturn $view\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->loadTemplate();\n\t}", "public function index()\n {\n //\n $users = User::findOrFail( \\Auth::user()->id );\n return $this->view('user-bundle.profile.edit',compact('users'));\n }", "public function showProfile()\n\t{\n\n\t\t$user = User::with('consultant','consultantNationality')->find(Auth::user()->get()->id);\n\t\t$nationalities = $user->nationalities();\n\t\t$specialization = $user->specialization();\n\t\t$workedcountries = $user->workedcountries();\n\t\t$skills = $user->skills();\n\t\t$languages = $user->languages();\t\n\t\t$agencies = $user->agencies();\n\n\t\treturn View::make('user.profile.show', compact('user', 'nationalities','specialization','workedcountries','skills','languages','agencies'));\n\t}", "public function profile()\n {\n\n return view('profile');\n }", "public function profile() {\n $user = Auth::user();\n return view('site.profile', compact('user'));\n }", "function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}", "public function index()\n {\n return view('profile')->with( 'user', auth()->user() );\n }", "public function index()\n {\n return view('profile.user_profile');\n\n }", "public function myProfile()\n {\n //make sure user is logged in\n Auth::checkAuthentication();\n \n //loads profile from session\n $this->View->render('user/myProfile'); \n }", "function showInputForm()\n {\n $user = common_current_user();\n\n $profile = $user->getProfile();\n\n $this->elementStart('form', array('method' => 'post',\n 'id' => 'form_ostatus_sub',\n 'class' => 'form_settings',\n 'action' => $this->selfLink()));\n\n $this->hidden('token', common_session_token());\n\n $this->elementStart('fieldset', array('id' => 'settings_feeds'));\n\n $this->elementStart('ul', 'form_data');\n $this->elementStart('li');\n $this->input('profile',\n // TRANS: Field label for a field that takes an OStatus user address.\n _m('Subscribe to'),\n $this->profile_uri,\n // TRANS: Tooltip for field label \"Subscribe to\".\n _m('OStatus user\\'s address, like [email protected] or http://example.net/nickname.'));\n $this->elementEnd('li');\n $this->elementEnd('ul');\n // TRANS: Button text.\n $this->submit('validate', _m('BUTTON','Continue'));\n\n $this->elementEnd('fieldset');\n\n $this->elementEnd('form');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $user = $this->get('security.token_storage')->getToken()->getUser();\n $profile = $em->getRepository('AppBundle:UserProfile')->findOneBy(array('userId' => $user));\n\n if ($profile == null) {\n $profile = new UserProfile();\n $profile->setUserId($user);\n }\n\n return $this->render('custom_views/profile.html.twig', array(\n 'profile' => $profile,\n ));\n }", "public function profile()\n {\n return view('secretary.profile');\n }", "public function editprofile()\n\t\t{\n\t\t\tif(Auth::check()) {\n\t\t\t\t$userinfo = Auth::user();\n\t\t\t\treturn View::make('editprofile')->with('userinfo', $userinfo);\n\t\t\t} else {\n\t\t\t\tApp::abort(403);\n\t\t\t}\n\t\t}", "public function profile(){\n $user = User::findOrFail(Auth::user()->id);\n return view('user::profile')->withUser($user);\n }", "public function index()\n\t{\n\t\treturn view('profile', ['user' => Auth::user()]);\n\t}", "public function index()\n {\n $user = User::find(Auth::id());\n return view('profile.edit', compact('user'));\n }", "public function show()\r\n\t{\r\n\t\t\r\n\t\t$model = $this->getProfileView();\r\n\t\t$data = array('model'=> $model);\r\n\t\t\r\n\t\treturn $this->render($data);\r\n\t\t\r\n\t}", "public function updateProfile()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('profileEdit');\n\n return $this->loadPublicView('user.profile-edit', $breadCrumb['data']);\n }", "public function index()\n {\n return view('user.profile');\n }", "function action_profile_show() {\n // Process request with using of models\n $user = get_authorized_user();\n // Make Response Data\n if ($user !== NULL) {\n $data = [\n 'profile' => $user,\n ];\n return ['view' => 'user/show', 'data' => $data];\n } else {\n return error403();\n }\n}", "public function my_profile()\n { \n $user_id = \\Auth::user()->id;\n $user = User::find($user_id);\n return view ('backend.pages.my_profile', compact('user'));\n }", "public function profileAction(){\n /** @var Object_User $user */\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['phone'])){\n $user->setPhone($data['phone']);\n }\n if(isset($data['email'])){\n $user->setPhone($data['email']);\n }\n if(isset($data['workphone'])){\n $user->setWorkPhone($data['workphone']);\n }\n if(isset($data['workemail'])){\n $user->setWorkEmail($data['workemail']);\n }\n if(!$user->save()){\n $this->setErrorResponse('Cannot update user profile');\n }\n $this->_helper->json($user);\n }", "public function index()\n {\n $user = User::find(Auth::id());\n return \\view('superadmin.profile.manage',\\compact('user'));\n }", "public function profile(){\n \n \n $this->load->model('profile_model');\n $data = $this->profile_model->admin_info();\n $this->load->view('admin/profile_content',$data);\n }" ]
[ "0.81687033", "0.8096649", "0.77347445", "0.7682196", "0.767731", "0.7637477", "0.76358247", "0.7584577", "0.7516564", "0.7491051", "0.73628354", "0.7346976", "0.73407376", "0.73317546", "0.7319914", "0.7318605", "0.7297897", "0.72949886", "0.72871304", "0.7275194", "0.7255054", "0.72316617", "0.72210073", "0.7212093", "0.718604", "0.7183034", "0.71727335", "0.7145662", "0.71341044", "0.7132024", "0.7125385", "0.7095306", "0.7092888", "0.7090104", "0.7089882", "0.70777714", "0.7071556", "0.70632005", "0.70614207", "0.70610446", "0.7052041", "0.7050155", "0.70495516", "0.70400995", "0.70226467", "0.70147395", "0.7010262", "0.7002", "0.69968086", "0.6989349", "0.69884956", "0.69800717", "0.69742185", "0.6929104", "0.69245803", "0.6924233", "0.6914553", "0.69110084", "0.6901383", "0.6893209", "0.6883514", "0.68787", "0.68783236", "0.6875143", "0.6874723", "0.6874613", "0.68685603", "0.68677706", "0.6864685", "0.68605703", "0.68588126", "0.6850949", "0.68504936", "0.6832164", "0.68286794", "0.68270445", "0.6824574", "0.6820639", "0.68203247", "0.68006164", "0.67921865", "0.67890567", "0.678699", "0.67837924", "0.67814964", "0.6777945", "0.67687374", "0.676561", "0.6752914", "0.67520666", "0.67484516", "0.6745885", "0.67441964", "0.674398", "0.6742602", "0.6734905", "0.673054", "0.6728699", "0.67231745", "0.67223984" ]
0.74632657
10
Perform a selfchange password request
public function selfChangePassword() { if (!$this->userService->changePassword(Input::all())) { return Redirect::route('user-profile', array('tab' => 'account'))->withErrors($this->userService->errors())->withInput(); } Alert::success('Your password has been successfully changed.')->flash(); return Redirect::route('user-profile', array('tab' => 'account')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function changePassword() {}", "private function changePassword()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['old_pass']) || $request['old_pass']==\"\")\n throw_error_msg(\"provide old_pass\");\n\n //new_pass\n if(!isset($request['new_pass']) || $request['new_pass']==\"\")\n throw_error_msg(\"provide new_pass\");\n\n //c_new_pass\n if(!isset($request['c_new_pass']) || $request['c_new_pass']==\"\")\n throw_error_msg(\"provide c_new_pass\");\n\n if($request['c_new_pass']!=$request['c_new_pass'])\n throw_error_msg(\"new password and confirm password do not match\");\n\n $request['userid'] = userid();\n $userquery->change_password($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"password has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function request_admin_password_change() {\n\t\tif (isset($this->data['User']['forgot_password_email'])) {\n\t\t\t$forgot_password_email = $this->data['User']['forgot_password_email'];\n\t\t\t\n\t\t\t\n\t\t\t// check to make sure the email is a valid email for a user\n\t\t\t$change_password_user = $this->User->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'User.email_address' => $forgot_password_email,\n\t\t\t\t\t'User.admin' => true,\n\t\t\t\t),\n\t\t\t\t'contain' => false,\n\t\t\t));\n\t\t\t\n\t\t\tif (empty($change_password_user)) {\n\t\t\t\t$this->Session->setFlash(__('Email does not belong to a valid user', true), 'admin/flashMessage/warning', array(), 'auth');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Check your email to change your password', true), 'admin/flashMessage/success', array(), 'auth');\n\t\t\t\t$this->FotomatterEmail->send_forgot_password_email($this, $change_password_user);\n\t\t\t}\n\t\t}\n\t\t$this->redirect('/admin');\n\t}", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function change(string $password): void;", "function update_password()\n {\n }", "public function changePwd(){\n $uesr_id=$_SESSION['admin_id'];\n\t\t$sql=\"select * from users where id='$uesr_id'\";\n\t\t$query = mysqli_query($this->connrps, $sql);\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$username = $row['username'];\n\t\t\t$password = $row['password'];\n\t\t}\n\t\t$cur_password=base64_encode($_POST['currentPassword']);\n\t\t$new_pwd=base64_encode($_POST['newPassword']);\n\t\t$confirm_pwd=base64_encode($_POST['confirmPassword']);\n\t\tif ($cur_password != $password) {\n\t\t\t$message= \"Current password does not matched.\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else if ($new_pwd != $confirm_pwd) {\n\t\t\t$message= \"Confirm password does not matched\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else {\n\t\t\t$query_updt = \"UPDATE users SET password = '$new_pwd' WHERE id='$uesr_id'\";\n\t\t\t$query_updt = mysqli_query($this->connrps, $query_updt);\n\t\t\t$message= \"New password has been updated successfully\";\n\t\t\t$_SESSION['succ_msg'] = $message;\n\t\t\treturn 1;\n\t\t}\n\t}", "public function change_password()\n {\n $currentPassword = $this->input->post('currentPassword');\n $newPassword = $this->input->post('newPassword');\n\n $isPasswordChanged = $this->CustomModel->changePassword(\n $_SESSION['u_id'], $currentPassword, $newPassword\n );\n\n if ($isPasswordChanged) {\n echo 'success';\n }\n }", "public function changeUserPassword($uid,$newPassword);", "public function password_update(SelfPasswordUpdateRequest $request)\n {\n if( env('APP_DEMO') == true && Auth::guard('customer')->user()->id <= config('system.demo.customers', 1) )\n return redirect()->route('account', 'account#password-tab')->with('warning', trans('messages.demo_restriction'));\n\n Auth::guard('customer')->user()->update($request->all());\n\n // event(new PasswordUpdated(Auth::user()));\n\n return redirect()->route('account', 'account#password-tab')->with('success', trans('theme.notify.info_updated'));\n }", "public function change_password() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $this->Auth->user('id');\n\t\t\tif ($this->User->changePassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password changed.', true));\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t}\n\t}", "public function change_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n // Check input data\n if ($this->input->is_post()) {\n\n // Call API to register for parent\n $res = $this->_api('user')->change_password($this->input->post());\n\n if ($res['success'] && !isset($res['invalid_fields'])) {\n $this->_flash_message('パスワードを変更しました');\n redirect('setting');\n return;\n }\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n $view_data['post'] = $this->input->post();\n }\n\n $this->_render($view_data);\n }", "protected function _change_pass_submit()\n\t{\n\t\t$user = user_get_account_info();\n\t\t$password = $this->input->post('password');\n\t\t$password = mod('user')->encode_password($password, $user->email);\n\n\n\t\t$data['password'] = $password;\n\t\tt('session')->set_userdata('change_password', $data);\n\t\t$user_security_type = setting_get('config-user_security_change_password');\n\t\tif (in_array($user_security_type, config('types', 'mod/user_security'))) {\n\t\t\tmod('user_security')->send('change_password');\n\t\t\t$location = $this->_url('confirm/change_password');\n\t\t} else {\n\n\t\t\tmodel('user')->update($user->id, compact('password'));\n\t\t\tset_message(lang('notice_update_success'));\n\t\t\t$location = $this->_url('change_pass');\n\n\t\t}\n\n\t\treturn $location;\n\t}", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "public function changepassword() {\n // Fetch the request data in JSON format and convert it into object\n $request_data = $this->request->input('json_decode');\n switch (true) {\n // When request is not made using POST method\n case!$this->request->isPost() :\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Wrong request method.';\n break;\n // Request is valid and phone no and name are present\n case!empty($request_data) && !empty($request_data->phone_no) && !empty($request_data->user_token) && !empty($request_data->old_password) && !empty($request_data->new_password) && !empty($request_data->confirm_password):\n\n // Check if phone no exists\n $data = $this->User->findUser($request_data->phone_no);\n\n // Check if record exists\n if (count($data) != 0) {\n // Check uuid entered is valid\n if ($data[0]['User']['verified'] === false) {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User not verified';\n } elseif ($request_data->user_token != $data[0]['User']['user_token']) { // User Token is not valid\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User Token is invalid';\n } elseif (md5($request_data->old_password) != $data[0]['User']['password']) { // User password is matching or not.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Password did not match';\n } elseif (trim($request_data->new_password) == trim($request_data->old_password)) { // New password is not equal to old password.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'New Password is not equal to old password.';\n } elseif (trim($request_data->new_password) != trim($request_data->confirm_password)) { // New password is not equal to confirm password.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'New Password is not equal to confirm password.';\n } else {\n\n $dataArray = array();\n $dataArray['User']['_id'] = $data[0]['User']['_id'];\n $dataArray['User']['password'] = md5(trim($request_data->new_password));\n\n if ($this->User->save($dataArray)) {\n $success = true;\n $status = SUCCESS;\n $message = 'Settings has been changed.';\n } else {\n $success = false;\n $status = ERROR;\n $message = 'There was a problem in processing your request';\n }\n }\n }\n // Return false if record not found\n else {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Phone no. not registered.';\n }\n break;\n // User Token blank in request\n case!empty($request_data) && empty($request_data->user_token):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'User Token cannot be blank.';\n break;\n // Phone no. blank in request\n case!empty($request_data) && empty($request_data->phone_no):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Phone no. cannot be blank.';\n break;\n // Old Password blank in request\n case!empty($request_data) && empty($request_data->old_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Old password cannot be blank.';\n break;\n // New Password blank in request\n case!empty($request_data) && empty($request_data->new_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'New password cannot be blank.';\n break;\n // Confirm Password blank in request\n case!empty($request_data) && empty($request_data->confirm_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Confirm password cannot be blank.';\n break;\n // Parameters not found in request\n case empty($request_data):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Request cannot be empty.';\n break;\n }\n\n $out = array(\n \"success\" => $success,\n \"message\" => $message\n );\n\n return new CakeResponse(array('status' => $status, 'body' => json_encode($out), 'type' => 'json'));\n }", "public function change_password() {\n header('Content-Type: application/json');\n $this->autoRender = false;\n $this->User->recursive = -1;\n if ($this->request->is('post')) {\n $user = $this->User->findByEmail($this->request->data['User']['email'], array('User.id', 'User.email', 'User.password'));\n if (!empty($user)) {\n $oldPassword = AuthComponent::password($this->request->data['User']['old_password']);\n if ($user['User']['password'] == $oldPassword) {\n $newPassword = $this->request->data['User']['new_password'];\n $data = array(\n 'id' => $user['User']['id'],\n 'password' => AuthComponent::password($newPassword)\n );\n $this->User->save($data);\n die(json_encode(array('success' => true, 'msg' => 'Succeed to change password')));\n \n } else \n die(json_encode(array('success' => false, 'msg' => 'Wrong old password')));\n \n } else\n die(json_encode(array('success' => false, 'msg' => 'Email address not found.')));\n }\n }", "public function change_pass()\n\t{\n\t\t$form = array();\n\n\t\t$form['validation']['params'] = array('password_old', 'password', 'password_confirm');\n\n\t\t$form['submit'] = function ($params) {\n\t\t\treturn $this->_change_pass_submit();\n\n\n\t\t};\n\n\t\t$form['form'] = function () {\n\t\t\tpage_info('title', lang('title_change_pass'));\n\n\t\t\t$this->_display();\n\t\t};\n\n\t\t$this->_form($form);\n\t}", "public function testUpdatePasswordNotGiven(): void { }", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "function changepassword() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n $this->viewData['hash'] =User::userid();\n // Render the action with template\n $this->renderWithTemplate('users/changepassword', 'AdminPageBaseTemplate');\n }", "public function changePasswordAction()\n {\n $message = array();\n $message['success'] = \"\";\n $message['verify'] = $this->customerVerify($_SESSION['userName'], $_POST['currentPass']);\n if (!$message['verify']) {\n $message['confirm'] = $this->checkConfirm($_POST['newPass'], $_POST['confirmPass']);\n if (!$message['confirm']) {\n $this->model->chagePass($_SESSION['userName'], password_hash($_POST['newPass'], PASSWORD_DEFAULT));\n $message['success'] = \"Your password has been changed\";\n }\n }\n echo json_encode($message);\n }", "function changePassword($data){\r\n if(!empty($this->user_id) || $this->matchPasswordForUsername($data['userName'],$data['code'])){\r\n if(!empty($this->user_id)){\r\n $data['userName'] = $this->user_profile['username'];\r\n }\r\n if($data['newpwd']==$data['newpwdagn']){\r\n\r\n\t\t\t// check if the password is strong\r\n\t\t\tif(!$this->isPasswordStrong($data['newpwd'])){\r\n\t\t\t\t$this->setStdError('weak_password');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n // if the password is one of last n passwords\r\n if($this->isOneOfLastNPasswords($data['newpwd'])){\r\n $this->setError('Your password is one of last '.$this->app_config['password_no_repeat'].' passwords.');\r\n return false;\r\n }\r\n\r\n global $pdo;\r\n try{\r\n $update=$pdo->prepare(\"UPDATE users SET `password`=?, `status` = 1 WHERE id= ?\");\r\n $userid = $this->getUserIdFromUsername($data['userName']);\r\n $update->execute(array($this->getPasswordHashOfUser($data['userName'],$data['newpwd']), $userid));\r\n //update the password log\r\n if(empty($this->user_id)){\r\n $this->user_id = $userid;\r\n }\r\n $this->updatePasswordLog($this->getPasswordHashOfUser($data['userName'],$data['newpwd']));\r\n\r\n $this->updatePasswordResetQueue($userid);\r\n\t\t\t\t\t$log = debug_backtrace();\r\n\t\t\t\t\t$this->createActionLog($log);\r\n return true;\r\n }\r\n catch(PDOException $e){\r\n $this->setError($e->getMessage());\r\n return false;\r\n }\r\n\r\n }else{\r\n $this->setError(\"Passwords entered do not match. Please check and type again.\");\r\n return false;\r\n }\r\n }\r\n else{\r\n $this->setError(\"Password was not reset.\");\r\n return false;\r\n }\r\n }", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function modifpassword($user,$passwd){\n \n }", "public function setPassword(){\n\t}", "public function change()\r\n {\r\n// var_dump($this->validate());die;\r\n if ($this->validate()) {\r\n $user = $this->_user; \r\n $user->setPassword($this->newPwd);\r\n $user->removePasswordResetToken();\r\n return $user->save(false);\r\n }\r\n \r\n return false;\r\n }", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "public function run_chg_pass_if()\n\t{\n\t\t$msg='';\n\t\tif(isset($_POST['old_pass']))\n\t\t{\n\t\t\tif(md5($_POST['old_pass'])==$_SESSION['waf_user']['pass'])\n\t\t\t\t{\n\t\t\t\t\tif($_POST['pass']!=$_POST['pass1'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg='Passwords not equal! Try again.';\n\t\t\t\t\t}else{\n\t\t\t\t\t$this->change_password($_SESSION['waf_user']['id'],$_POST['pass']);\n\t\t\t\t\t$msg='Password successfully changed';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t$msg='Old Password wrong! Password not changed';\t\n\t\t\t\t}\n\t\t}\n\t\t$this->error=$msg;\n\t}", "function User_Changepass(){\r\n\t\tif( ($token = Str_filter($_POST['token'])) && ($old_password = Str_filter($_POST['old_password'])) && ($new_password = Str_filter($_POST['new_password'])) ){\r\n\t\t\tif($username = AccessToken_Getter($token)){\r\n\t\t\t\tif($user = Mongodb_Reader(\"todo_users\",array(\"username\" => $username),1)){\t\t\t\t\r\n\t\t\t\t\tif(md5($old_password) == $user['password']){\r\n\t\t\t\t\t\tMongodb_Updater(\"todo_users\",array(\"username\" => $username),array(\"password\" => md5($new_password)));\r\n\t\t\t\t\t\t$res = Return_Error(false,0,\"修改成功\",array(\"username\" => $username));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$res = Return_Error(true,6,\"密码不正确\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$res = Return_Error(true,5,\"该用户不存在\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$res = Return_Error(true,7,\"token无效或登录超时\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$res = Return_Error(true,4,\"提交的数据为空\");\r\n\t\t}\r\n\t\techo $res;\r\n\t}", "public function changePassword() {\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'change_password';\n\t\t$data['pageName'] = 'Change Password';\n\t\tif($data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\tif($data['common_data']['user_data']['account_type'] == FACEBOOK_ACCOUNT_TYPE){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\n\t\t$data['tutor_details'] = $this->profile_model->getTutorDetailsById($data['common_data']['user_id']);\n\t\t//Getting all payment details\n\t\t$data['payment_details'] = $this->payment_model->getPaymentDetailsById($data['common_data']['user_id']);\n\t\t$data['tutor_badges'] = $this->user_model->getTutorBadges($data['common_data']['user_id']);\n\t\t$data['badges'] = $this->user_model->getBadges();\n\n\t\t$template['body_content'] = $this->load->view('frontend/profile/change-password', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\n\t}", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function selfUpdatePassword(Request $request)\n {\n $user = Auth::user();\n\n $request->validate([\n 'current_password' => ['required', 'string', 'min:3', 'max:15', 'alpha_num',],\n 'password' => ['required', 'string', 'min:3', 'max:15', 'alpha_num', 'confirmed'],\n ]);\n\n $currentPassword = $request->input('current_password');\n\n if( ! Hash::check( $currentPassword, $user->password)) {\n return redirect()->back()->with('passwordError', 'Invalid current password');\n }\n\n $password = $request->input('password');\n\n $user->update([\n 'password' => Hash::make($password)\n ]);\n\n if(!$user->first_time_password_reset) {\n $user->first_time_password_reset = true;\n $user->save();\n }\n\n return redirect('judge')->with('status', 'Password updated successfully');\n }", "public function change_password() {\n $this->check_auth();\n $id = $this->input->post('id');\n $email = $this->input->post('email');\n $pass = $this->input->post('password');\n $new_pass = $this->input->post('new_password');\n if (!empty($id) && !empty($email) && !empty($pass) && !empty($new_pass)) {\n if (intval($id) === intval($this->user_id)) {\n $user = $this->ion_auth_model->login($email, $pass);\n if (!$user) {\n return $this->send_error('INVALID_LOGIN');\n }\n $update['salt'] = $this->ion_auth_model->salt();\n $update['password'] = $this->ion_auth_model->hash_password($new_pass, $update['salt']);\n if (!$this->users_model->where(array('id' => $this->user_id, 'email' => $email))->update($update)) {\n return $this->send_error('UPDATE_ERROR');\n }\n $user = $this->ion_auth_model->login($email, $new_pass);\n if (!$user) {\n return $this->send_error('RELOGIN_FAIL');\n }\n $key = $this->users_model->set_privatekey(true);\n if (!$key) {\n $this->ion_auth->logout();\n return $this->send_error('ERROR');\n }\n return $this->send_response(array(\n 'privatekey' => $key,\n 'user_id' => $this->ion_auth->user()->row()->id\n ));\n }\n }\n return $this->send_error('ERROR');\n }", "function change_pwd()\r\n {\r\n include 'database/session.php';\r\n $OldPwd = htmlspecialchars($_POST['OldPwd']);\r\n $NewPwd1 = htmlspecialchars($_POST['NewPwd1']);\r\n $NewPwd2 = htmlspecialchars($_POST['NewPwd2']);\r\n \r\n if ($NewPwd1!=$NewPwd2) return false;\r\n \r\n return(changePassword($OldPwd, $NewPwd1));\r\n }", "public function setPassword($newPassword);", "function update_paypassword()\n {\n }", "public function changePassword($username, $password);", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\n\n //\n // Turn off autocommit\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "function do_change_password($puuid, &$error, $set_force_reset=false) {\n global $_min_passwd_len;\n global $_passwd_numbers;\n global $_passwd_uperlower;\n global $_passwd_chars;\n\n if($puuid === '') {\n $error = \"No PUUID given\";\n return false;\n }\n\n if($_REQUEST['p1'] === $_REQUEST['p2']) {\n $temparr = array();\n $p = $_REQUEST['p1'];\n\n // do strength test here\n if(strlen($p) < $_min_passwd_len) {\n $error = \"Password too short\";\n return false;\n }\n if($_passwd_numbers && !preg_match('/[0-9]/', $p)) {\n $error = \"Password must contain one or more numbers\";\n return false;\n }\n if($_passwd_uperlower && \n \t(!preg_match('/[A-Z]/', $p) || !preg_match('/[a-z]/', $p))) {\n $error = \"Password must contain both upper case and lower case\";\n return false;\n }\n if($_passwd_chars && \n \t(preg_match_all('/[A-Za-z0-9]/', $p, &$temparr) == strlen($p))) {\n $error = \"Password must contain non-alphanumeric characters\";\n return false;\n }\n\n // we got here, so update password\n $s = \"SELECT distinct passwordtype from password_types\";\n $res = pg_query($s);\n if (!$res) {\n $error = \"DB Error\";\n return false;\n }\n $hashes = pg_fetch_all($res);\n pg_free_result($res);\n\n hpcman_log(\"Updating \".count($hashes).\" password hashes for puuid \".$puuid);\n\n if (!pg_query(\"BEGIN\")) {\n $error = \"Could not begin transaction\";\n return false;\n }\n\n foreach($hashes as $hash) {\n $s = \"UPDATE passwords SET password=$1 \n\tWHERE puuid=$2 AND passwordtype=$3\";\n $passwd = hpcman_hash($hash['passwordtype'], $p);\n $result = pg_query_params($s, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"DB Error\";\n return false;\n }\n\n $acount = pg_affected_rows($result);\n\n if ($acount > 1) {\n $error = \"Error: Too many rows\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n } else if ($acount < 1) {\n hpcman_log(\"Adding new password hash {$hash['passwordtype']} for $puuid\");\n $sql = \"INSERT INTO passwords (password, puuid, passwordtype) VALUES ($1,$2,$3)\";\n $result = pg_query_params($sql, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"Error: Not enough rows; insert failed\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n }\n }\n }\n\n if (!pg_query(\"COMMIT\")) {\n $error = \"DB Error: Commit failed\";\n return false;\n }\n\n if($set_force_reset) {\n $sql = \"UPDATE authenticators SET mustchange='t' \n\tWHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n\t$error = \"DB Error\";\n return false;\n }\n } else {\n $sql = \"UPDATE authenticators SET mustchange='f'\n WHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n $error = \"DB Error\";\n return false;\n }\n }\n } else {\n $error = \"Passwords do not match\";\n return false;\n }\n return true;\n}", "public function c_changepass(){\n\t\t\n\t\t$this->getC();\n\t\t$this->layout = false;\n\t\tif ($this->request->is('post')) {\n\t\t\t$customers = $this->Customers->get($this->request->session()->read('id'), [\n\t\t\t\t'contain' => []\n\t\t\t]);\n\t\t\t$pass = $this->request->data['data']['Customers']['oldpassword'];\n\t\t\t$new = $this->request->data['data']['Customers']['password'];\n\t\t\tif(!empty($customers)){\n\t\t\t\n\t\t\t\tif($this->request->data['data']['Customers']['cpassword']==$this->request->data['data']['Customers']['oldpassword']){\n\t\t\t\t\t$this->request->data['password']=$new;\n\t\t\t\t\t$customer = $this->Customers->patchEntity($customers, $this->request->data);\n\t\t\t\t\t\n\t\t\t\t\tif ($this->Customers->save($customer)) {\n\t\t\t\t\t\t$this->Flash->success('Password has been successfully updated.');\n\t\t\t\t\t\treturn $this->redirect(['action' => 'c_index']);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->Flash->success('Wrong Password. Please try again.');\n\t\t\t\t\treturn $this->redirect(['action' => 'c_index']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->Flash->success('Wrong Password. Please try again.');\n\t\t\t\treturn $this->redirect(['action' => 'c_index']);\n\t\t\t}\n\t\t}\n\t}", "function changepass_firsttime()\n {\n $userId = $this->userInfo('user_id');\n \n $result = $this->update('user', array('password' => $this->value('password'), 'modified' => date('Y-m-d H:i:s')), \" user_id = \".$userId);\n \n if($result === TRUE)\n {\n //this will prevent user from being logged out automatically. (as it happens in old implementation)\n $_SESSION['password'] = $this->value('password');\n \n //update the patient_history table with \"password change\" action to 'complete'\n $data = array(\n 'patient_id' => $userId,\n 'action_type' => 'first time login',\n 'action' => 'password change', \n 'action_status' => 'complete',\n 'action_time' => date('Y-m-d H:i:s')\n );\n $this->insert('patient_history', $data);\n \n echo \"{success:true, message:'Password updated successfully'}\";\n }\n else\n {\n echo \"{success:false, message:'Password update failure'}\";\n }\n }", "public function can_change_password() {\n return false;\n }", "public function account_change_password()\n\t{\n\t\t$user_session = $this->session->all_userdata();\n\t\t$user_id = $user_session['user_id'];\n\t\t\n\t\t// print_r($user_id);\n\t\t// die;\n\n\t\t$new_password = $this->input->post('new_password');\n\t\t$retype_password = $this->input->post('retype_password');\n\n\t\tif ($new_password != $retype_password)\n\t\t{\n\t\t\t$this->system_message->set_error(\"Password Miss Match\");\n\n\t\t}\n\t\telse{\n\t\t\t$data = array('password' => $this->input->post('new_password'));\n\t\t\tif (!empty($new_password) && !empty($retype_password))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t\t\t{\n\t\t\t\t\t$this->custom_model->my_update(array('password_show'=>$new_password),array('id' => $user_id),'admin_users');\n\t\t\t\t\techo \"success\"; die;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"error\"; die;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"error\"; die;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function change_password()\n {\n if ($user = $this->authorized(USER))\n {\n $descriptive_names = array(\n 'current_password' => 'Current Password',\n 'new_password' => 'New Password',\n 'new_password_confirm' => 'Confirm Password'\n );\n\n $rules = array(\n 'current_password' => ($user['group_id']==0)?'clean':'required|clean',\n 'new_password' => 'required|clean',\n 'new_password_confirm' => 'required|clean'\n );\n\n $this->loadLibrary('form.class');\n $form = new Form();\n\n $form->dependencies['title'] = \"Change Password\";\n $form->dependencies['form'] = 'application/views/change-password.php';\n $form->dependencies['admin_reset'] = false;\n $form->dependencies['client_id'] = $user['id'];\n $form->form_fields = $_POST;\n $form->descriptive_names = $descriptive_names;\n $form->view_to_load = 'form';\n $form->rules = $rules;\n\n if ($fields = $form->process_form())\n {\n\n $this->loadModel('UserAuthentication');\n\n\n if ($this->UserAuthentication->change_password($user['id'], $fields['current_password'], $fields['new_password'], $fields['new_password_confirm']))\n {\n $this->alert(\"Password Updated\", \"success\");\n $this->redirect(\"portal/home\");\n }\n else\n {\n $this->alert(\"Error: Password Not Updated\", \"error\");\n $this->redirect(\"portal/home\");\n }\n }\n }\n }", "public function change_password()\n {\n $response['success'] = TRUE;\n $response['message'] = '';\n $response['result'] = '';\n\n $username = $this->session->userdata('username');\n $currentPass = $this->input->post(\"curPsw\");\n $newPass = $this->input->post(\"newPsw\");\n $confirmNewPass = $this->input->post(\"confNewPsw\");\n\n if ($newPass == $confirmNewPass && $this->user_model->check_user($username, $currentPass))\n {\n log_message('debug', 'user change_password username: ' . $username);\n $data = array(\n 'password' => md5($newPass)\n );\n $affected_rows = $this->user_model->update(array('id' => $this->session->userdata('id')), $data);\n echo json_encode($response);\n }\n else\n {\n $response['success'] = FALSE;\n $response['message'] = 'Authentication failed. Try again';\n echo json_encode($response);\n }\n }", "public function actionChangepassword()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t\n\t\t$record = SiteUser::model()->findByAttributes(array('id'=> Yii::app()->user->id));\n\t\n\t\tif(isset($_POST['SiteUser']))\n\t\t{\t\n\t\t\tif(trim($_POST['SiteUser']['password']) != '') {\n\t\t\t\t$record->password = $_POST['SiteUser']['password'];\n\t\t\t\t\n\t\t\t} \t\t\n\t\t\tif(trim($_POST['SiteUser']['password']) == trim($_POST['SiteUser']['repeat_password'])) {\n\t\t\t\t$record->repeat_password = $record->password;\n\t\t\t}\t\n\t\t\t\n\t\t\tif($record->validate()) {\n\t\t\t\t$record->repeat_password = $record->password = crypt($record->password);\n\t\t\t\tif($record->save())\n\t\t\t\t\t$this->redirect(array('personal'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$record->repeat_password = $record->password = '';\n\t\t\t}\n\n\t\t}\t\n\n\t\t$this->render('changepassword',array('record'=>$record));\n\t}", "public function changepass($id=null){\n\n }", "public function changePasswordAction()\r\n\t{\r\n\t\t$this->_view->_title = 'Thay đổi mật khẩu';\r\n\r\n\t\tif ($this->_arrParam['form']['token'] > 0) {\r\n\r\n\t\t\t$new = $this->_arrParam['form']['new-password'];\r\n\t\t\t$enter = $this->_arrParam['form']['enter-password'];\r\n\r\n\t\t\tif ($new != $enter) {\r\n\t\t\t\t$this->_view->error = 'Mật khẩu không khớp. Xin kiểm tra lại';\r\n\t\t\t} else {\r\n\r\n\t\t\t\t$this->_model->changePassword($this->_arrParam);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// URL::redirect($this->_arrParam['module'], $this->_controller, 'index');\r\n\r\n\r\n\r\n\t\t$this->_view->render(\"{$this->_controller}/change_password\");\r\n\t}", "public function resetPassword();", "public function changePassword()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('change-password');\n\n return $this->loadPublicView('user.change-password', $breadCrumb['data']);\n }", "function change_pwd_update_register(){\n\t\tglobal $CFG;\n\t\t$old_password = $this->My_addslashes(md5($_POST[\"old_password\"]));\n\t\t \n\t\t$new_password = md5($_POST[\"new_password\"]);\n\t \n\t\tif($this->chkPasswordInAdmin($old_password,$_SESSION['adminid'])){\n\t\t\t\t$UpQuery = \"UPDATE \".$CFG['table']['admin'].\" SET password = '\".$this->filterInput($new_password).\"' WHERE admin_id = \". $this->filterInput($_SESSION['adminid']);\n\t\t\t\t$UpResult = mysql_query($UpQuery) or die($this->mysql_error($UpQuery));\n\t\t\t}\n\t\telse{\t\n\t\t\techo \"Invalid_Old_Pwd\";\t\t\t\n\t\t\texit();\n\t\t\t}\n\t}", "public function setpasswordAction(){\n $req=$this->getRequest();\n $cu=$this->aaac->getCurrentUser();\n $password=$this->getRequest()->getParam('password');\n $record=Doctrine_Query::create()->from('Users')->addWhere('ID=?')->fetchOne(array($req->getParam('id'))); \n $record->password=md5($password);\n if(!$record->trySave()){\n $this->errors->addValidationErrors($record);\n }\n $this->emitSaveData(); \n }", "function can_change_password() {\n return false;\n }", "function can_change_password() {\n\t\treturn false;\n\t}", "static function password_forgot() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if (!$hash = data('hash'))\n go('/');\n\n # user hash exists\n $user = $model::first(array(\n 'fields' => 'id, email, name',\n 'where' => \"hash_password_forgot = '$hash'\"\n ));\n\n if (empty($user))\n go('/');\n\n # POST passwords sent\n if ($model::data()) {\n $user->password = $model::data('password');\n $user->password_confirm = $model::data('password_confirm');\n\n # validate passwords\n if ($user->validate()) {\n $user->password = auth_encrypt($user->password);\n $user->hash_password_forgot = '';\n\n $user->edit() ?\n flash('Sua senha foi alterada com sucesso.') :\n flash('Algo ocorreu errado. Entre em contrato com a empresa.', 'error');\n\n go('/');\n }\n }\n\n globals('user', $user);\n }", "public function newpass()\n {\n if(isset($_POST['LastPassword']) && isset($_POST['NewPassword']))\n {\n if(!empty($_POST['LastPassword']) && !empty($_POST['NewPassword']))\n {\n $this->_oldPass = md5($_POST['LastPassword']);\n $this->_newPassMD5 = md5($_POST['NewPassword']);\n $this->_id = $_SESSION['user_id'];\n $this->_email = $_SESSION['user_email'];\n\n $user = $this->model->checkPassword($this->_id);\n if(!empty($user))\n {\n if($this->_oldPass == $user['Password'])\n {\n if($this->model->changePassword($this->_email, $this->_newPassMD5))\n {\n // Si ok (true) alors on renvoi sur la page de profil\n $messageFlash = 'Your new password has been updated !';\n $this->coreSetFlashMessage('sucess', $messageFlash, 6);\n header('Location:?module=profile');\n exit();\n }\n else\n {\n // Erreur !\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'An error occur. Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }\n else\n {\n // Mauvais password\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'Wrong password ! Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }\n else\n {\n // Pas de user\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'An error occur ! Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }\n else\n {\n // Pas de password\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'No password send ! Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }\n else\n {\n // Pas de post\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'No password send ! Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }", "public function setPassword($newPassword){\n\t}", "function update_password() {\n\t\t$old_password = $_POST['old_password'];\n\t\t$new_password = $_POST['new_password'];\n\t\tif (!empty($old_password) && !empty($new_password)) {\n\t\t\t$admin_records = $this -> conn -> get_table_row_byidvalue('pg_track_admin', 'admin_password', md5($old_password));\n\t\t\tif (!empty($admin_records)) {\n\t\t\t\t$data['admin_password'] = md5($new_password);\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('pg_track_admin', 'admin_status', 1, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Password changed successfully\");\n\t\t\t} else {\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Old Password\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\", 'old_password' => $old_password, 'new_password' => $new_password);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function actionChangePassword() {\n $model = User::model()->find('id=:id', array(':id' => Yii::app()->user->id));\n $model->scenario = 'needpassword';\n $model->password = '';\n // if it is ajax validation request\n if (isset($_POST['ajax']) && $_POST['ajax'] === 'changepassword-form') {\n echo CActiveForm::validate($model);\n Yii::app()->end();\n }\n\n if (isset($_POST['User'])) {\n $model->attributes = $_POST['User'];\n if ($model->changePassword()) {\n Yii::app()->user->setFlash('success', 'Your password has been successfully changed!');\n $this->redirect(array('user/changepassword'));\n } else {\n $this->render('changepassword', array('model' => $model));\n }\n } else {\n $this->render('changepassword', array('model' => $model));\n }\n }", "public function changePassword() {\n $validator = \\Validator::make(\n \\Input::only([\"password\", \"id\", \"reset_code\"]),\n [\n \"id\" => \"required\",//|exists:users,id\",\n \"reset_code\" => \"required\",//|exists:users,reset_code\",\n \"password\" => \"required\"\n ]\n );\n\n if($validator->fails()) {\n $user = User::whereId(intval(\\Input::get(\"id\")))->whereResetCode(\\Input::get(\"reset_code\"))->first();\n if(!$user) {\n return \\View::make(\"admin.nice-error\", [\n \"title\" => \"Password change failed\",\n \"message\" => $validator->messages()->first()\n ]);\n } else {\n return \\View::make(\"admin.forgot\")->with(\"user\", $user)->withErrors($validator->errors());\n }\n } else {\n $user = User::findOrFail(intval(\\Input::get(\"id\")));\n $user->password = \\Hash::make(\\Input::get(\"password\"));\n $user->reset_code = \"\";\n $user->save();\n return \\Redirect::route(\"dashboard.login\")->with(\"relogin\", true);\n }\n }", "public function change_password()\n\t{\n\t \n\t \n \t\t/* Breadcrumb Setup Start */\n\t\t\n\t\t$link = breadcrumb();\n\t\t\n\t\t$data['breadcrumb'] = $link;\n\t\t\n\t\t/* Breadcrumb Setup End */\n\t\n\t\t$data['page_content']\t=\t$this->load->view('changepwd',$data,true);\n\t\t$this->load->view('page_layout',$data);\n\t}", "public function changePasswordAction(Request $request){\n\n $params['title'] = _(\"CHANGE PASSWORD\");\n\n //handle forgot 1 form\n if (!empty($_POST)){\n\n $error = true;\n $password = $_POST['password'];\n $password_bis = $_POST['password_bis'];\n\n //validation\n $validator = new CustomValidator();\n\n $validator->validatePassword($password);\n $validator->validatePasswordBis($password_bis, $password);\n\n //if valid\n if ($validator->isValid()){\n $securityHelper = new SH();\n\n //find user from db\n $user = $securityHelper->getUser($request);\n\n //if user found\n if($user){\n\n $hashedPassword = $securityHelper->hashPassword( $password, $user->getSalt() );\n $user->setPassword( $hashedPassword );\n\n $userManager = new UserManager();\n $userManager->update($user);\n\n $params[\"message\"] = _(\"Password updated!\");\n $view = new View(\"success.php\", $params);\n $view->setLayout(\"../View/layouts/modal.php\");\n $view->send(true);\n }\n }\n \n $params['errors'] = $validator->getErrors();\n }\n\n\n $view = new View(\"change_password.php\", $params);\n $view->setLayout(\"../View/layouts/modal.php\");\n $view->send(true);\n }", "public function changepassAction()\n {\n $user_service = $this->getServiceLocator()->get('user');\n\n $token = $this->params()->fromRoute('token');\n $em = EntityManagerSingleton::getInstance();\n $user = null;\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost()->toArray();\n $user = $em->getRepository('Library\\Model\\User\\User')->findOneByToken($token);\n\n if (!($user instanceof User))\n {\n throw new \\Exception(\"The user cannot be found by the incoming token\");\n }\n\n $user_service->changePassword($data, $user);\n $em->flush();\n }\n\n return ['user' => $user];\n }", "function reset() {\n $this->wait();\n $viewret = $this->view();\n if($viewret == ''){\n return '';\n }\n //print $viewret.'<br>';\n $pageRet = $this->net_c->get($viewret);\n $rid = $this->parseRidValue($pageRet);\n if($rid == ''){\n return '';\n }\n\n $str = null;\n $strPol = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n $max = strlen($strPol)-1;\n for($i=0;$i<10;$i++){\n $str.=$strPol[rand(0,$max)];\n }\n $this->password = $str;\n\n $data = array('password'=>$this->password, 'password_confirm'=>$this->password, 'rid'=>$rid);\n\n //print $this->mailaddr.'<br>';\n //print $this->password.'<br>';\n //print $rid.'<br>';\n //print $data.'<br>';\n\n require_once('idd.php');\n $db = new IdoDB();\n $db->update($this->mailaddr,'passwd',$this->password);\n\n $this->net_c->post('https://www.dmm.co.jp/my/-/passwordreminder/complete/',$data);\n \n return $this->password;\n }", "public function post_changepassword() {\n try {\n $i = Input::post();\n\n if (!\\Auth::instance()\n ->check()\n ) {\n throw new \\Craftpip\\Exception('Sorry, we got confused. Please try again later.', 123);\n }\n\n if ($i['newpassword'] !== $i['newpassword2']) {\n throw new \\Craftpip\\Exception('Sorry, the new passwords do not match.', 123);\n }\n\n $a = \\Auth::instance()\n ->change_password($i['oldpassword'], $i['newpassword']);\n\n if (!$a) {\n throw new \\Craftpip\\Exception('Sorry, the old password is incorrect. Please try again.', 123);\n }\n\n // todo: count length of password please...\n\n $response = array(\n 'status' => true,\n );\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n\n echo json_encode($response);\n }", "public function actionPassword()\n {\n if (is_null($this->password)) {\n self::log('Password required ! (Hint -p=)');\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->email) && is_null($this->id)) {\n self::log('User ID or Email required ! (Hint -e= or -i=)');\n return ExitCode::DATAERR;\n }\n\n $model = User::find()->where([\n 'OR',\n [\n 'email' => $this->email\n ],\n [\n 'id' => $this->id\n ]\n ])->one();\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n $validator = new TPasswordValidator();\n\n $model->password = $this->password;\n\n $validator->validateAttribute($model, \"password\");\n\n if ($model->errors) {\n\n self::log($model->errorsString);\n\n return ExitCode::DATAERR;\n }\n\n $model->setPassword($this->password);\n\n if (! $model->save()) {\n\n self::log('Password not changed ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Password successfully changed !');\n\n return ExitCode::OK;\n }", "public function actionChangePassword()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', ['required' => true]);\n $model = $this->findModel($username);\n $model->setPassword($this->prompt(Console::convertEncoding(Yii::t('app', 'New password')) . ':', [\n 'required' => true,\n 'pattern' => '#^.{4,255}$#i',\n 'error' => Console::convertEncoding(Yii::t('app', 'More than {:number} symbols', [':number' => 4])),\n ]));\n $this->log($model->save());\n }", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "public function change_password() {\n\t\treturn view( 'provider.profile.change_password' );\n\t}", "function eventUpdatePassword(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$password1 = util::getData(\"password1\");\r\n\t\t$password2 = util::getData(\"password2\");\r\n\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::SetOfficerAccountPassword($this->guild->id, $userid, $password1, $password2);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Password Changed!\");\r\n\r\n\t}", "public function changePassword($data){\n\t\tif(isset($data['User']['current_password']) && isset($data['User']['id'])){\n\t\t\tif($this->checkPassword($data['User']['id'], $data['User']['current_password'])){\n\t\t\t\tunset($data['User']['current_password']);\n\t\t\t\treturn $this->save($data);\n\t\t\t}\telse {\n\t\t\t\t$this->invalidate('current_password', 'Your current password is not correct.');\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function reset_pass() {\n \t\t$email = $this->input->post('email');\n\n\t $pass = $this->generate_pass(16);\n\t $hash = password_hash($pass, B_CRYPT); // http://php.net/manual/en/function.password-hash.php\n\n\t $this->load->model('users_table');\n\t $this->users_table->update_password($email, $hash);\n\n\t $this->send_email($email, $pass, \"2\");\n \t}", "function changePassword( $name, $pw ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['users'] as &$user) {\n if ($name == $user['name'] || $name == $user['email']) {\n $user[\"password\"] = $pw;\n saveDB( $d );\n $found = true;\n break;\n }\n }\n if (!$found)\n return FALSE;\n audit( \"changePassword done\", $name );\n return TRUE;\n }", "public function change_password($data, $user_id) {\r\n\r\n // Start Backend Validation\r\n if (empty($data['old-pwd'])) {\r\n $this->errors['old-pwd'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n }\r\n\r\n if (empty($data['new-pwd'])) {\r\n $this->errors['new-pwd'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n } elseif (strlen($data['new-pwd']) < 8) {\r\n $this->errors['new-pwd'] = 'يجب على كلمة السر أن تتكون من 8 أحرف فأكثر';\r\n }\r\n\r\n if ($data['confirm-pwd'] != $data['new-pwd']) {\r\n $this->errors['confirm-pwd'] = 'كلمتا السر غير متطابقتان';\r\n }\r\n\r\n if (empty($this->errors)) {\r\n // Sanitize Data\r\n $old_pwd = sha1(filter_var($data['old-pwd'], FILTER_SANITIZE_STRING));\r\n $new_pwd = sha1(filter_var($data['new-pwd'], FILTER_SANITIZE_STRING));\r\n\r\n $user = $this->select('users', 'id', $user_id)->fetch_assoc();\r\n\r\n if ($user['password'] === $old_pwd) { // If Passwords Are Mached\r\n $connection = DB::connect();\r\n\r\n // Update The Password\r\n $stmt = \"UPDATE users SET password = '$new_pwd' WHERE id = '$user_id'\";\r\n $result = $connection->query($stmt);\r\n\r\n // Redirect To Profile Page\r\n $profile_url = DB::MAIN_URL . 'profile.php';\r\n header('location: ' . $profile_url);\r\n\r\n } else {\r\n $this->errors['old-pwd'] = 'كلمة السر غير صحيحة';\r\n }\r\n\r\n }\r\n\r\n }", "public function passwordResetCode();", "public function changePass()\n {\n if($_POST['old_pass'] && $_POST['old_pass'] !=''){\n $user = $this->f_usersmodel->getFirstRowWhere('users',array(\n 'phone' => $this->input->post('phone')\n ));\n $current_pass = $this->input->post('old_pass');\n for ($i=0; $i < 5; $i++) {\n $current_pass = md5( $current_pass);\n }\n $check = false;\n if($user->password == $current_pass){\n $check = true;\n $change_pass = $this->input->post('new_pass');\n for ($i=0; $i < 5; $i++) {\n $change_pass = md5( $change_pass);\n }\n $this->f_usersmodel->Update_where('users',array('id'=>$user->id),array(\n 'password' => $change_pass,\n //'modified' => date(\"Y-m-d H:i:s\"),\n //'use_salt' => $salt,\n ));\n }\n }\n $data['check'] = $check;\n echo json_encode($data);\n }", "function setRequestPassword($value)\n {\n $this->_props['RequestPassword'] = $value;\n }", "public function changePasswordAction()\n {\n if ($this->request->isPost()) {\n // Request data\n $data = $this->request->getPost();\n\n $formValidator = $this->createValidator([\n 'input' => [\n 'source' => $data,\n 'definition' => [\n 'password' => new Pattern\\Password,\n 'confirmation' => new Pattern\\PasswordConfirmation($data['password'])\n ]\n ]\n ]);\n\n if ($formValidator->isValid()) {\n // Update current password\n $userService = $this->getModuleService('userService');\n $userService->updatePasswordById($this->getUserId(), $data['password']);\n\n $this->flashBag->set('success', 'Your password has been updated successfully');\n return 1;\n\n } else {\n return $formValidator->getErrors();\n }\n \n } else {\n // Just render empty form\n return $this->view->render('settings/change-password');\n }\n }", "static function password_forgot() {\n parent::password_forgot();\n view_var('user', globals('user'));\n }", "public function actionChangePassword()\n {\n \t$user = UserAdmin::findOne(Yii::$app->request->get('id'));\n \t$model = new ChangeForcePasswordForm($user);\n \tif ($model->load(Yii::$app->request->post()) && $model->applyChanges()) \n \t{\n \t\tYii::$app->getSession()->setFlash('success', \n \t\t\t\"The user password has been changed\"\n \t\t);\n \t\treturn $this->redirect([\"/admin/crud/user-admin/view\", 'id' => $user->id]);\n \t}\n \t\n \t$this->layout = '@app/layouts/layout-popup-sm';\n \treturn $this->render('change-password', ['model' => $model]);\n }", "public function changePasswordAction()\n {\n $form = new ChangePasswordForm();\n\n if ($this->request->isPost()) {\n\n if (!$form->isValid($this->request->getPost())) {\n\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n\n $user = $this->auth->getUser();\n\n $user->password = $this->security->hash($this->request->getPost('password'));\n $user->mustChangePassword = 'N';\n\n $passwordChange = new PasswordChanges();\n $passwordChange->user = $user;\n $passwordChange->ipAddress = $this->request->getClientAddress();\n $passwordChange->userAgent = $this->request->getUserAgent();\n\n if (!$passwordChange->save()) {\n $this->flash->error($passwordChange->getMessages());\n } else {\n\n $this->flash->success('Your password was successfully changed');\n\n Tag::resetInput();\n }\n }\n }\n\n $this->view->form = $form;\n }", "public function get_changepassword(){\n\t\tif (Auth::check()){\n\t\t\t$customer_id = Auth::user()->customer_id;\n\t\t\t\n\t\t\t$this->layout->content = View::make('frontend.customers.changepassword')\n\t\t\t\t->with('title', 'Change Password')\n\t\t\t\t->with('customer', Customer::find($customer_id));\n\t\t}\n\t}", "public function cbc_changepassword() {\n\n try {\n\t\t\n\t\t\t\t $username =$this->Session->read('Auth.Member.vc_username');\n\t\t\t\t$newpassword = $this->data['Customer']['vc_password'];\n\t\t\t\tlist( $selectedType, $type, $selectList ) = $this->getRFATypeDetail($this->Session->read('Auth.Member.vc_comp_code'));\n\n if (!empty($this->data) && $this->RequestHandler->isPost()) {\n\n $this->Customer->set($this->data);\n\n /**************** Use this before any validation *********************************** */\n\n $setValidates = array(\n 'vc_old_password',\n 'vc_password',\n 'vc_comp_code',\n 'vc_confirm_password');\n\n /** ************************************************************************************* */\n if ( $this->Customer->validates(array('fieldList' => $setValidates)) ) {\n\n\n $this->Member->validate = null;\n\t\t\t\t\t\n $updateData['Member']['vc_password'] = $this->Auth->password(trim($this->data['Customer']['vc_password']));\n\n $updateData['Member']['dt_user_modified'] = date('Y-m-d H:i:s');\n\n $updateData['Member']['vc_user_no'] = $this->Session->read('Auth.Member.vc_user_no');\n\n if ($this->Member->save($updateData)) {\n\n $this->data = NUll;\n\n $this->Session->setFlash('Your password has been changed successfully !!', 'success');\n\t\t\t\t\t\t \n\t\t\t\t\t\t /********************************** Email shoot **********************************/\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t$this->Email->from = $this->AdminName . '<' . $this->AdminEmailID . '>';\n\n\t\t\t\t\t\t\t\t$this->Email->to = trim($this->Session->read('Auth.Member.vc_email_id'));\n\n\t\t\t\t\t\t\t\t$this->Email->subject = strtoupper($selectedType) . \" Password Changed \";\n\n\t\t\t\t\t\t\t\t$this->Email->template = 'registration';\n\n\t\t\t\t\t\t\t\t$this->Email->sendAs = 'html';\n\n\t\t\t\t\t\t\t\t$this->set('name', ucfirst(trim($this->Session->read('Auth.Member.vc_user_firstname'))) . ' ' . ucfirst(trim($this->Session->read('Auth.Member.vc_user_lastname'))));\n\n\t\t\t\t\t\t\t\t$this->Email->delivery = 'smtp';\n\n\t\t\t\t\t\t\t\t$mesage = \" You have recently changed password on RFA portal ( \".strtoupper($selectedType).\" Section ). Please use the credentials mentioned below to login : \";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$mesage .= \"<br> Username : \".trim($username);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$mesage .= \"<br> Password : \".trim($newpassword);\n\n\t\t\t\t\t\t\t\t$this->Email->send($mesage);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/******************************** End *********************************/\n\n\n $this->redirect($this->referer());\n\t\t\t\t\t\t\n } else {\n\n $this->data = NUll;\n\n $this->Session->setFlash('Your password could not be changed, please try later', 'error');\n }\n\t\t\t\t\t\n }\n\t\t\t\t\n }\n\t\t\t\n $this->set('title_for_layout',\"Change Password \");\n\t\t\t\n\t\t\t\n } catch (Exception $e) {\n\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\n exit;\n }\n }", "function changePass() {\n\t\t$id = $this->AuthExt->User('id');\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__('Invalid user', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t//don't allow hidden variables tweaking get the group and username \n\t\t\t//form the system in case an override occured from the hidden fields\n\t\t\t$this->data['User']['role_id'] = $this->AuthExt->User('role_id');\n\t\t\t$this->data['User']['username'] = $this->AuthExt->User('username');\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('The password change has been saved', 'flash_success');\n\t\t\t\t$this->redirect(array('action' => 'index', 'controller' => ''));\n\t\t\t} else {\n\t\t\t\tprint_r($this->data);\n\t\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t\t$this->data['User']['password'] = null;\n\t\t\t\t$this->data['User']['confirm_passwd'] = null;\n\t\t\t\t$this->Session->setFlash('The password could not be saved. Please, try again.', 'flash_failure');\n\t\t\t}\n\t\t}\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t$this->data['User']['password'] = null;\n\t\t}\n\t\t$roles = $this->User->Role->find('list');\n\t\t$this->set(compact('roles'));\n\t}", "function submitpassword() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\tif ($_POST['pass1']=== $_POST['pass2'])\n\t\t{\n\t\t\tUserModel::Create()->ChangePassword($_POST['hash'], $_POST['pass1']);\n\t\t\tif (User::IsLoggedIn())\n\t\t\t{\n\t\t\t\tUser::setpassword($_POST['pass1']);\n\t\t\t\t$this->renderWithTemplate('admin/index', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse\n\t\t\t{$this->renderWithTemplate('admin/login', 'AdminPageBaseTemplate');}\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\t$this->viewData['message'] =\"Passwords Don't Match. Try Again\";\n\t\t\t$this->renderWithTemplate('users/changepassword', 'AdminPageBaseTemplate');\n\t\t}\n }", "public function changePassword(User $user, string $newPassword): void;", "function admin_change_password() {\r\n\r\n $this->layout = 'default';\r\n\r\n $this->checklogin();\r\n\r\n// echo ' e10adc39491e240';\r\n// echo \"<br>\".$new = $this->encrypt_data(123456);\r\n// echo \"<br>old \".$old = $this->decrypt_data($new);\r\n\r\n if(!empty($this->data))\r\n {\r\n //$this->pre($this->data);\r\n //exit;\r\n\r\n $errorarray = array();\r\n\r\n if (isset($this->data['User']['oldpwd']) && (trim($this->data['User']['oldpwd']) == '' || trim($this->data['User']['oldpwd']=='Password'))) {\r\n $errorarray['enter_oldpwd'] = ENTER_OLD_PASSWORD;\r\n }\r\n else\r\n {\r\n $check_len_pass = strlen(trim($this->data['User']['oldpwd']));\r\n\r\n if($check_len_pass<5)\r\n $errorarray['oldpwd_minlen'] = PASSWORD_LENGTH;\r\n else\r\n {\r\n $check_user = $this->User->find('first', array('conditions' => array('status' => 0, 'password'=>md5($this->data['User']['oldpwd']) ,'id'=>$this->Session->read(md5(SITE_TITLE).'USERID'))));\r\n\r\n// $this->pre($check_user);\r\n// exit;\r\n if(empty($check_user))\r\n {\r\n $errorarray['pass_not_match'] = OLDNOTMATCH;\r\n }\r\n }\r\n }\r\n\r\n if (isset($this->data['User']['newpwd']) && (trim($this->data['User']['newpwd']) == '' || trim($this->data['User']['newpwd']=='Password'))) {\r\n $errorarray['newpass'] = ENTER_NEW_PASSWORD;\r\n }\r\n else\r\n {\r\n $check_len_pass = strlen(trim($this->data['User']['newpwd']));\r\n\r\n if($check_len_pass<5)\r\n $errorarray['newpass_minlen'] = NEW_PASSWORD_LENGTH;\r\n }\r\n if (isset($this->data['User']['confirmpwd']) && (trim($this->data['User']['confirmpwd']) == '' || trim($this->data['User']['confirmpwd']) == 'Password')) {\r\n $errorarray['confpass'] = ENTER_CONFPASS;\r\n }\r\n else\r\n {\r\n $check_len_confpass = strlen(trim($this->data['User']['confirmpwd']));\r\n\r\n if($check_len_confpass<5)\r\n $errorarray['confpass_minlen'] = CONF_PASSWORD_LENGTH;\r\n }\r\n\r\n if (trim($this->data['User']['newpwd']) != '' && trim($this->data['User']['confirmpwd']) != '' && strlen(trim($this->data['User']['newpwd']))>=5 && strlen(trim($this->data['User']['confirmpwd']))>=5 && trim($this->data['User']['newpwd']) != trim($this->data['User']['confirmpwd'])) {\r\n $errorarray['conflict'] = NEWCONFPASS;\r\n }\r\n\r\n\r\n $this->set('errorarray',$errorarray);\r\n\r\n if(empty($errorarray))\r\n {\r\n// $this->pre($errorarray);\r\n// exit;\r\n\r\n $update_user_dtl['User']['id'] = $this->Session->read(md5(SITE_TITLE).'USERID');\r\n $update_user_dtl['User']['password'] = md5($this->data['User']['newpwd']);\r\n $update_user_dtl['User']['encrypt_password'] = $this->encrypt_pass($this->data['User']['newpwd']);\r\n\r\n //$this->pre($this->Session->read());\r\n\r\n $name = $this->Session->read(md5(SITE_TITLE).'USERNAME');\r\n $email = $this->Session->read(md5(SITE_TITLE).'USEREMAIL');\r\n $new_pass = $this->data['User']['newpwd'];\r\n\r\n //$this->email_client_changepassword($name,$email,$new_pass);\r\n// $this->pre($update_user_dtl);\r\n// exit;\r\n\r\n $this->User->save($update_user_dtl);\r\n $this->redirect(DEFAULT_ADMINURL . 'users/change_password/succhange');\r\n }\r\n// $this->pre($errorarray);\r\n// exit;\r\n }\r\n }", "function admin_change_password() {\n\t\t/*\techo '<pre>';\n\t\tprint_r($this->data);\n\t\tdie;*/\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t$this->layout = \"admin\";\n\t\t$this->set(\"changepassword\", \"selected\"); //set main navigation class\n\t\t$this->set('manageClass', 'selected');\n\t\t$uid = $this->Session->read('Admin.id');\n\t\t$email = $this->Session->read('Admin.email');\n\t\t$userdata = $this->Member->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Member.id' => $this->Session->read('Admin.id'),\n\t\t\t\t'Member.email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\tif ($userdata) {\n\t\t\tif (!empty($this->data)) {\n\t\t\t\t$this->Member->updateAll(array(\n\t\t\t\t\t'Member.pwd' => \"'\" . md5($this->data['Member']['pwd']) . \"'\",\n\t\t\t\t\t'Member.email' => \"'\" . $this->data['Member']['email'] . \"'\"\n\t\t\t\t), array(\n\t\t\t\t\t'Member.email' => $email,\n\t\t\t\t\t'Member.id' => $this->Session->read('Admin.id')\n\t\t\t\t) //(conditions) where userid=schoolid\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->Session->setFlash('Password changed successfully');\n\t\t\t\t$this->redirect(array(\n\t\t\t\t\t'action' => 'change_password',\n\t\t\t\t\t'admin' => true\n\t\t\t\t));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\telse {\n\t\t}\n\t\t\n\t}", "function adminUpdateUserPassword()\n {\n \t# retrieve username passed in from GET Superglobal\n \tif(isset($_GET['userName']))\n\t{\n\t\t$userName=filter_input(INPUT_GET,'userName',FILTER_SANITIZE_STRING);\n\t}\n\t\n\t# submit update and check if was success\n \t$success=updatePassWord($userName);\n\t\n\techo 'Successful='.$success;\n }", "public function ResetPassword() {\n\t\t\t$strPassword = strtolower(substr(md5(microtime()), 4, 8));\n\t\t\t$this->SetPassword($strPassword);\n\t\t\t$this->PasswordResetFlag = true;\n\t\t\t$this->Save();\n\n\t\t\t// Setup Token Array\n\t\t\t$strTokenArray = array(\n\t\t\t\t'NAME' => $this->strFirstName . ' ' . $this->strLastName,\n\t\t\t\t'USERNAME' => $this->strUsername,\n\t\t\t\t'PASSWORD' => $strPassword\n\t\t\t);\n\n\t\t\t// Send Message\n\t\t\tQApplication::SendEmailUsingTemplate('forgot_password', 'Qcodo.com Credentials', QCODO_EMAILER,\n\t\t\t\t$this->SmtpEmailAddress, $strTokenArray, true);\n\t\t}", "public function setPass($request)\r\n {\r\n $params = [\r\n 'Password' => password_hash($request['password'], PASSWORD_DEFAULT),\r\n ];\r\n \r\n \r\n $this->primary = 'Activation';\r\n /*\r\n * Update row in user table where Activativon ==$request['activateCode'] with new password (hash code)\r\n */\r\n $this->update($request['activateCode'], $params);\r\n\r\n }", "public function change() {\n $handle = $_POST['handle'];\n $new_password = $_POST['password'];\n $hashed_password = sha1($new_password);\n $this->db->where('handle', $handle);\n $this->db->update('user', array('password' => $hashed_password));\n echo \"success\";\n }", "public function resetpassAction()\n\t{\n\t\t$email='[email protected]';\n\n\t\t$customer = Mage::getModel('customer/customer')\n ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())\n ->loadByEmail($email);\n\t\t$customer->sendPasswordResetConfirmationEmail();\n\t}", "public function passwordResetAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $userKey = $this->_getParam('key', null);\n\n if (is_null($userKey)) {\n throw new Ot_Exception_Input('msg-error-noKeyFound');\n }\n\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n $string = pack(\"H*\", $userKey);\n\n $decryptKey = trim(mcrypt_decrypt($cipher, $key, $string, MCRYPT_MODE_CBC, $iv));\n\n if (!preg_match('/[^@]*@[^-]*-[0-9]*/', $decryptKey)) {\n throw new Ot_Exception_Input('msg-error-invalidKey');\n }\n\n $userId = preg_replace('/\\-.*/', '', $decryptKey);\n $ts = preg_replace('/^[^-]*-/', '', $decryptKey);\n\n $timestamp = new Zend_Date($ts);\n\n $now = new Zend_Date();\n\n $now->subMinute((int)$loginOptions['forgotpassword']['numberMinutesKeyIsActive']);\n\n if ($timestamp->getTimestamp() < $now->getTimestamp()) {\n throw new Ot_Exception_Input('msg-error-keyExpired');\n }\n\n $realm = preg_replace('/^[^@]*@/', '', $userId);\n $username = preg_replace('/@.*/', '', $userId);\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $account = new Ot_Model_DbTable_Account();\n $thisAccount = $account->getByUsername($username, $realm);\n\n if (is_null($thisAccount)) {\n throw new Ot_Exception_Data('msg-error-userAccountNotFound');\n }\n\n $form = new Ot_Form_PasswordReset();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n if ($form->getValue('password') == $form->getValue('passwordConf')) {\n\n $data = array(\n 'accountId' => $thisAccount->accountId,\n 'password' => md5($form->getValue('password')),\n );\n\n $account->update($data, null);\n\n $this->_helper->messenger->addSuccess('msg-info-passwordReset');\n\n $loggerOptions = array(\n 'attributeName' => 'accountId',\n 'attributeId' => $data['accountId'],\n );\n\n $this->_helper->log(Zend_Log::INFO, 'User reset their password', $loggerOptions);\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-passwordsNotMatch');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->view->headScript()->appendFile($this->view->baseUrl() . '/public/scripts/ot/jquery.plugin.passStrength.js');\n\n $this->_helper->pageTitle('ot-login-passwordReset:title');\n\n $this->view->assign(array(\n 'form' => $form,\n ));\n\n }", "public function restPassword(){\n\t}", "public function clobberPassword()\n\t{\n\t\tif( empty($this->myAuthID) && empty($this->myAccountID) )\n\t\t\tthrow PasswordResetException::toss( $this, 'NO_ACCOUNT_OR_AUTH_ID' ) ;\n\t\tif( empty($this->myNewToken) )\n\t\t\tthrow PasswordResetException::toss( $this, 'REENTRY_AUTH_FAILED' ) ;\n\t\t$theAuthFilter = $this->chooseIdentifierForSearch() ;\n\t\t$theSql = SqlBuilder::withModel( $this->model )\n\t\t\t->startWith( 'UPDATE ' )->add( $this->model->tnAuth )\n\t\t\t->setParamPrefix( ' SET ' )\n\t\t\t->mustAddParam( 'pwhash',\n\t\t\t\t\tStrings::hasher( $this->getRandomCharsFromToken() ) )\n\t\t\t->startWhereClause()\n\t\t\t->mustAddParam( $theAuthFilter['col'], $theAuthFilter['val'] )\n\t\t\t->endWhereClause()\n\t\t\t;\n//\t\t$this->debugLog( $theSql->mySql ) ;\n\t\ttry { $theSql->execDML() ; }\n\t\tcatch( PDOException $pdox )\n\t\t{\n\t\t\t$this->errorLog( __METHOD__ . ': ' . $pdox->getMessage() ) ;\n\t\t\tthrow PasswordResetException::toss( $this,\n\t\t\t\t\t'DANG_PASSWORD_YOU_SCARY' ) ;\n\t\t}\n\t}", "public function changeAdminUserPassword() {\n\t\t$data = $this->request->data['User'];\n\n\t\t$this->User->id = $userId = $data['id'];\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$isPasswordChanged = ($data['current_password'] !== $data['new_password']) ? true : false;\n\t\t\tif ($isPasswordChanged && ($userId !== $this->Auth->User('id'))) {\n\t\t\t\t$this->__sendPasswordChangedEmail($data);\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('Password changed successfully.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change the password due a server problem, try again later.'), 'error');\n\t\t}\n\n\t\t$this->redirect('/admin/users/editAdmin/' . $userId);\n\t}", "private function user_reset_password(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\tif(!isset($_POST['password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['confirm_password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter confirm_password are require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\n\t\t\t$user_id = $this->_request['table_doctor_id'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$cpassword = $this->_request['confirm_password'];\n\n\t\t\tif(!empty($password) && !empty($cpassword) ) {\n\n\t\t\t\tif($password!=$cpassword) {\n\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Password and Confirm password is not matched\");\n\t\t\t\t\t$this->response($this->json($error), 200);\n\n\t\t\t\t} else{\n\t\t\t\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t$sql = \"UPDATE table_user SET user_password='\".$hashed_password.\"' WHERE user_id='\".$user_id.\"' \";\n\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t$update = $stmt->execute();\n\t\t\t\t\t\t$fetchData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\t\t\t\tif(count($update)==1){\n\t\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Profile Updated\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function change_password_url() {\n return null;\n }", "public function changePassword()\n {\n if( ! Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $user = User::find(Session::getCurrentUserID());\n\n View::make('templates/front/change-password.php',array());\n }" ]
[ "0.7385647", "0.6946307", "0.6879779", "0.6693084", "0.6605285", "0.65734404", "0.656932", "0.6548491", "0.65362495", "0.6536129", "0.6530542", "0.65269536", "0.6497222", "0.6487361", "0.6462839", "0.6461272", "0.64552706", "0.64057016", "0.63971883", "0.6395171", "0.639308", "0.6390256", "0.6377693", "0.6374732", "0.6360376", "0.63445824", "0.6342667", "0.6331122", "0.6327309", "0.6325996", "0.6324419", "0.63130325", "0.6312176", "0.63064677", "0.63049483", "0.62901837", "0.6286583", "0.6269467", "0.62686425", "0.6263074", "0.62585276", "0.6258231", "0.62547034", "0.62483287", "0.62369543", "0.6231488", "0.6220211", "0.62059766", "0.62019426", "0.6153389", "0.6150851", "0.614976", "0.6139079", "0.61388516", "0.6135988", "0.6130346", "0.6130204", "0.61293155", "0.6121296", "0.61206764", "0.61184525", "0.6112763", "0.6108882", "0.60998636", "0.60967505", "0.60928816", "0.6087982", "0.6084737", "0.60758656", "0.6071816", "0.60713327", "0.60709065", "0.6058931", "0.6058483", "0.6043248", "0.6042464", "0.60398966", "0.6038337", "0.60382915", "0.6034932", "0.6029985", "0.60294354", "0.60221386", "0.60202914", "0.6016125", "0.60138255", "0.6005415", "0.6004104", "0.60026765", "0.6000532", "0.59944624", "0.59853566", "0.59810024", "0.597964", "0.5979173", "0.59784985", "0.5976712", "0.5973354", "0.5970258", "0.59680754" ]
0.73346704
1
Perform a language update request
public function selfUpdateLocalization() { if (!$this->userService->updateLocale(Auth::user()->id, Input::all())) { return Redirect::route('user-profile', array('tab' => 'localization'))->withErrors($this->userService->errors())->withInput(); } Alert::success('Your language settings have been successfully updated.')->flash(); return Redirect::route('user-profile', array('tab' => 'localization')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Request $request, Language $language)\n {\n //\n }", "function updateUserLanguage_post(){\n $this->check_service_auth();\n //pr($_POST);\n $this->form_validation->set_rules('languages','language','required');\n\t if($this->form_validation->run() == FALSE){\n\t $response = array('status'=>FAIL,'message'=>strip_tags(validation_errors()));\n\t $this->response($response);\n\t }\n \t$language = $this->post('languages');\n \t$languageCode = $this->post('languageCode');\n \t$data['user_id'] = $this->authData->userId;\n\t$data['upd'] = datetime();\n $res = $this->common_model->updateFields(USERS,array('userId'=>$this->authData->userId),array('language'=>$language,'languageCode'=>$languageCode));//update user language.\n if($res){\n $response = array('status'=>SUCCESS,'message'=>ResponseMessages::getStatusCodeMessage(171));\n }else{\n $response = array('status'=>FAIL,'message'=>ResponseMessages::getStatusCodeMessage(172));\n }\n $this->response($response);\n }", "public function languageAction() {\n\t\n\t\t//START LANGUAGE WORK\n\t\tEngine_Api::_()->getApi('language', 'sitestore')->languageChanges();\n\t\t//END LANGUAGE WORK\n\t\t$redirect = $this->_getParam('redirect', false);\n\t\tif($redirect == 'install') {\n\t\t\t$this->_redirect('install/manage');\n\t\t} elseif($redirect == 'query') {\n\t\t\t$this->_redirect('install/manage/complete');\n\t\t}\n\t}", "public function process_lang_change()\n {\n if (!isset($_POST['lang']) || !$_POST['lang']) {\n wp_send_json_error();\n }\n\n if (!session_id()) {\n session_start();\n }\n\n try {\n // Include Esc functions\n include_once(\\Esc::directory() . '/modules/general.php');\n include_once(\\Esc::directory() . '/includes/connect.php');\n\n if (!isset($_SESSION['esc_store']['selection_id'])) {\n \\EscConnect::getSelection();\n }\n\n $selection = \\EscConnect::init('selections/' . $_SESSION['esc_store']['selection_id'] . '/languages/' . $_POST['lang'])->put();\n\n if (!$selection || isset($selection['errors'])) {\n wp_send_json_error();\n }\n\n $_SESSION['esc_selection'] = $selection;\n\n wp_send_json_success();\n } catch (\\Exception $exp) {\n wp_send_json_error($exp->getMessage());\n }\n }", "public function update(LanguageRequest $request, $id)\n {\n LanguageOp::_update($request, $id);\n toastr()->success(trans('local.updated_success'));\n return redirect()->route('languages.index');\n }", "public function update(LanguageRequest $request, $id)\n {\n $language = Language::where('user_id',$this->user_id)->find($id);\n if (is_null($language)){\n return view('jobseeker.not-permitted');\n }else{\n $data = $request->getData();\n $language->update($data);\n return redirect('jobseeker/language');\n }\n }", "public function actionLanguageChanged() {\n\t\t$action = $_GET['action'];\n\t\tYii::app()->session['lang'] = $_GET['lang'];\n\t\tif (!Yii::app()->user->isGuest){\n\t\t\tYii::app()->user->lang = $_GET['lang'];\n\t\t}\n\t\tself::$trans=new Translations($_GET['lang']);\n\t\t\n\t\t$Session_Profiles_Backup = Yii::app()->session[$this->createBackup];\n\t\tif (isset($Session_Profiles_Backup)){\n\t\t\t$model = $Session_Profiles_Backup;\n\t\t} else {\n\t\t\tif ($action == 'register'){\n\t\t\t\t$model=new Profiles('register');\n\t\t\t} else {\n\t\t\t\t$model=new Profiles();\n\t\t\t}\n\t\t}\n\t\t$model->PRF_LANG = $_GET['lang'];\n\n\t\tYii::app()->session[$this->createBackup] = $model;\n\t\tif (isset($_GET['id'])){\n\t\t\t$this->redirect(array($action, 'id'=>$_GET['id']));\n\t\t} else {\n\t\t\t$this->redirect(array($action));\n\t\t}\n\t}", "public function update(Request $request, $id)\n {\n $this->_MODEL = \\App\\Models\\Language::find($id); \n return $this->_StoreItem($request); \n }", "public function update(Request $request) {\n try {\n\n if($request->user()->admin == false) {\n return response()->json([\n 'status_code' => 200,\n 'message' => 'Unauthorized'\n ]);\n }\n $language = Language::where('id', $request->id)->first();\n $language->name = $request->name != null ? json_decode($request->name) : $language->name;\n $language->image = $request->image != null ? $request->image : $language->image;\n $language->visible = $request->visible != null ? $request->visible : $language->visible;\n $language->save();\n return response()->json([\n 'status_code' => 200,\n 'message' => 'Language updated succesfully'\n ]);\n } catch(Exception $error) {\n return reponse()->json([\n 'status_code' => 500,\n 'message' => 'Couldn\\'t retrieve lessons'\n ]);\n }\n }", "private function setLanguage()\n\t{\n\t\tif (isset($_GET['language']))\n\t\t\t$id_lang = (int)($_GET['language'])>0 ? $_GET['language'] : 0;\n\t\tif (!isset($id_lang))\n\t\t\t$id_lang = ($this->getIdByHAL());\n\t\t$this->lang = $this->xml_file->lang[(int)($id_lang)];\n\t}", "public function update(LanguageRequest $request)\n {\n $languageValueObj = $this->getDataForValueObj($request, 'edit');\n $routePrevious = url()->previous();\n\n try {\n $language = $this->service->update($languageValueObj);\n } catch(\\DomainException $e) {\n report($e);\n\n return redirect()->to($routePrevious)->withInput()->with(['error' => $e->getMessage()]);\n }\n\n return redirect()->to($routePrevious)\n ->with('notifications', ['type' => 'success', 'message' => 'The language data and translations have been saved']);\n }", "public function actionChangeLanguage()\n {\n $lang = Yii::$app->request->post('lang');\n\n $session = Yii::$app->session;\n $session->set('language', $lang ?? 'en');\n\n $query = Language::findOne(['code' => $lang]);\n\n if ($query) {\n Yii::$app->user->identity->language_id = $query->code;\n Yii::$app->user->identity->save();\n }\n\n return $this->redirect(Yii::$app->request->referrer ?: Yii::$app->homeUrl);\n }", "public function update(Request $request, $id)\n {\n $language = $this->languageModel::findOrFail($id);\n $request->flash();\n $this->_validateUpdate($request);\n\n DB::beginTransaction();\n try {\n\n $language->locale = $request->locale;\n $language->name_display = $request->name_display;\n $language->icon = $request->icon;\n $language->description = $request->description;\n $language->status = $request->status;\n\n $language->save();\n DB::commit();\n return redirect()->route('languages.index')->with('languages', 'success');\n } catch (Exception $e) {\n DB::rollback();\n }\n }", "function language() {\n\t// Flip the language and go back\n\tCakeLog::write('debug', 'language: ' . print_r($this->request->named, true));\n\t$language = $this->request->named['new_language'];\n\n\tif (!empty($language)) {\n\t $referer = Router::normalize($this->referer(null, true));\n\t $urlRoute = Router::parse($referer);\n\t $urlRoute['language'] = $language;\n\t $urlRoute['url'] = array();\n\t $this->log(Router::reverse($urlRoute));\n\t $url = Router::normalize(Router::reverse($urlRoute));\n\t $this->params['language'] = $language;\n\t $this->redirect($url);\n\t} else {\n\t $this->redirect($this->referer());\n\t}\n }", "function update_translations()\n\t{\n\t\t$this->load->library('translator');\n\t\t\n\t\t//application language folder\n\t\t$language_folder=APPPATH.'language/';\n\t\t\n\t\t//template language \n\t\t$language='base';\n\t\t\n\t\t//path to the language folder\n\t\t$language_path=$language_folder.$language;\n\t\t\n\t\t//get a list of all translation files for the given language \n\t\t$files=$this->translator->get_language_files_array($language_path);\n\t\t\n\t\t//will be updated with additons from the BASE language file\n\t\t$target_language=$this->config->item(\"language\");\n\t\t\n\t\tif (!$target_language)\n\t\t{\n\t\t\techo \"language $target_language was not found\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tforeach($files as $file)\n\t\t{\n\t\t\t$target_filepath=$language_folder.'/'.$target_language.'/'.$file;\n\n\t\t\t//merge source and target language file to fill in missing translations for the target language\n\t\t\t$data['translations']=$this->translator->merge_language_keys($language_path.'/'.$file,$target_filepath);\n\t\t\t$data['language_name']=$target_language;\n\t\t\t$data['translation_file']=$file;\n\t\t\t\n\t\t\t//target language file content\n\t\t\t$content='<?php '.\"\\n\\n\".$this->load->view('translator/save',$data,TRUE);\n\t\t\t\n\t\t\t//update the target language file\n\t\t\t$save_result=@file_put_contents($target_filepath,$content);\n\t\t\t\n\t\t\tif($save_result)\n\t\t\t{\n\t\t\t\techo \"Language file updated: \" . $target_filepath.'<br />';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<div style='color:red;'>Language file update failed: \" . $target_filepath.'</div>';\n\t\t\t}\n\t\t}\t\t\n\t}", "public function update(LanguageRequest $request, $id)\n {\n $record = Language::where(\"id\", $id)->first();\n $record->name=$request->name;\n $record->is_valid=$request->is_valid;\n $record->icon=$request->icon;\n $record->slag=$request->slag;\n \n // Create and redirect\n $record->save();\n $request->session()->flash('message', 'Η γλώσσα αποθηκεύτηκε επιτυχώς!');\n return redirect('/language');\n }", "public function update(Request $request, $id)\n {\n $input_all = $request->all();\n $validator = Validator::make($request->all(), [\n 'languages_name' => 'required',\n ]);\n if (!$validator->fails()) {\n \\DB::beginTransaction();\n try {\n $Language = Language::find($id);\n foreach ($input_all as $key => $val) {\n $Language->{$key} = $val;\n }\n if (!isset($input_all['languages_status'])) {\n $Language->languages_status = 0;\n }\n if (!isset($input_all['languages_type'])) {\n if ($Language->languages_type == 1) {\n $Language->languages_type = 1;\n $Language->languages_status = 1;\n } else{\n $Language->languages_type = 0;\n }\n } \n else {\n Language::where('languages_type', 1)->update(['languages_type' => 0]);\n }\n $Language->save();\n \\DB::commit();\n $return['status'] = 1;\n $return['content'] = 'Success';\n } catch (Exception $e) {\n \\DB::rollBack();\n $return['status'] = 0;\n $return['content'] = 'Unsuccess';\n }\n } else {\n $failedRules = $validator->failed();\n $return['content'] = 'Unsuccess';\n if (isset($failedRules['languages_name']['required'])) {\n $return['status'] = 2;\n $return['title'] = \"Language is required\";\n }\n }\n $return['title'] = 'Update';\n return $return;\n }", "public function update(Request $request, $id)\n {\n \t$Language = LanguageSettings::find( $id );\n \t$Language->name = $request->name;\n \t$Language->code = $request->code;\n \t$Language->direction = $request->direction;\n \t$Language->icon = $request->icon;\n \t$Language->directory = $request->directory;\n \t$Language->default = $request->default;\n \t$Language->update();\n\n \treturn redirect()->action( 'LanguageSettingsController@index' );\n }", "public function update(Request $request, $id)\n {\n $language = userLanguage::find($id);\n $language->user_id = Auth::user()->id;\n $language->language_id = $request->language_id;\n $language->level = $request->level_id;\n $language->save();\n $language[\"lang\"] = language::where('id',$language->language_id)->first();\n return response::json($language);\n }", "public function execute()\n\t{\n\t\t$iso = $this->getLanguage()->getISO();\n\t\t$_SERVER['REQUEST_URI'] = preg_replace(\"/_lang=[a-z]{2}/\", \"_lang=\".$iso , urldecode($_SERVER['REQUEST_URI']));\n\t\t$_REQUEST['_lang'] = $iso;\n\t\tGDO_Session::set('gdo-language', $iso);\n\t\tTrans::setISO($iso);\n\t\t\n\t\t# Build response\n\t\t$response = GDT_Success::responseWith('msg_language_set', [$this->getLanguage()->displayName()]);\n\t\t\n\t\t# Redirect if 'ref' is set\n\t\tif ($url = $this->gdoParameterVar('ref'))\n\t\t{\n\t\t\t$url = preg_replace(\"/_lang=[a-z]{2}/\", \"_lang=\".$iso , $url);\n\t\t\t$response->addField(Website::redirect($url));\n\t\t}\n\n\t\treturn $response;\n\t}", "public function actionLanguage()\n\t{\n\t\t$model = CoreSettings::findOne(1);\n if ($model === null) {\n $model = new CoreSettings();\n }\n\t\t$model->scenario = CoreSettings::SCENARIO_LANGUAGE;\n\n if (Yii::$app->request->isPost) {\n $model->load(Yii::$app->request->post());\n // $postData = Yii::$app->request->post();\n // $model->load($postData);\n // $model->order = $postData['order'] ? $postData['order'] : 0;\n\n if ($model->save()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Language setting success updated.'));\n return $this->redirect(['language']);\n\n } else {\n if (Yii::$app->request->isAjax) {\n return \\yii\\helpers\\Json::encode(\\app\\components\\widgets\\ActiveForm::validate($model));\n }\n }\n }\n\n\t\t$this->subMenu = $this->module->params['language_submenu'];\n\t\t$this->view->title = Yii::t('app', 'Language Settings');\n\t\t$this->view->description = Yii::t('app', 'The layout of your {app-name} platform includes hundreds of apps of text which are stored in a language pack. {app-name} platform comes with an English pack which is the default when you first install the platform. If you want to change any of these apps on your {app-name} platform, you can edit the pack below. If you want to allow users to pick from multiple languages, you can also create additional packs below. If you have multiple language packs, the pack you\\'ve selected as your \"default\" will be the language that displays if a user has not selected any other language. Note: You can not delete the default language. To edit a language\\'s details, click its name.', ['app-name' => Yii::$app->name]);\n\t\t$this->view->keywords = '';\n\t\treturn $this->render('admin_language', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function languagesChange(Request $request)\n {\n\n if (env('DEMO_MODE') === \"YES\") {\n Alert::warning('warning', 'This is demo purpose only');\n return back();\n }\n\n try {\n session(['locale' => $request->code]);\n Artisan::call('optimize:clear');\n notify()->success(translate('Changed'));\n return back();\n } catch (\\Throwable $th) {\n Alert::error(translate('Whoops'), translate('Something went wrong'));\n return back();\n }\n \n }", "public function updateLanguage($id){\n\t\tif(htmlentities($id)){\n\t\t\tif(Auth::check()){\n\t\t\t\t$user=Auth::user();\n\t\t\t\tif($user->id==htmlentities($id)){\n\t\t\t\t\t$user->language = $user->language+1;\n\t\t\t\t\tif($user->language > 1){\n\t\t\t\t\t\t$user->language = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif ($user->language == 0){\n\t\t\t\t\t\tsession(['locale'=> \"fr\"]);\n\t\t\t\t\t}else if ($user->language == 1){\n\t\t\t\t\t\tsession(['locale'=> \"en\"]);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsession(['locale'=> \"en\"]);\n\t\t\t\t\t}\n\t\t\t\t\t$user->save();\n\t\t\t\t\treturn back()->with('success','Enjoy your new language.');\n\n\t\t\t\t}else{\n\t\t\t\t\treturn redirect('/home')->with('error','You are not allowed to edit other users\\' profiles.');\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn redirect('/login')->with('error','Please log in to perform this action.');\n\t\t\t}\n\n\t\t}else{\n\t\t\treturn redirect('/dashboard')->with('error','An error occured while updating your settings. Please try again');\n\t\t}\n\t}", "public function update(Request $request, $id) {\n try {\n $languages = Languages::find($id);\n $languages->name = $request->input('name');\n $languages->country_id = $request->input('country');\n $languages->name_in_language = $request->input('name_in_language');\n $languages->code = strtolower($request->input('code'));\n $languages->status = $request->input('status') != \"\" ? $request->input('status') : 0;\n\n if ($languages->save()) {\n //Redirect success\n return redirect()->route('languages')->with('success', 'Languages updated successfully.');\n }\n\n //Redirect error\n return redirect()->route('languages')->with('error', 'Failed to update languages.');\n\n } catch (Exception $e) {\n Log::error(\"Failed to update languages.\");\n }\n }", "public function update(Request $request, language $language)\n {\n language::where('id', $language->id)\n ->update([\n 'language' => $request->language,\n 'progress' => $request->progress\n ]);\n return redirect('/admin')->with('status', 'Edit data berhasil!');\n }", "public function updateLanguage(array $data, Language $language)\n {\n if(Auth::user()->id == $language->user_id){\n $collection = [\n 'reading_language_id'=>$data['reading_language'], \n 'writing_language_id'=>$data['writing_language'], \n 'speak_language_id'=>$data['speak_language'], \n 'description'=>$data['language'],\n ]; \n return $language->update($collection); \n }\n return exit('oops something went wrong !'); \n }", "public function update(Request $request, $id)\n {\n //echo\"<pre>\";print_r($request->all());die;\n $rules = [\n 'title' => 'required'\n ];\n\n $input = $request->all();\n $validator = Validator::make($input, $rules);\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();\n }else{\n $languages = new Languages();\n $languages = $languages->getLanguageById($id);\n if(!$languages){\n return redirect()->back()->with('error', 'This language does not exist');\n }\n\n $inputArr = $request->except(['_token', 'language_id', '_method']);\n $hasUpdated = $languages->updateLanguage($id, $inputArr);\n\n if($hasUpdated){\n return redirect()->route('languages.index')->with('success', 'Language type updated successfully.');\n }\n return redirect()->back()->with('error', 'Unable to update language. Please try again later.');\n }\n }", "public function updateLanguage(UserRequest $request)\n {\n $currentUserId = auth()->id();\n $data = $request->only(['language']);\n\n $changLanguage = $this->userService->updateUser($currentUserId, $data);\n\n if ($changLanguage) {\n $keyLanguage = array_search(\n $data['language'],\n config('user.language')\n );\n app()->setLocale($keyLanguage);\n\n return back()->with('success', __('user.language.success'));\n }\n\n return back()->with('error', __('user.error'));\n }", "public function update(Requests\\EditLanguageRequest $request, $id)\n {\n $input = $request->all();\n // Checkboxes:\n $request->has('active') ? $input['active'] = 1 : $input['active'] = 0;\n \n Language::findOrFail($id)->update($input);\n \n return redirect(url('languages', $input['id']))\n ->with([\n 'alert' => trans('alerts.langedited'),\n 'alert_class' => 'alert alert-success'\n ]);\n }", "public function update($id, UpdateLanguageRequest $request)\n\t{\n\t\t$language = Language::findOrFail($id);\n\n \n\n\t\t$language->update($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.language.index');\n\t}", "public function update(UpdateLanguagesRequest $request, $id)\n {\n if (! Gate::allows('language_edit')) {\n return abort(401);\n }\n $language = Language::findOrFail($id);\n $language->update($request->all());\n\n\n\n return redirect()->route('admin.languages.index');\n }", "public function settingLanguage() {}", "public function update(){\n foreach (the()->project->languages as $lang){\n $field=\"url_$lang\";\n if($this->urlExists($this->$field,$lang)){\n $increment=1;\n $url=$this->$field.'-'.$increment;\n while($this->urlExists($url,$lang)){\n $increment++;\n $url=$this->$field.'-'.$increment;\n }\n $this->$field=$url;\n }\n $this->$field=strtolower($this->$field);\n $this->$field=pov()->utils->string->clean($this->$field,\"/\");\n }\n\n\n parent::update();\n\n }", "public function save_translation($lang)\n {\n\n if ($this->session->userdata(array('admin' => 'is_admin'))) {\n if (!$this->Madmin->change_language_translation($lang, $_POST['key'], $_POST['val'])) {\n json(array('error' => 'Unable to update language status'));\n } else {\n json(array('success' => 'Language status changed'));\n }\n } else {\n json(array('error' => 'Please login first!'));\n }\n }", "public function changeLang(Request $request) \n {\n// Process and prepare you data as you like.\n\n $this->lang = '';\n $this->file = 'shop';\n $this->key = 'productGroup';\n $this->value = 'whatever';\n\n// END - Process and prepare your data\n\n $this->changeLangFileContent();\n //$this->deleteLangFileContent();\n\n return view('admin/index'); \n }", "public function setYiiLang(){\r\n $get_lang = Yii::app()->getRequest()->getParam(Yii::app()->urlManager->languageParam);//check if we have lang in url\r\n if (!in_array($get_lang,array_keys(Yii::app()->params['translatedLanguages'])) &&\r\n isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\r\n $langList = Util::sortByPriority($_SERVER['HTTP_ACCEPT_LANGUAGE']);\r\n foreach ($langList as $lang => $quality) {\r\n foreach (Defaults::$supportedLanguages as $supported) {\r\n if (strcasecmp($supported, $lang) == 0) {\r\n Yii::app()->language = $supported;\r\n break 2;\r\n }\r\n }\r\n }\r\n }\r\n }", "public function update(Request $request, $id)\n {\n //\n $Languages=Languages::get();\n foreach ($Languages as $key => $item) {\n if($key==0){\n $data=$this->updateDatMain($request,$item->code,$id);\n }\n $this->updateDataLanguage($request,$item->code,$data,$id);\n // code...\n }\n return redirect()->route('offices.index')\n ->with('success','Office updated successfully');\n\n }", "public function update(LanguageRequest $request, $id)\n {\n $updateLanguage = $request->all();\n $language = Language::findOrFail($id);\n $language->update($updateLanguage);\n\n return redirect(route('admin.language.index'))->with(_sessionmessage());\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n foreach ($_POST['language'] as $key => $value) {\n \n $message = new Message();\n $message->id = $model->id;\n $message->language = trim($key);\n $message->translation = trim($value);\n $message->save(false);\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "function list_translation_updates()\n {\n }", "public function update(UpdateRequest $request, $id)\n {\n $access = Auth::user()->isAbleTo('update-general');\n if (!$access) {\n abort(403);\n }\n $ajax = $request->ajax();\n $request = (object)$request->validated();\n if (!property_exists($request, 'orderBy')) {\n $orderBy = '';\n } else {\n $orderBy = $request->orderBy;\n }\n if (!property_exists($request, 'orderDir')) {\n $orderDir = '';\n } else {\n $orderDir = $request->orderDir;\n }\n\n $id = (int)$id;\n $language = Language::find($id);\n // $language = Language::find(245);\n if ($language) {\n (new GroupRepo)->post($language, $request);\n }\n $getItems = Item::class(new Language)\n ->orderBy($orderBy)\n ->orderDir($orderDir)\n ->get();\n $languagesJSON = $getItems['itemsJSON'];\n $languages = Language::All();\n if (!$language) {\n return response()->json($languagesJSON, 404);\n }\n if ($ajax) {\n return response()->json($languagesJSON);\n }\n }", "public function ChangeEditLanguage()\n {\n $editLanguageIso = $this->getInputFilterUtil()->getFilteredGetInput('editLanguageIsoCode');\n if (null === $editLanguageIso) {\n return;\n }\n /** @var BackendSessionInterface $backendSession */\n $backendSession = ServiceLocator::get('chameleon_system_cms_backend.backend_session');\n $backendSession->setCurrentEditLanguageIso6391($editLanguageIso);\n\n // we need to redirect to the current page to ensure the change from taking hold\n // now call page again... but without module_fnc\n $authenticityTokenId = AuthenticityTokenManagerInterface::TOKEN_ID;\n $parameterList = $this->global->GetUserData(null, [\n 'module_fnc',\n 'editLanguageID',\n '_noModuleFunction',\n '_fnc',\n $authenticityTokenId,\n ]);\n $url = PATH_CMS_CONTROLLER.$this->getUrlUtil()->getArrayAsUrl($parameterList, '?', '&');\n $this->getRedirect()->redirect($url);\n }", "public function update(User $user, Language $language)\n {\n //\n }", "function changeLang($i) //show and change the language for user\n{\n global $message_id;\n global $user_id;\n global $text;\n global $db;\n global $locale;\n if ($i == 0)\n {\n\n mysqli_query($db, \"UPDATE padporsc_bot4.users SET current_level = 'watching_change_language' WHERE user_id = {$user_id}\");\n\n if ($locale == \"farsi\")\n makeCurl(\"editMessageText\", [\"chat_id\" => $user_id, \"message_id\" => $message_id, \"text\" => \"انتخاب کن.\", \"reply_markup\" => json_encode([\n \"inline_keyboard\" =>[\n [\n [\"text\" => \"فارسی\", \"callback_data\" => \"chang3_T0_p3Rs1an\"], [\"text\" => \"انگلیسی\", \"callback_data\" => \"chang3_T0_3nGl1sH\"]\n ],\n [\n [\"text\" => \" بازگشت\", \"callback_data\" => \"R3tuRn\"]\n ]\n ]\n ])]);\n elseif ($locale == \"english\")\n makeCurl(\"editMessageText\", [\"chat_id\" => $user_id, \"message_id\" => $message_id, \"text\" => \"Choose\", \"reply_markup\" => json_encode([\n \"inline_keyboard\" =>[\n [\n [\"text\" => \"Farsi\", \"callback_data\" => \"chang3_T0_p3Rs1an\"], [\"text\" => \"English\", \"callback_data\" => \"chang3_T0_3nGl1sH\"]\n ],\n [\n [\"text\" => \"Return\", \"callback_data\" => \"R3tuRn\"]\n ]\n ]\n ])]);\n }\n elseif ($i == 1)\n {\n\n $result = mysqli_query($db, \"SELECT * FROM padporsc_bot4.users WHERE user_id = {$user_id}\");\n $row = mysqli_fetch_array($result);\n\n if($row['question_string'] == \"111111\")\n $b = 1;\n else\n $b = 0;\n if ($text == \"R3tuRn\")\n userMenu(1, $b);\n elseif ($text == \"chang3_T0_p3Rs1an\")\n {\n $locale = \"farsi\";\n\n mysqli_query($db, \"UPDATE padporsc_bot4.users SET locale = 'farsi' WHERE user_id = {$user_id}\");\n\n userMenu(1, $b);\n }\n elseif ($text == \"chang3_T0_3nGl1sH\")\n {\n $locale = \"english\";\n\n mysqli_query($db, \"UPDATE padporsc_bot4.users SET locale = 'english' WHERE user_id = {$user_id}\");\n\n userMenu(1, $b);\n }\n }\n\n}", "public function update_rtl_status(Request $request)\n {\n foreach($request->language_status as $lang_id){\n $language = Language::findOrFail($lang_id);\n if (!empty($request->status) && array_key_exists($lang_id, $request->status)){\n $language->rtl = 1;\n }else{\n $language->rtl = 0;\n }\n $language->save();\n }\n return back()->with('success', translate('RTL status updated successfully'));\n\n }", "public function edit_language($lang = 'en_GB', $page = 1)\n {\n\n if ($this->session->userdata(array('admin' => 'is_admin'))) {\n $this->load_header();\n $extension = ($lang == 'en_GB') ? 'pot' : 'po';\n $language = APP_PATH . DS . 'localization' . DS . $lang . DS . 'LC_MESSAGES' . DS . 'message.' . $extension;\n\n if (!file_exists($language)) {\n\n $this->vars['error'] = 'Language not found.';\n } else {\n\n $translations = Translations::fromPoFile($language);\n //var_dump($translations);\n\n //pre($translations);\n\n }\n $this->load->view('admincp' . DS . 'language_manager' . DS . 'view.edit_language', $this->vars);\n $this->load_footer();\n } else {\n json(array('error' => 'Please login first!'));\n }\n }", "public function update(Request $request, $id)\n {\n\n $this->validate($request, [\n 'name' => 'required|max:50|' . Rule::unique('languages')->ignore($id)->whereNull('deleted_at'),\n 'default_currency_id' => 'required'\n ], [\n 'default_currency_id.required' => 'The default currency field is required.',\n ]);\n\n $languages = Language::find($id);\n $languages->update($request->all());\n\n return redirect()->route('languages.index')->with('updated_success', translate('Language updated successfully'));\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n $model_msg = SourceLangMessage::findOne(['category' => 'backend_'.$model::tableName().'_title','owner_id' => $id]);\r\n\r\n if (is_null($model_msg))\r\n $model_msg = new SourceLangMessage();\r\n\r\n $langs = Languages::find()->where(['is', 'is_default', NULL])->andWhere(['active' => 1])->all();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n $this->save_translate($model, $model_msg);\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n 'model_msg' => $model_msg,\r\n 'langs' => $langs\r\n ]);\r\n }\r\n }", "public function update(Language $language, LanguageRequest $request)\n {\n return $this->saveFlashRedirect($language, $request, $this->imageColumn);\n }", "public function languages_status_change(Request $request) {\n\n try {\n\n DB::beginTransaction();\n \n $language_details = Language::find($request->language_id);\n\n if(!$language_details) {\n \n throw new Exception(tr('admin_language_not_found'), 101);\n }\n\n $language_details->status = $language_details->status == APPROVED ? DECLINED : APPROVED ;\n \n $message = $language_details->status == APPROVED ? tr('admin_language_activate_success') : tr('admin_language_deactivate_success');\n\n if( $language_details->save() ) {\n\n DB::commit();\n\n return back()->with('flash_success',$message);\n } \n\n throw new Exception(tr('admin_language_status_error'), 101);\n \n } catch( Exception $e) {\n\n DB::rollback();\n \n $error = $e->getMessage();\n\n return redirect()->route('admin.languages.index')->with('flash_error',$error);\n }\n }", "public function actionLanguage() {\n $response=array();\n $model = new User();\n $model2 = new UserSearch();\n if(Yii::$app->getRequest()->method===\"POST\")\n {\n $data=Yii::$app->request->post();\n $language=$data[\"lang\"];\n if($language==1)\n {\n $language=1; //Chinese\n $returnmessage=$this->alertchinese(); \n }\n else\n {\n $language=0; //English\n $returnmessage=$this->alertenglish();\n }\n if(!empty($data[\"token\"]) && isset($data[\"lang\"]))\n {\n $getid=$model2->isExistBytoken($data[\"token\"]);\n if(!empty($getid))\n {\n $updatearr=array(\n 'lang' => ($data[\"lang\"]==1)?'1':'0', \n 'last_update_date' => date('Y-m-d g:i:s'),\n );\n $upd=User::updateAll($updatearr, 'id = '.$getid[\"id\"]); \n if ($upd===1)\n {\n $response['error']=false;\n $response['statuscode']=200;\n $response['msg']=\"Success\";\n } \n else \n {\n $response['error']=true;\n $response['statuscode']=202;\n $response['msg']=$returnmessage[$response['statuscode']];\n }\n }\n else\n {\n $response['error']=true;\n $response['statuscode']=410;\n $response['msg']=$returnmessage[$response['statuscode']];\n }\n }\n else\n {\n $response['error']=true;\n $response['statuscode']=412;\n $response['msg']=$returnmessage[$response['statuscode']];\n } \n }\n else\n {\n $response['error']=true;\n $response['statuscode']=512;\n $response['msg']=\"Invalid Request\";\n }\n echo json_encode($response); \n }", "public function incLocalLang() {}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $lang = new Language();\n $category = Categorylanguages::find()->with('language')->where(['category_id' => $id])->all();\n $lang->getNameLanguages($category);\n $id;\n $categories;\n foreach ($lang->languages as $value) {\n if($value['shortname'] == 'en') {\n $id = $value['id'];\n }\n }\n\n if(isset($_POST['Language'])) {\n $categories = $this->encode($_POST['Language']['names'], $lang->languages);\n }\n\n if ($model->load(Yii::$app->request->post())) {\n\n foreach ($categories as $cat) {\n if($cat->language_id == $id) {\n $model->name = $cat->name;\n $model->save();\n }\n }\n\n foreach ($categories as $cats) {\n $new = true;\n foreach ($category as $cat) {\n if($cats->language_id == $cat->language_id) {\n $cat->name = $cats->name;\n $cat->save();\n $new = false;\n }\n }\n if($new) {\n $cats->category_id = $model->id;\n $cats->save();\n }\n }\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'lang' => $lang,\n ]);\n }", "function wp_get_translation_updates()\n {\n }", "public function testUpdateLangStr() {\n\n foreach ($this->testCases['LanguageLabelString'] as $key => $testCase) {\n $langStr = new LanguageLabelString();\n $langStr->setLanguageLabelStringId($testCase['language_label_string_id']);\n $langStr->setLabelId($testCase['label_id']);\n $langStr->setLanguageId($testCase['language_id']);\n $langStr->setLanguageLabelString($testCase['language_label_string']);\n $langStr->setLanguageLabelStringStatus($testCase['language_label_string_status']);\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('updateLangStr')\n ->will($this->returnValue(TRUE));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->updateLangStr($langStr);\n $this->assertTrue($result);\n }\n }", "public function update(Request $request, $lang, $id)\n {\n $rules = [\n \"status\" => \"required\"\n ];\n\n $validator = Validator::make($request->all(), $rules);\n if($validator->fails()) {\n flashy()->error($validator->errors()->all()[0]);\n return back();\n }\n $input = $request->all();\n $date = Carbon::now()->addMonths(3);\n $input['last'] = $date ;\n $item = Product::find($id);\n $item->update($input);\n\n $user = $item->user_id;\n $name = $item->name;\n $notification['title'] = 'تم اضافة الاعلان بنجاح';\n $notification['body'] = \"تم اضافة اعلانك $name بنجاح\";\n $notification['id'] = $id;\n $notification['fcm_token'] = FcmToken::Where('user_id', $user)->pluck('fcm_token');\n $this->pushNotification($notification);\n\n App::setLocale($lang);\n flashy(__('dashboard.updated'));\n return redirect()->route($this->resource['route'].'.index', $lang);\n }", "private function initLangs()\n {\n $langs = $this->getLangs();\n if (!$langs) {\n return;\n }\n\n // If the lang is set in query parameters...\n if (array_key_exists(self::LANG_KEY, $this->query)) {\n // ... and it is valid -> change the current language.\n // Yes, we are violating semantics of GET request here, but the operation is idempotent.\n if (in_array($this->query[self::LANG_KEY], $langs)) {\n $this->currentLang = $this->query[self::LANG_KEY];\n setcookie(self::LANG_KEY, $this->currentLang);\n }\n\n // Remove the lang from query parameters and redirect to self...\n unset($this->query[self::LANG_KEY]);\n $url = $this->rawPath;\n if ($this->query) {\n $url .= '?' . http_build_query($this->query);\n }\n header(\"Location: $url\");\n exit;\n }\n\n if (array_key_exists(self::LANG_KEY, $_COOKIE) && in_array($_COOKIE[self::LANG_KEY], $langs)) {\n // If the lang is set in cookies ...\n $this->currentLang = $_COOKIE[self::LANG_KEY];\n } elseif (($httpLang = $this->getLangFromHTTP()) !== null) {\n // Try to get the language from Accept-Language HTTP header...\n $this->currentLang = $httpLang;\n } elseif (in_array('en', $langs)) {\n // English is prefered default...\n $this->currentLang = 'en';\n } else {\n // If everything fails, get first lang of the config...\n $this->currentLang = reset($langs);\n }\n }", "public function updateMLContent( &$dbObject , $language);", "public function __invoke(Request $request)\n {\n $input = $request->all();\n\n if (empty($input['lang']))\n {\n return response()->json(['status' => 402, 'error' => 'Lang Is Required'], 402);\n }\n\n $user = User::where('id', Auth::user()->id)->first();\n $user->lang = $input['lang'];\n $user->save();\n\n return response()->json(['status' => 200, 'message' => 'Language Has Been Updated Successfully To ' . $input['lang']], 200);\n }", "public function switchLangAction(Request $request) {\n $referer = $request->headers->get('referer');\n if (empty($referer) === true) {\n $referer = $this->generateUrl('homepage');\n }\n $old_lang = $request->getLocale();\n $new_lang = $request->query->get('lang', 'en'); \n if($old_lang != 'en' && $old_lang != 'ar'){\n $request->setLocale('en');\n $new_url = '/en/'; //handling special case for non-existing lang \n }else{\n $new_url = str_replace(\"/$old_lang/\", \"/$new_lang/\", $referer);\n $request->setLocale($new_lang);\n }\n return $this->redirect($new_url);\n }", "function pnLangLoad()\n{\n\t// See if a language update is required\n $newlang = pnVarCleanFromInput('newlang');\n if (!empty($newlang)) {\n $lang = $newlang;\n pnSessionSetVar('lang', $newlang);\n } else {\n $detectlang = pnConfigGetVar('language_detect');\n $defaultlang = pnConfigGetVar('language');\n\n switch ($detectlang) { \n case 1: // Detect Browser Language\n\t\t $cnvlanguage=cnvlanguagelist();\n $currentlang='';\n \t $langs = preg_split ('/[,;]/',$_SERVER['HTTP_ACCEPT_LANGUAGE']);\n \t foreach ($langs as $lang) {\n \t \t if (isset($cnvlanguage[$lang]) && file_exists('language/' . pnVarPrepForOS($cnvlanguage[$lang]) . '/global.php')) {\n \t \t $currentlang=$cnvlanguage[$lang];\n \t \t break;\n \t \t }\n \t }\n if ($currentlang=='')\n \t $currentlang=$defaultlang;\n \t \t break;\n default:\n $currentlang=$defaultlang; \n }\n $lang = pnSessionGetVar('lang');\n }\n \n // Load global language defines\n\t// these are deprecated and will be moved to the relevant modules\n\t// with .8x\n if (isset ($lang) && file_exists('language/' . pnVarPrepForOS($lang) . '/global.php')) {\n $currentlang = $lang;\n } else {\n $currentlang = pnConfigGetVar('language');\n pnSessionSetVar('lang', $currentlang);\n }\n\t$oscurrentlang = pnVarPrepForOS($currentlang);\n\tif (file_exists('language/' . $oscurrentlang . '/global.php')) {\n\t include 'language/' . $oscurrentlang . '/global.php';\n\t}\n\n\t// load the languge language file\n\tif (file_exists('language/languages.php')) {\n\t\tinclude 'language/languages.php';\n\t}\n\n\t// load the core language file\n\tif (file_exists('language/' . $oscurrentlang . '/core.php')) {\n\t\tinclude 'language/' . $oscurrentlang . '/core.php';\n\t}\n\n\t// V4B RNG\n\tif (file_exists('language/' . $oscurrentlang . '/v4blib.php')) {\n\t\tinclude 'language/' . $oscurrentlang . '/v4blib.php';\n\t}\n\t// V4B RNG\n\n\t// set the correct locale\n\t// note: windows has different requires for the setlocale funciton to other OS's\n\t// See: http://uk.php.net/setlocale\n\tif (stristr(getenv('OS'), 'windows')) {\n\t\t// for windows we either use the _LOCALEWIN define or the existing language code\n\t\tif (defined('_LOCALEWIN')) {\n\t\t\tsetlocale(LC_ALL, _LOCALEWIN);\n\t\t} else {\n\t\t\tsetlocale(LC_ALL, $currentlang);\n\t\t}\n\t} else {\n\t\t// for other OS's we use the _LOCALE define\n\t\tsetlocale(LC_ALL, _LOCALE);\n\t}\n}", "public function changeLanguage(Request $request)\n {\n if ($request) {\n $request->session()->put('locale', $request['locale']);\n return back();\n }\n }", "function addLanguage(){\n $currentLanguage=\"\";\n if(!empty($_GET)){\n $currentLanguage = $_GET[\"lang\"];\n return \"lang=\".$currentLanguage; \n }\n else {\n return \"lang=\".\"eng\"; \n }\n \n }", "public function update(Request $request, $id)\n {\n $languages = Language::all();\n $validate = [];\n foreach($languages as $language){\n $validate['name'.$language->abbreviation] = 'required';\n\n }\n\n $message = [];\n foreach($languages as $language){\n $message['name'.$language->abbreviation.'.required'] = 'จำเป็นต้องระบุชื่อในภาษา'.$language->name;\n\n }\n // validate the input\n $validation = Validator::make( $request->all(),$validate, $message\n );\n\n// redirect on validation error\n if ( $validation->fails() ) {\n // change below as required\n return \\Redirect::back()->withInput()->withErrors( $validation->messages() );\n }\n else {\n $category = NewsCategory::findOrFail($id);\n $category->save();\n\n $language = Language::all();\n foreach ($language as $language){\n $translation = NewsCategoryTranslation::where('news_category_id',$id)->where('local', $language->abbreviation)->first();\n $translation->name = $request['name'.$language->abbreviation];\n $translation->save();\n }\n return redirect()->route('news-categories.edit',$id)\n ->with('flash_message',\n 'แก้ไขประเภทข่าวสารเรียบร้อยแล้ว');\n\n\n\n\n }\n }", "public static function edit($id)\n {\n if(!$lang = Multilanguage::language()->find($id))\n return ERROR_404;\n\n if(isset($_POST['update_language']) && Html::form()->validate())\n {\n $status = Multilanguage::language()->where('id', '=', $id)->update(array(\n 'name' => $_POST['name'],\n 'code' => $_POST['code']\n ));\n\n if($status)\n Message::ok('Language updated successfully.');\n else\n Message::error('Error updating language, please try again.');\n }\n\n $form[] = array(\n 'fields' => array(\n 'name' => array(\n 'title' => 'Language Name <em>(Ex: Russian)</em>',\n 'type' => 'text',\n 'validate' => array('required'),\n 'default_value' => $lang->name\n ),\n 'code' => array(\n 'title' => '2 Letter Language Code <em>(Ex: ru)<em>',\n 'type' => 'text',\n 'validate' => array('required', 'min:2'),\n 'attributes' => array(\n 'maxlength' => 2\n ),\n 'default_value' => $lang->code\n ),\n 'update_language' => array(\n 'type' => 'submit',\n 'value' => 'Update Language'\n )\n )\n );\n\n return array(\n 'title' => 'Edit Language',\n 'content' => Html::form()->build($form)\n );\n }", "public function update(UpdateLanguagesRequest $request, $id)\n {\n $language = Language::findOrFail($id);\n $language->update($request->all());\n\n return redirect()->route('languages.index');\n }", "public static function change_translation( $lang_id, $multilingual = null ) {\n\n\t\tif ( $multilingual === 'en_US' || $multilingual === 'none' || empty( $multilingual ) ) {\n\t\t\t$_multilingual = '';\n\t\t} else {\n\t\t\t$_multilingual = '_' . $multilingual;\n\t\t}\n\n\t\t// Don't download file for \"en_US\"\n\t\tif ( $lang_id === 'en_US' ) {\n\n\t\t\t// empty panel -> data will be come from STD\n\t\t\t$panel_data = array(\n\t\t\t\t'lang-id' => $lang_id\n\t\t\t);\n\n\t\t\tupdate_option( publisher_translation()->option_panel_id . $_multilingual, $panel_data, ! empty( $_multilingual ) ? 'no' : 'yes' );\n\t\t\tpublisher_translation()->set_current_lang( $lang_id, $multilingual );\n\n\t\t\t$result = array(\n\t\t\t\t'status' => 'succeed',\n\t\t\t\t'msg' => sprintf( __( 'Theme translation changed to \"%s\"', 'publisher' ), __( 'English - US', 'publisher' ) ),\n\t\t\t\t'refresh' => true\n\t\t\t);\n\n\t\t\t// Add admin notice\n\t\t\tBetter_Framework()->admin_notices()->add_notice( array(\n\t\t\t\t'msg' => $result['msg'],\n\t\t\t\t'thumbnail' => publisher_translation()->notice_icon,\n\t\t\t\t'product' => 'theme:publisher',\n\t\t\t) );\n\n\t\t\treturn $result;\n\t\t}\n\n\t\t$languages = publisher_translation()->get_languages();\n\n\t\t/**\n\t\t * Fires before changing translation\n\t\t *\n\t\t * @param string $lang_id Selected translation id for change\n\t\t * @param array $translations All active translations list\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t */\n\t\tdo_action( 'publisher-theme-core/translation/change-translation/before', $lang_id, $languages );\n\n\t\t$translation = self::get_language_translation( $lang_id );\n\n\t\tif ( $translation['status'] === 'error' ) {\n\t\t\t$translation['refresh'] = false;\n\n\t\t\treturn $translation;\n\t\t}\n\n\t\t/**\n\t\t * Filter translation data\n\t\t *\n\t\t * @since 1.0.0\n\t\t */\n\t\t$data = apply_filters( 'publisher-theme-core/translation/change-translation/data', $translation['translation'] );\n\n\n\t\t// Validate translation file data\n\t\tif ( ! isset( $data['panel-id'] ) || empty( $data['panel-id'] ) || ! isset( $data['panel-data'] ) ) {\n\n\t\t\treturn array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'msg' => __( 'Translation file for selected language is not valid!', 'publisher' ),\n\t\t\t\t'refresh' => false\n\t\t\t);\n\n\t\t}\n\n\t\t// Validate translation panel id\n\t\tif ( $data['panel-id'] !== publisher_translation()->option_panel_id ) {\n\n\t\t\treturn array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'error_code' => 'invalid-translation',\n\t\t\t\t'msg' => sprintf( __( 'Translation file is not valid for \"%s\"', 'publisher' ), publisher_translation()->publisher ),\n\t\t\t\t'refresh' => false\n\t\t\t);\n\n\t\t}\n\n\t\t// Save translation and update current lang\n\t\tupdate_option( publisher_translation()->option_panel_id . $_multilingual, $data['panel-data'], ! empty( $_multilingual ) ? 'no' : 'yes' );\n\t\tpublisher_translation()->set_current_lang( $lang_id, $multilingual );\n\n\t\t$result = array(\n\t\t\t'status' => 'succeed',\n\t\t\t'msg' => sprintf( __( 'Theme translation changed to \"%s\"', 'publisher' ), $languages[ $lang_id ]['name'] ),\n\t\t\t'refresh' => true\n\t\t);\n\n\t\t// Add admin notice\n\t\tBetter_Framework()->admin_notices()->add_notice( array(\n\t\t\t'msg' => $result['msg'],\n\t\t\t'thumbnail' => publisher_translation()->notice_icon,\n\t\t\t'product' => 'theme:publisher',\n\t\t) );\n\n\t\treturn $result;\n\t}", "public function changeEnglishLanguage(){\n Session::forget('lang');\n return back();\n }", "function languages($args, &$request) {\n\t\t$this->validate();\n\t\t$this->setupTemplate(true);\n\n\t\t$site =& $request->getSite();\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$templateMgr->assign('localeNames', AppLocale::getAllLocales());\n\t\t$templateMgr->assign('primaryLocale', $site->getPrimaryLocale());\n\t\t$templateMgr->assign('supportedLocales', $site->getSupportedLocales());\n\t\t$localesComplete = array();\n\t\tforeach (AppLocale::getAllLocales() as $key => $name) {\n\t\t\t$localesComplete[$key] = AppLocale::isLocaleComplete($key);\n\t\t}\n\t\t$templateMgr->assign('localesComplete', $localesComplete);\n\n\t\t$templateMgr->assign('installedLocales', $site->getInstalledLocales());\n\t\t$templateMgr->assign('uninstalledLocales', array_diff(array_keys(AppLocale::getAllLocales()), $site->getInstalledLocales()));\n\t\t$templateMgr->assign('helpTopicId', 'site.siteManagement');\n\n\t\timport('classes.i18n.LanguageAction');\n\t\t$languageAction = new LanguageAction();\n\t\tif ($languageAction->isDownloadAvailable()) {\n\t\t\t$templateMgr->assign('downloadAvailable', true);\n\t\t\t$templateMgr->assign('downloadableLocales', $languageAction->getDownloadableLocales());\n\t\t}\n\n\t\t$templateMgr->display('admin/languages.tpl');\n\t}", "public function update($id, Createlanguage_keyRequest $request)\n\t{\n\t\t$languageKey = $this->languageKeyRepository->findlanguage_keyById($id);\n\n\t\tif(empty($languageKey))\n\t\t{\n\t\t\tFlash::error('language_key not found');\n\t\t\treturn redirect(route('languageKeys.index'));\n\t\t}\n\n\t\t$languageKey = $this->languageKeyRepository->update($languageKey, $request->all());\n\n\t\tFlash::message('language_key updated successfully.');\n\n\t\treturn redirect(route('languageKeys.index'));\n\t}", "public function appLanguageVersion() {\n // get version\n $this->loadModel('Versions');\n $version = $this->Versions->findAppLanguageVersion();\n\n // get language\n $this->loadModel('AppLanguages');\n $arrayLanguages = $this->AppLanguages->findAllLanguages();\n $this->set(compact(\"version\", \"arrayLanguages\"));\n }", "public function update($arr) {\n\t\tglobal $query, $wtcDB, $lang;\n\n\t\t$update = $wtcDB->massUpdate($arr);\n\n\t\t// Execute!\n\t\tnew Query($query['lang_words']['update'], Array(1 => $update, 2 => $this->wordid), 'query', false);\n\t\t\n\t\tLanguage::cache();\n\t}", "public function testUpdatingLanguage()\n {\n $manager = $this->getModelManager();\n\n // Get the first tutor\n $tutor = $manager->findById(1);\n\n // Set the Language on his first competency, to the START tag\n /** @var TutorLanguage $tutorLanguage */\n $tutorLanguage = $tutor->getTutorLanguages()->first();\n $tutorLanguage->getLanguage()->setName(TestSlug::START_1);\n\n $manager->saveEntity($tutor);\n $manager->reloadEntity($tutor);\n $this->assertEquals(TestSlug::START_1, $tutor->getTutorLanguages()->first()->getLanguage()->getName());\n\n $originalId = $tutor->getTutorLanguages()->first()->getLanguage()->getId();\n\n $this->performMockedUpdate($tutor, $tutorLanguage, 'tutor-language');\n\n $manager->reloadEntity($tutor);\n $this->assertEquals(TestSlug::END_1, $tutor->getTutorLanguages()->first()->getLanguage()->getName());\n\n // now change it back, but by ID\n $this->performMockedUpdate($tutor, $tutorLanguage, 'tutor-language', $originalId);\n\n $manager->saveEntity($tutor);\n $manager->reloadEntity($tutor);\n $this->assertEquals(TestSlug::START_1, $tutor->getTutorLanguages()->first()->getLanguage()->getName());\n }", "public function saveLanguage()\n\t{\n\t\t$language = Piwik_Common::getRequestVar('language');\n\t\t$currentUser = Piwik::getCurrentUserLogin();\n\t\t$session = new Zend_Session_Namespace(\"LanguagesManager\");\n\t\t$session->language = $language;\n\t\tif($currentUser !== 'anonymous')\n\t\t{\n\t\t\tPiwik_LanguagesManager_API::setLanguageForUser($currentUser, $language);\n\t\t}\n\t\tPiwik_Url::redirectToReferer();\n\t}", "public function update(Request $request, $id) {\n $basic_data = BasicData::find($id);\n if (!$basic_data) {\n return _json('error', _lang('app.error_is_occured'), 404);\n }\n $this->rules = array_merge($this->rules, $this->lang_rules(['title' => \"required\"]));\n $validator = Validator::make($request->all(), $this->rules);\n if ($validator->fails()) {\n $errors = $validator->errors()->toArray();\n return _json('error', $errors);\n }\n\n DB::beginTransaction();\n try {\n\n $basic_data->active = $request->input('active');\n $basic_data->this_order = $request->input('this_order');\n\n $basic_data->save();\n\n $basic_data_translations = array();\n\n BasicDataTranslation::where('basic_data_id', $basic_data->id)->delete();\n\n $basic_data_title = $request->input('title');\n\n foreach ($this->languages as $key => $value) {\n $basic_data_translations[] = array(\n 'locale' => $key,\n 'title' => $basic_data_title[$key],\n 'basic_data_id' => $basic_data->id\n );\n }\n BasicDataTranslation::insert($basic_data_translations);\n\n DB::commit();\n return _json('success', _lang('app.updated_successfully'));\n } catch (\\Exception $ex) {\n DB::rollback();\n return _json('error', $ex, 400);\n }\n }", "public function edit(language $language)\n {\n //\n }", "public function testIgnoredLanguageEntityUpdate(): void {\n $entity = Node::create([\n 'nid' => 1,\n 'type' => 'node',\n 'langcode' => 'l0',\n 'title' => 'Language 0 node',\n ]);\n $entity->save();\n $entity->addTranslation('l1')->set('title', 'Language 1 node')->save();\n\n $this->triggerPostRequestIndexing();\n $this->assertTrue(TRUE);\n }", "function ajax_addLanguage( $data )\n\t{\n\t\tglobal $_response;\n\n\t\t// check admin session expire\n\t\tif ( $this -> checkSessionExpire() === false )\n\t\t{\n\t\t\t$redirect_url = RL_URL_HOME . ADMIN .\"/index.php\";\n\t\t\t$redirect_url .= empty($_SERVER['QUERY_STRING']) ? '?session_expired' : '?'. $_SERVER['QUERY_STRING'] .'&session_expired';\n\t\t\t$_response -> redirect( $redirect_url );\n\t\t}\n\t\t\n\t\tloadUTF8functions('ascii', 'utf8_to_ascii', 'unicode');\n\t\t$lang_name = $lang_key = $this -> rlValid -> xSql( str_replace( array( '\"', \"'\" ), array( '', '' ), $data[0][1] ) );\n\t\t\n\t\tif ( empty($lang_name) )\n\t\t{\n\t\t\t$error[] = $GLOBALS['lang']['name_field_empty'];\n\t\t}\n\t\t\n\t\tif ( !utf8_is_ascii( $lang_name ) )\n\t\t{\n\t\t\t$lang_key = utf8_to_ascii( $lang_name );\n\t\t}\n\t\t\n\t\t$lang_key = strtolower( str_replace( array( '\"', \"'\" ), array( '', '' ), $lang_key ) );\n\t\t\n\t\t$iso_code = $this -> rlValid -> xSql( $data[1][1] );\n\t\t\n\t\tif ( !utf8_is_ascii( $iso_code ) )\n\t\t{\n\t\t\t$error = $GLOBALS['lang']['iso_code_incorrect_charset'];\n\t\t}\n\t\telse \n\t\t{\n\t\t\tif ( strlen( $iso_code )!= 2 )\n\t\t\t{\n\t\t\t\t$error[] = $GLOBALS['lang']['iso_code_incorrect_number'];\n\t\t\t}\n\t\t\t\n\t\t\t//check language exist\n\t\t\t$lang_exist = $this -> fetch( '*', array( 'Code' => $iso_code ), null, null, 'languages' );\n\n\t\t\tif ( !empty( $lang_exist ) )\n\t\t\t{\n\t\t\t\t$error[] = $GLOBALS['lang']['iso_code_incorrect_exist'];\n\t\t\t}\n\t\t}\n\n\t\t/* check direction */\n\t\t$direction = $data[4][1];\n\t\t\n\t\tif ( !in_array($direction, array('rtl', 'ltr')) )\n\t\t{\n\t\t\t$error[] = $GLOBALS['lang']['text_direction_fail'];\n\t\t}\n\t\t\n\t\t/* check date format */\n\t\t$date_format = $this -> rlValid -> xSql( $data[2][1] );\n\t\t\n\t\tif ( empty($date_format) || strlen($date_format) < 5 )\n\t\t{\n\t\t\t$error[] = $GLOBALS['lang']['language_incorrect_date_format'];\n\t\t}\n\t\t\n\t\tif ( !empty($error) )\n\t\t{\n\t\t\t/* print errors */\n\t\t\t$error_content = '<ul>';\n\t\t\tforeach ($error as $err)\n\t\t\t{\n\t\t\t\t$error_content .= \"<li>{$err}</li>\";\n\t\t\t}\n\t\t\t$error_content .= '</ul>';\n\t\t\t$_response -> script( 'printMessage(\"error\", \"'. $error_content .'\")' );\n\t\t}\n\t\telse \n\t\t{\n\t\t\t/* get & optimize new language phrases*/\n\t\t\t$source_code = $this -> rlValid -> xSql( $data[3][1] );\n\t\t\t$this -> setTable( 'lang_keys' );\n\t\t\t\n\t\t\t$source_phrases = $this -> fetch( '*', array( 'Code' => $source_code ) );\n\t\n\t\t\tif ( !empty($source_phrases) )\n\t\t\t{\n\t\t\t\t$step = 1;\n\t\t\t\t\n\t\t\t\tforeach ( $source_phrases as $item => $row )\n\t\t\t\t{\n\t\t\t\t\t$insert_phrases[$item] = $source_phrases[$item];\n\t\t\t\t\t$insert_phrases[$item]['Code'] = $iso_code;\n\t\t\t\t\n\t\t\t\t\tunset( $insert_phrases[$item]['ID'] );\n\t\t\t\t\t\t\n\t\t\t\t\tif ($step % 500 == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this -> rlActions -> insert( $insert_phrases, 'lang_keys' );\n\t\t\t\t\t\tunset($insert_phrases);\n\t\t\t\t\t\t$step = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$step++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( !empty($insert_phrases) )\n\t\t\t\t{\n\t\t\t\t\t$this -> rlActions -> insert( $insert_phrases, 'lang_keys' );\n\t\t\t\t}\n\t\n\t\t\t\t$additional_row = array(\n\t\t\t\t\t'Code' => $iso_code,\n\t\t\t\t\t'Module' => 'common',\n\t\t\t\t\t'Key' => 'languages+name+' . $lang_key,\n\t\t\t\t\t'Value' => $lang_name,\n\t\t\t\t\t'Status' => 'active'\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this -> rlActions -> insertOne( $additional_row, 'lang_keys' );\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$error[] = $GLOBALS['lang']['language_no_phrases'];\n\t\t\t}\n\t\t\t\n\t\t\tif ( !empty($error) )\n\t\t\t{\n\t\t\t\t/* print errors */\n\t\t\t\t$_response -> script(\"printMessage('error', '{$error}')\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$insert = array(\n\t\t\t\t\t'Code' => $iso_code,\n\t\t\t\t\t'Direction' => $direction,\n\t\t\t\t\t'Key' => $lang_key,\n\t\t\t\t\t'Status' => 'active',\n\t\t\t\t\t'Date_format' => $date_format\n\t\t\t\t);\n\t\t\t\t$this -> rlActions -> insertOne( $insert, 'languages' );\n\t\t\t\t\t\t\t\t\n\t\t\t\t/* print notice */\n\t\t\t\t$_response -> script(\"\n\t\t\t\t\tprintMessage('notice', '{$GLOBALS['lang']['language_added']}');\n\t\t\t\t\tshow('lang_add_container');\n\t\t\t\t\tlanguagesGrid.reload();\n\t\t\t\t\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t$_response -> script( \"$('#lang_add_load').fadeOut('slow');\" );\n\n\t\treturn $_response;\n\t}", "function languages()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['languages'] == 1 ) ? 'Language String' : 'Language Strings';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'created';\n\t\t\n\t\t$api = $this->ipsclass->load_class( IPS_API_PATH.'/api_language.php', 'api_language' );\n\t\t$api->path_to_ipb = ROOT_PATH;\n\t\t$api->api_init();\n\t\t\n\t\tforeach ( $this->xml_array['languages_group']['language'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$api->lang_add_strings( array( $v['key']['VALUE'] => $v['text']['VALUE'] ), $v['file']['VALUE'] );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach ( $this->ipsclass->cache['languages'] as $kk => $vv )\n\t\t\t\t{\n\t\t\t\t\t$lang = array();\n\t\t\t\t\trequire( CACHE_PATH.'cache/lang_cache/'.$vv['ldir'].'/'.$v['file']['VALUE'].'.php' );\n\t\t\t\t\t\n\t\t\t\t\tunset( $lang[ $v['key']['VALUE'] ] );\n\t\t\t\t\t\n\t\t\t\t\t$start = \"<?php\\n\\n\".'$lang = array('.\"\\n\";\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $lang as $kkk => $vvv )\n\t\t\t\t\t{\n\t\t\t\t\t\t$vvv = preg_replace( \"/\\n{1,}$/\", \"\", $vvv );\n\t\t\t\t\t\t$vvv \t= stripslashes( $vvv );\n\t\t\t\t\t\t$vvv\t= preg_replace( '/\"/', '\\\\\"', $vvv );\n\t\t\t\t\t\t$start .= \"\\n'\".$kkk.\"' => \\\"\".$vvv.\"\\\",\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$start .= \"\\n\\n);\\n\\n?\".\">\";\n\t\t\t\t\t\n\t\t\t\t\tif ( $fh = @fopen( CACHE_PATH.'cache/lang_cache/'.$vv['ldir'].'/'.$v['file']['VALUE'].'.php', 'w' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t@fwrite( $fh, $start );\n\t\t\t\t\t\t@fclose( $fh );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tunset( $lang, $start, $fh );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['languages']} {$object} {$operation}....\" );\n\t}", "protected static function setLanguageKeys() {}", "public static function updateAll() {\n\t\tself::deleteLanguageFiles();\n\t}", "public function wplt_ajax_response(){\n global $sitepress;\n $sitepress->switch_lang('all');\n }", "public function modifyLang($id, $atts=array()){\n\t\tstatic $rename;\n\t\t$dir = $dir = \"./application/language/\";\n\t\t$query = $this->db->get_where(\"languages\", array(\"id\" => $id));\n\t\t$lang = $query->row();\n\t\t$rename = rename($dir.\"site_$lang->code\", $dir.\"site_{$atts[\"code\"]}\");\n\t\tif($rename){\n\t\t\t$rename = rename($dir.\"site_{$atts[\"code\"]}/site_{$lang->code}_lang.php\", $dir.\"site_{$atts[\"code\"]}/site_{$atts[\"code\"]}_lang.php\");\n\t\t\tif($rename)\t{\n\t\t\t\t$this->db->where(\"lang\", $lang->code);\n\t\t\t\t$req = $this->db->update(\"langs_titles\", array(\n\t\t\t\t\t\"lang\" => $atts[\"code\"]\n\t\t\t\t));\n\t\t\t\tif($req){\n\t\t\t\t$this->db->where(\"id\", $id);\n\t\t\t\treturn $this->db->update(\"languages\", $atts);\t\t\n\t\t\t\t}else return false;\t\t\n\t\t\t}else return false;\n\t\t}else return false;\n\t}", "public function update($id, Request $request) {\n if($request->all()['language_id'] == '2'){\n session()->put('language', 'bg');\n }\n else{\n session()->put('language', 'en');\n }\n $this->model->updateUser($request->all());\n Controller::FlashMessages('The user has been updated', 'success');\n return redirect('/users');\n }", "public function update(Request $request, $slug)\n {\n $record = Language::where('slug', $slug)->get()->first();\n if($isValid = $this->isValidRecord($record))\n\t\t return redirect($isValid);\n\n $this->validate($request, [\n 'language' \t\t => 'bail|required|max:40|unique:languages,language,'.$record->id,\n 'code' \t\t => 'bail|required|max:20|unique:languages,code,'.$record->id,\n 'is_rtl' \t \t => 'bail|required'\n ]);\n $name \t\t\t\t\t = $request->language;\n \n /**\n * Check if the title of the record is changed, \n * if changed update the slug value based on the new title\n */\n if($name != $record->language)\n $record->slug = $record->makeSlug($name);\n\t\n \t $record->language \t\t\t = $name;\n $record->slug \t\t\t = $record->makeSlug($name);\n $record->code\t\t\t\t\t = $request->code;\n $record->is_rtl\t\t\t\t = $request->is_rtl;\n $record->save();\n LanguageHelper::flash('success','record_updated_successfully', 'success');\n return redirect(URL_LANGUAGES_LIST);\n }", "private function setLang(){\n\n\t\tif( isset($_GET['lang']) )\n\t\t\t$lang\t= $_GET['lang'];\n\n\t\telse{\n\t\t\t$sess_lang\t= session('lang');\n\t\t\t$lang\t\t= $sess_lang ? $sess_lang : App::getLocale();\n\t\t}\n\n\t\tsession(['lang'=>$lang]);\n\t\tApp::setLocale( $lang );\n\t}", "public function update($param, $value)\n {\n if (empty($param)) {\n return false;\n }\n $this->vars_lang[$param] = $value;\n $value = is_array($value) ? serialize($value) : (string) $value;\n\n $select = $this->queryFactory->newSelect();\n $select->from('__settings_lang')\n ->cols(['1'])\n ->where('param = :param')\n ->bindValue('param', $param)\n ->limit(1);\n \n $this->db->query($select);\n if (!$this->db->result()) {\n return $this->add($param, $value);\n } else {\n $delete = $this->queryFactory->newDelete();\n $delete->from('__settings_lang')\n ->where('param =:param')\n ->bindValue('param', $param);\n \n $insert = $this->queryFactory->newInsert();\n $insert->into('__settings_lang')\n ->cols([\n 'param' => $param,\n 'value' => $value,\n ]);\n\n if ($langId = $this->languages->getLangId()) {\n $delete->where('lang_id =:lang_id')\n ->bindValue('lang_id', $langId);\n $insert->cols(['lang_id' => $langId]);\n }\n\n $this->db->query($delete);\n $this->db->query($insert);\n \n return true;\n }\n }", "public function indexUpdate( $id )\n {\n \t$GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get();\n\n \t$LanguageToEdit = LanguageSettings::find( $id );\n\n \treturn view( \"backEnd.settings.languageAdd\", compact( \"GeneralWebmasterSections\", \"LanguageToEdit\" ) );\n }", "public function updateLangue($id,$name,$translate){\n\n global $conn;\n\n $update = \"UPDATE `langue` SET `name`='\".$name.\"',`translate`='\".$translate.\"' WHERE `id`=\".$id;\n $conn->query($update);\n }", "public function edit(Language $language)\n {\n //\n }", "public function update(Request $request)\n {\n $dataArr = $request->all();\n \n $content_id = $dataArr['id']; \n \n\n foreach($dataArr['content'] as $lang_id => $content ){ \n\n $modelLang = ContentLang::where(['id' => $content_id, 'lang_id' => $lang_id])->update(['content' => $content]);\n }\n \n Session::flash('message', 'Update success'); \n\n return redirect()->route('content.edit', $dataArr['id']);\n }", "public function update(Request $request, $id)\n {\n // return $request;\n // $request->validate([\n\n // 'locale=En' => 'required|string' ,\n // 'Privacy_Policy=En' => 'required|string' ,\n // 'Terms_And_Condition=En' => 'required|string' ,\n // 'Cancellation_Policy=En' => 'required' , \n // 'locale=Ar' => 'required|string' ,\n // 'Privacy_Policy=Ar' => 'required|string' ,\n // 'Terms_And_Condition=Ar' => 'required|string' ,\n // 'Cancellation_Policy=Ar' => 'required' , \n // ]) ;\n\n $languages = Localization::all();\n foreach ($languages as $language) {\n\n $policies = policies::where('locale', $request->get('locale='.$language->name))->first();\n\n $policies->locale = $request->get('locale='.$language->name);\n $policies->Privacy_Policy = $request->get('Privacy_Policy='.$language->name);\n $policies->Terms_And_Condition = $request->get('Terms_And_Condition='.$language->name);\n $policies->Cancellation_Policy = $request->get('Cancellation_Policy='.$language->name);\n $policies->save(); \n }\n\n return redirect()->back()->with('success','Policies Updated');\n }", "public function translate_store(Request $request)\n {\n\n if (env('DEMO_MODE') === \"YES\") {\n Alert::warning('warning', 'This is demo purpose only');\n return back();\n }\n\n try {\n $language = Language::findOrFail($request->id);\n\n //check the key have translate data\n $data = openJSONFile($language->code);\n foreach ($request->translations as $key => $value) {\n $data[$key] = $value;\n }\n\n //save the new keys translate data\n saveJSONFile($language->code, $data);\n\n notify()->success(translate('Translated'));\n \n return back();\n } catch (\\Throwable $th) {\n Alert::error(translate('Whoops'), translate('Something went wrong'));\nreturn back();\n }\n \n }", "function saveTranslations()\n {\n // default language set?\n if (!isset($_POST[\"default\"]))\n {\n ilUtil::sendFailure($this->lng->txt(\"msg_no_default_language\"));\n return $this->editTranslations(true);\n }\n\n // all languages set?\n if (array_key_exists(\"\",$_POST[\"lang\"]))\n {\n ilUtil::sendFailure($this->lng->txt(\"msg_no_language_selected\"));\n return $this->editTranslations(true);\n }\n\n // no single language is selected more than once?\n if (count(array_unique($_POST[\"lang\"])) < count($_POST[\"lang\"]))\n {\n ilUtil::sendFailure($this->lng->txt(\"msg_multi_language_selected\"));\n return $this->editTranslations(true);\n }\n\n // save the stuff\n $this->ilObjectOrgUnit->removeTranslations();\n foreach($_POST[\"title\"] as $k => $v)\n {\n // update object data if default\n $is_default = ($_POST[\"default\"] == $k);\n if($is_default)\n {\n $this->ilObjectOrgUnit->setTitle(ilUtil::stripSlashes($v));\n $this->ilObjectOrgUnit->setDescription(ilUtil::stripSlashes($_POST[\"desc\"][$k]));\n $this->ilObjectOrgUnit->update();\n }\n\n $this->ilObjectOrgUnit->addTranslation(\n ilUtil::stripSlashes($v),\n ilUtil::stripSlashes($_POST[\"desc\"][$k]),\n ilUtil::stripSlashes($_POST[\"lang\"][$k]),\n $is_default);\n }\n\n ilUtil::sendSuccess($this->lng->txt(\"msg_obj_modified\"), true);\n $this->ctrl->redirect($this, \"editTranslations\");\n }", "public function action_web_language() {\n $package = Model::factory('package');\n $errors = array();\n $postvalue = $this->request->post();\n $action = $this->request->action();\n if(isset($postvalue['dynamic_lang']) && $postvalue['dynamic_lang']!=\"\"){\n $dynamic_lang = $postvalue['dynamic_lang'];\n }\n $language_setting_array = WEB_DB_LANGUAGE;\n if (isset($postvalue['web_lang_radio']) && $postvalue['web_lang_radio'] == 2 && Validation::factory(array_merge($_FILES,$postvalue))) {\n $validator = $package->validate_web_language(array_merge($_FILES,$postvalue));\n if ($validator->check()) {\n $get_site_info=$package->get_site_info();\n $domain_name=$get_site_info[0]['domain_name'];\n if (!empty($_FILES['web_language_file']['name'])) {\n $image_type = explode('.', $_FILES['web_language_file']['name']);\n $image_type = end($image_type);\n $image_name = $dynamic_lang.'_customize.' . $image_type;\n $fileName = $dynamic_lang.'_customize.xml';\n \n $target_path=CUSTOMLANGPATH.'i18n/';\n if (!is_dir($target_path) ) {\n Message::error(__('mentioned directory not availabe'));\n $this->request->redirect('/package/preferences');\n }\n \n $illegal_words = array('unlink', 'unset', 'exit;', 'break;');\n $file_handle = fopen($_FILES['web_language_file']['tmp_name'], \"r\");\n while (!feof($file_handle)) {\n $line_of_text = fgets($file_handle);\n if ($this->match($illegal_words, strtolower($line_of_text))) {\n Message::error(__('faile_upload_changes_made_info'));\n $this->request->redirect('/package/preferences');\n }\n }\n fclose($file_handle);\n \n \n\n /* if (file_exists($target_path . $image_name) && file_exists($target_path . $fileName)) {\n rename($target_path . $image_name, $target_path . 'en_customize.php');\n } elseif (file_exists($target_path . $image_name)) {\n rename($target_path . $image_name, $target_path . $fileName);\n }*/\n if (file_exists($target_path . $image_name)) {\n unlink($target_path . $image_name);\n }\n \n move_uploaded_file($_FILES['web_language_file']['tmp_name'], $target_path . $image_name);\n //rename($target_path . $image_name, $target_path . $fileName);\n chmod($target_path . $image_name, 0777);\n try {\n \n //print_r($target_path.$image_name); exit;\n //print_r($target_path.$image_name); exit;\n\t\t\t\t\t$fileContents = file_get_contents($target_path.$image_name); \n\t\t\t\t\t$fileContents=preg_replace('/[\\x00-\\x1f]/','',htmlspecialchars($fileContents));\t\t\t\t\t\n $xml_system = simplexml_load_string($fileContents) or die(\"Error: Cannot create object\");\n \n } catch (Exception $ex) {\n throw new Exception($ex);\n // Message::error(__('fail_upload_checkfile_error_info'));\n // $this->request->redirect('/package/preferences');\n }\n \n $child_array='';\n \n foreach ($xml_system->children()->string as $value) { \n $name=(string)$value['name']; \n $value_string=(string) ($value);\n $value_string=htmlentities($value_string);\n $value_string= str_replace('\"', \"'\", $value_string);\n $child_array.='\"'.$name.'\"'.'=>'.'\"'. $value_string.'\"'.',';\n } \n if (file_exists($target_path .$dynamic_lang.'.php')) {\n unlink($target_path.$dynamic_lang.'.php');\n }\n \n $string=\"<?php defined('SYSPATH') or die('No direct script access.');\"\n . \"return \";\n \n $fp = fopen($target_path.$dynamic_lang.'.php', 'w');\n chmod($target_path . $dynamic_lang.'.php', 0777);\n fwrite($fp, print_r($string, TRUE));\n fwrite($fp, print_r('['.$child_array.']', TRUE));\n fwrite($fp, print_r(';', TRUE));\n fclose($fp);\n \n $language_setting_array[$dynamic_lang] = 2;\n $data = array('website_language_settings', $language_setting_array);\n $status = $package->update_language_colorcode($data);\n Message::success(__('file_upload_succ_info'));\n $this->request->redirect('/package/preferences');\n } else {\n Message::error(__('fail_upload_error_info'));\n $this->request->redirect('/package/preferences');\n }\n } else {\n $errors = $validator->errors('errors');\n Message::error(__('file_upload_warning_info'));\n }\n } else {\n if (isset($postvalue['web_lang_radio']) && $postvalue['web_lang_radio'] == 1) {\n $validator = $package->validate_web_language($postvalue);\n if ($validator->check()) {\n $language_setting_array[$dynamic_lang] = 1;\n $data = array('website_language_settings', $language_setting_array);\n $status = $package->update_language_colorcode($data);\n Message::success(__('file_default_upload_succ_info'));\n $this->request->redirect('/package/preferences');\n } else {\n $errors = $validator->errors('errors');\n Message::error(__('fail_upload_default_info'));\n }\n } else {\n Message::error(__('fail_upload_default_info'));\n $this->request->redirect('/package/preferences');\n }\n }\n $this->template->meta_description = CLOUD_SITENAME . \" | Preferences \";\n $this->template->meta_keywords = CLOUD_SITENAME . \" | Preferences \";\n $this->template->title = CLOUD_SITENAME . \" | \" . __('Preferences');\n $this->template->page_title = __('Preferences');\n $this->template->content = View::factory(\"admin/package_plan/preferences\")->bind('action', $action)->bind('postvalue', $postvalue)->bind('errors', $errors);\n }", "function mutation($langString) {\n\tLang::get($langString);\n}", "public function add_language()\n {\n\n if ($this->session->userdata(array('admin' => 'is_admin'))) {\n $this->load_header();\n $this->vars['country_flags'] = $this->Madmin->load_country_images();\n if (isset ($_POST['add_language'])) {\n if ($_POST['name'] == '') {\n $this->vars['error'] = 'Please enter language name.';\n } else {\n if ($_POST['title'] == '') {\n $this->vars['error'] = 'Please enter language title.';\n } else {\n if ($this->Madmin->add_language($_POST)) {\n header('Location: ' . $this->config->base_url . 'admincp/edit-language/' . $_POST['name']);\n } else {\n $this->vars['error'] = $this->Madmin->error;\n }\n }\n }\n }\n $this->load->view('admincp' . DS . 'language_manager' . DS . 'view.add_language', $this->vars);\n $this->load_footer();\n } else {\n json(array('error' => 'Please login first!'));\n }\n }", "public function actionChangeLanguage($language = null)\n {\n if($language != null)\n {\n UsniAdaptor::app()->cookieManager->setLanguageCookie($language);\n }\n }", "static private function CreateLanguageMessage() {\n\t\tif (!IllaUser::loggedIn()) {\n\t\t\t$german_browser = (ereg('de', $_SERVER['HTTP_ACCEPT_LANGUAGE']) ? true : false);\n\t\t}else {\n\t\t\t$german_browser = IllaUser::german();\n\t\t}\n\t\tif (($german_browser && self::isEnglish()) || (!$german_browser && self::isGerman())) {\n\t\t\t$short_filename = substr_replace(basename($_SERVER['PHP_SELF']), '', 0, 2);\n\t\t\t$path = str_replace($short_filename, '', $_SERVER['PHP_SELF']);\n\t\t\t$path = substr_replace($path, '', - 2, 2);\n\n\t\t\tif (count($_GET) > 0) {\n\t\t\t\t$getparams = array();\n\t\t\t\tforeach ($_GET as $key => $value) {\n\t\t\t\t\t$getparams[] = htmlentities($key) . '=' . htmlentities($value);\n\t\t\t\t}\n\t\t\t\t$getparams = '?' . implode('&amp;', $getparams);\n\t\t\t}else {\n\t\t\t\t$getparams = '';\n\t\t\t}\n\n\t\t\tif (self::isEnglish() && file_exists('de' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Deine bevorzugte Sprache scheint Deutsch zu sein. Klick hier um zur deutschen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Your favoured language seems to be German. Click here to view the German version of this page.</a>', 'note');\n\t\t\t} elseif (self::isGerman() && file_exists('us' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Deine bevorzugte Sprache scheint Englisch zu sein. Klick hier um zur englischen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Your favoured language seems to be English. Click here to view the English version of this page.</a>', 'note');\n\t\t\t}\n\t\t}\n\t}", "private static function loadLanguage()\n\t{\n\t\t// Load translations\n\t\t$basePath = dirname(__FILE__);\n\t\t$jlang = JFactory::getLanguage();\n\t\t$jlang->load('liveupdate', $basePath, 'en-GB', true); // Load English (British)\n\t\t$jlang->load('liveupdate', $basePath, $jlang->getDefault(), true); // Load the site's default language\n\t\t$jlang->load('liveupdate', $basePath, null, true); // Load the currently selected language\n\t}" ]
[ "0.73268425", "0.6957079", "0.6929883", "0.6888811", "0.68719894", "0.68285275", "0.6764004", "0.6731691", "0.6689829", "0.66182697", "0.66022825", "0.6538568", "0.6515099", "0.65018946", "0.64919657", "0.6489783", "0.6484238", "0.6421807", "0.64150864", "0.64145607", "0.6391004", "0.6370805", "0.6349976", "0.6348473", "0.6338579", "0.63253343", "0.6323873", "0.6320693", "0.63186187", "0.6317739", "0.6249368", "0.6239176", "0.62356484", "0.620948", "0.62090564", "0.62090516", "0.6202145", "0.61952686", "0.6151393", "0.6097205", "0.60861075", "0.6070285", "0.6065028", "0.6064021", "0.6058305", "0.60525995", "0.6048145", "0.6041172", "0.6026433", "0.6018912", "0.6013755", "0.6000206", "0.5991774", "0.5963308", "0.5941435", "0.5886573", "0.5881904", "0.5876619", "0.58669055", "0.58623075", "0.58608186", "0.585389", "0.584854", "0.5842011", "0.5840672", "0.58215046", "0.5809001", "0.5798082", "0.57921135", "0.57864565", "0.5783436", "0.57703894", "0.57697344", "0.5766073", "0.57654697", "0.5751054", "0.5743866", "0.5736012", "0.57316273", "0.57315296", "0.57312864", "0.5720804", "0.57058275", "0.57029635", "0.56982315", "0.56931", "0.56847215", "0.56813765", "0.5678611", "0.5668709", "0.56673485", "0.5651012", "0.56478965", "0.564099", "0.5638102", "0.563731", "0.5632237", "0.56238717", "0.56153965", "0.5603755" ]
0.61645633
38
Display the user verification form
public function verify($crypt_user_id) { $user = $this->userRepo->get(Crypt::decrypt($crypt_user_id)); return View::make('user.verify', compact('user', 'crypt_user_id')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function verify()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n $this->View->Render('verify/verify');\n }", "function _UserDisplayVerificationForm( &$module, $id, &$params, $returnid )\n {\n $feusers = $module->GetModuleInstance('FrontEndUsers');\n if( !$feusers )\n {\n\t$module->_DisplayErrorPage($id, $params, $returnid,\n\t\t\t\t $module->Lang('error_nofeusersmodule'));\n\treturn;\n }\n\n if( isset( $params['error'] ) )\n {\n\t$module->smarty->assign('error', $params['error']);\n }\n if( isset( $params['message'] ) )\n {\n\t$module->smarty->assign('message', $params['message']);\n }\n\n $username = '';\n if( isset( $params['input_username'] ) )\n {\n\t$username = trim($params['input_username']);\n }\n $password = '';\n if( isset( $params['input_password'] ) )\n {\n\t$password = trim($params['input_password']);\n }\n $code = '';\n if( isset( $params['input_code'] ) )\n {\n\t$code = trim($params['input_code']);\n }\n $group_id = '';\n if( isset( $params['input_group_id'] ) )\n {\n\t$group_id = trim($params['input_group_id']);\n }\n\n // process the template\n $module->smarty->assign('title',\n\t\t\t $module->Lang('title_verifyregistration'));\n if ($feusers->GetPreference('username_is_email'))\n {\n $module->smarty->assign('prompt_username',$module->Lang('email'));\n }\n else\n {\n $module->smarty->assign('prompt_username',\n\t\t\t $module->Lang('username'));\n }\n $module->smarty->assign('input_username',\n\t\t\t $module->CreateInputText($id,'input_username',\n\t\t\t\t\t\t $username,\n\t\t\t\t\t\t $feusers->GetPreference('usernamefldlength'),\n\t\t\t\t\t\t $feusers->GetPreference('max_usernamelength')));\n $module->smarty->assign('prompt_password',\n\t\t\t $module->Lang('password'));\n $module->smarty->assign('input_password',\n\t\t\t $module->CreateInputPassword($id,'input_password',\n\t\t\t\t\t\t $password,\n\t\t\t\t\t\t $feusers->GetPreference('passwordfldlength'),\n\t\t\t\t\t\t $feusers->GetPreference('max_passwordlength')));\n $module->smarty->assign('prompt_code',\n\t\t\t $module->Lang('code'));\n $module->smarty->assign('input_code',\n\t\t\t $module->CreateInputText($id,'input_code',\n\t\t\t\t\t\t $code, 30, 30 ));\n $module->smarty->assign('submit',\n\t\t\t $module->CreateInputSubmit($id,'submit',$module->Lang('submit')));\n\n $inline = $module->GetPreference('inline_forms',true);\n if( isset($params['noinline']) )\n {\n\t$inline = false;\n }\n $module->smarty->assign('startform',\n\t\t\t $module->CreateFrontendFormStart($id, $returnid, 'verifyuser','post','',$inline));\n $module->smarty->assign('hidden',\n\t\t\t $module->CreateInputHidden($id, 'input_group_id', $group_id ));\n $module->smarty->assign('endform',\n\t\t\t $module->CreateFormEnd());\n echo $module->ProcessTemplateFromDatabase('selfreg_reg2template');\n }", "public function register_show_2()\n {\n return view('fontend.user.verify');\n }", "public function show()\n {\n return view('auth.verify');\n }", "public function verifyAction()\n\t{\n\t\t$this->view->headTitle(\"Registration Process\");\n\t\t\n\t\t//Retrieve key from url\n\t\t$registrationKey = $this->getRequest()->getParam('key');\n\t\t\n\t\t//Identitfy the user associated with the key\n\t\t$user = new Default_Model_User();\n\t\t\n\t\t//Determine is user already confirm\n\t\tif($user->isUserConfirmed($registrationKey)){\n\t\t$this->view->isConfirmed = 1;\n\t\t$this->view->errors[] = \"User is already confirmed\";\n\t\treturn;\n\t\t}\n\n\t\t$resultRow = $user->getUserByRegkey($registrationKey);\n\t\t\n\t\t//If the user has been located, set the confirmed column.\n\t\tif(count($resultRow)){\n\t\t\t$resultRow->confirmed = 1;\n\t\t\t$resultRow->save();\n\t\t\t\n\t\t\t$this->view->success = 1;\n\t\t\t$this->view->firstName = $resultRow->first_name;\n\t\t\n\t\t} else{\n\t\t\t$this->view->errors[] = \"Unable to locate registration key\";\n\t\t}\n\n\t}", "public function verify(){\n\t\t// getting the username and code from url\n\t\t$code=$_GET['c'];\n\t\t$user=$_GET['u'];\n\t\t// load the regmod model\n\t\t$this->load->model('regmod');\n\t\t// calling the function Vemail that check the valodation code with the username\n\t\t$flag=$this->regmod->Vemail($user,$code);\n\t\t// checking the Vemail the respond\n\t\tif($flag)\n\t\t\t{$data['res']= \"You have successfully verified your email. You may login to Hungry.lk with your username and password\";}\n\t\telse\n\t\t\t{$data['res']= \"Opps An error occurred in our system, try again later\";}\n\t\t$this->load->view(\"register_status_view\",$data);\n\t}", "public function displayEmailVerificationView()\n {\n if($this->user->hasVerifiedEmail())\n {\n return redirect($this->redirectTo)->withFlash('success', 'Your email has already been verified');\n }\n\n return response(view('auth.verification:view', [\n 'message' => 'Your email has not been verified, please use the link sent to you or request a new one'\n ]));\n }", "public function showVerifyBusinessForm(){\n return view('businesses/forms/verify');\n }", "public function verify()\n {\n return view('pages.verify');\n }", "public function displayRegisterForm()\n {\n // charger le HTML de notre template\n require OPROFILE_TEMPLATES_DIR . 'register-form.php';\n }", "public function show(user_email_verify $user_email_verify)\n {\n //\n }", "public function show(CompanyUserVerification $companyUserVerification)\n {\n //\n }", "public function showRegistrationForm()\n {\n return view('skins.' . config('pilot.SITE_SKIN') . '.auth.register');\n }", "function displayRegForm() {\r\n displayUserForm(\"processRegistration.php\", \"registrationForm\", \"Register\",\r\n \"Your name\", \"\",\r\n \"Your email address\", \"\",\r\n \"Your chosen username\", \"\",\r\n \"Your chosen password\", \"Confirm your password\",\r\n true, -1);\r\n}", "protected function showForgot() {}", "function verify($user_id, $user_verification_code)\n {\n $login_model = $this->loadModel('Login');\n $login_model->verifyNewUser($user_id, $user_verification_code);\n $this->view->render('login/verify');\n }", "public function ShowForm()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$GLOBALS['AddonId'] = $this->GetId();\n\t\t\t$GLOBALS['Message'] = GetFlashMessageBoxes();\n\t\t\t$this->ParseTemplate('emailchange.form');\n\t\t}", "public function showForm()\n {\n return view('auth.register-step2');\n }", "public function index()\n {\n return view('personal.verification');\n }", "public function accountVerifyConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors; /* @var Sly_Errors $errors */\n $site = $this->view->site; /* @var BeMaverick_Site $site */\n $validator = $this->view->validator; /* @var BeMaverick_Validator $validator */\n\n // set the input params\n $requiredParams = array(\n 'code',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n // decode the hash and gets its parts, confirm all good and account is valid\n list( $username, $timestamp, $signature ) = explode( '|', base64_decode( urldecode( $input->code ) ) );\n\n $user = $site->getUserByUsername( $username );\n\n $validator->checkValidUser( $user, $errors );\n $validator->checkValidVerifyAccountCode( $site, $username, $timestamp, $signature, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n $user->setEmailVerified( true );\n $user->save();\n\n // set the cookie\n BeMaverick_Cookie::updateUserCookie( $user );\n\n return $this->renderPage( 'authAccountVerifyConfirm' );\n }", "public function showRegistrationForm()\n {\n $askForAccount = false;\n return view('client.auth.register',compact(\"askForAccount\"));\n }", "public function verifyAccount() {\n\n\t\t//Get Value of UserId from URL\n\t\t$UID = $this->MyJamiaDecrypt($this->input->get('UID'));\n\t\t//Get value of rtext from URL\n\t\t$RText = $this->input->get('rtext');\n\n\t\t$this->load->model('UserModel','UM');\n\n\t\t$data['VerificationResult'] = $this->UM->VerifyEMailAccount($UID, $RText);\n\t\t$data['UID'] = $UID;\n\n\t\t$data['message'] = 'Please set your password';\n\t\t$data['messageType'] = 'I';\n\t\t// \t$VerificationResult == 1 \t=> Passed verification\n\t\t//\t$VerificationResult == -1 \t=>\tAccount already created\n\t\t//\t$VerificationResult == 0 \t=>\tVerification failed\n\n\t\t$this->load->view('/public/SetAccountPassword',$data);\n\t}", "public function RegistrationUnderApproval() {\n $this->Render();\n }", "public function verifyEmailView()\n {\n return view('auth.verify-email');\n }", "public function actionVerifyRegistration()\n {\n // get hash code from url\n $hash = Yii::app()->getRequest()->getQuery('hash');\n // activate account\n $model = Profiles::model()->findByAttributes(array('PRF_RND'=>$hash));\n if($model!==null){\n $model->PRF_ACTIVE = '1';\n $model->save();\n\t\tYii::app()->user->setFlash('register','Thank you for your verification. You can now login using the following link.');\n//$this->refresh();\n } else {\n\t\tYii::app()->user->setFlash('register','Hash value invalid, cannot verification user.');\n\t }\n\t //echo $hash . \"<br>\\r\\n\";\n\t //print_r($model);\n $this->checkRenderAjax('register',array('model'=>$model,));\n }", "public function showSignupForm()\n {\n return view('auth.signup');\n }", "public function showSignupForm()\n {\n return view('auth.signup');\n }", "public function signupForm()\n {\n \t# code...\n \treturn view(\"external-pages.sign-up\");\n }", "public function display_site_verification() {\n\t\t$google_verification = get_option( 'wsuwp_google_verify', false );\n\t\t$bing_verification = get_option( 'wsuwp_bing_verify', false );\n\t\t$facebook_verification = get_option( 'wsuwp_facebook_verify', false );\n\n\t\tif ( $google_verification ) {\n\t\t\techo '<meta name=\"google-site-verification\" content=\"' . esc_attr( $google_verification ) . '\">' . \"\\n\";\n\t\t}\n\n\t\tif ( $bing_verification ) {\n\t\t\techo '<meta name=\"msvalidate.01\" content=\"' . esc_attr( $bing_verification ) . '\" />' . \"\\n\";\n\t\t}\n\n\t\tif ( $facebook_verification ) {\n\t\t\techo '<meta name=\"facebook-domain-verification\" content=\"' . esc_attr( $facebook_verification ) . '\" />' . \"\\n\";\n\t\t}\n\t}", "public function showRegistrationForm() {\n //parent::showRegistrationForm();\n $data = array();\n\n $data = $this->example_of_user();\n $data['title'] = 'RegisterForm';\n\n return view('frontend.auth.register', $data);\n }", "public function showRegistrationForm()\n {\n return view('instructor.auth.register');\n }", "function viewSignUpForm() {\n\t$view = new viewModel();\n\t$view->showSignUpForm();\t\n}", "public function verifyAction()\n {\n $email = Request::post('email', Filter::FILTER_EMAIL, false);\n\n if (!$email || !Validator_Email::validate($email)) {\n Response::jsonError($this->moduleLang->get('email_invalid'));\n }\n\n $model = Model::factory('User');\n\n $userIds = $model->getList(\n ['limit' => 1],\n [\n 'email' => $email,\n 'enabled'=> true\n ],\n ['id']\n );\n\n if (count($userIds) == 0) {\n Response::jsonError($this->moduleLang->get('email_user_unknown'));\n }\n\n $userId = $userIds[0]['id'];\n\n $user = Db_Object::factory('User', $userId);\n $authCode = Utils::hash(uniqid(time(),true));\n\n $confDate = new DateTime('now');\n $confDate = $confDate->add(new DateInterval('P1D'))->format('Y-m-d H:i:s');\n\n try{\n $user->setValues(array(\n 'confirmation_code' => $authCode,\n 'confirmation_expiried' => $confDate\n ));\n if(!$user->save())\n throw new Exception('Cannot update user info');\n }catch (Exception $e){\n Response::jsonError($this->_lang->get('CANT_EXEC'));\n }\n\n $this->sendEmail($user);\n\n Response::jsonSuccess(array(\n 'msg' => $this->moduleLang->get('pwd_success')\n ));\n }", "public function showRegistrationForm()\n {\n return view('frontend.user_registration');\n }", "public function showReg()\n {\n //show the form\n if (Auth::check())\n {\n return Redirect::route('account');\n }\n\n // Show the page\n return View::make('account.reg');\n }", "function validate_user_form()\n {\n }", "public function showResetForm()\n {\n // if user is logged in, do not let him access this page\n if( Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $userID = SCMUtility::cleanText($_GET['userID']);\n $token = SCMUtility::stripTags($_GET['token']);\n\n if( ! $this->isOnResetPasswordSession($token) )\n {\n $this->resetPasswordSessionDeactivate();\n\n SCMUtility::setFlashMessage('Invalid Token or token has expired!');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $this->resetPasswordSessionDeactivate();\n\n View::make('templates/front/reset-password-form.php',compact('userID'));\n }", "public function showRegistrationForm()\n {\n return view('user.auth.login');\n }", "public function processVerificationDetails()\n {\n // success needs to be on the landing pages so the login button is right on top\n $SubmittedFormName = 'VerificationDetailsForm';\n $returnToRoute = array\n (\n 'name' => FALSE,\n 'data' => FALSE,\n );\n $VerificationDetailsFormMessages = array();\n\n if(Request::isMethod('post'))\n {\n if($this->isFormClean($SubmittedFormName, Input::all()))\n {\n // Validate vcode\n $verifiedMemberIDArray = $this->verifyEmailByLinkAndGetMemberIDArray(Input::get('vcode'), 'VerificationDetailsForm');\n\n if (!isset($verifiedMemberIDArray['errorNbr']) && !isset($verifiedMemberIDArray['errorMsg']))\n {\n if (isset($verifiedMemberIDArray) && is_array($verifiedMemberIDArray))\n {\n // Validate Form\n $formFields = array\n (\n 'first_name' => Input::get('first_name'),\n 'last_name' => Input::get('last_name'),\n 'gender' => Input::get('gender'),\n 'member_type' => Input::get('member_type'),\n 'zipcode' => Input::get('zipcode'),\n );\n $formRules = array\n (\n 'first_name' => array\n (\n 'required',\n 'alpha',\n 'between:2,60',\n ),\n 'last_name' => array\n (\n 'required',\n 'alpha',\n 'between:2,60',\n ),\n 'gender' => array\n (\n 'required',\n 'numeric',\n 'digits:1',\n 'min:1',\n 'max:2',\n ),\n 'member_type' => array\n (\n 'required',\n 'numeric',\n 'digits:1',\n 'min:1',\n 'max:3',\n ),\n 'zipcode' => array\n (\n 'required',\n 'numeric',\n 'digits:5',\n #'exists:freelife_utils.location_data,postal_code',\n ),\n );\n $formMessages = array\n (\n 'first_name.required' => \"Please, enter your first name.\",\n 'first_name.alpha' => \"Please, use only the alphabet for your first name.\",\n 'first_name.between' => \"Please, re-check the length of your first name.\",\n\n 'last_name.required' => \"Please, enter your last name.\",\n 'last_name.alpha' => \"Please, use only the alphabet for your last name.\",\n 'last_name.between' => \"Please, re-check the length of your last name.\",\n\n 'gender.required' => \"Please, select your gender.\",\n 'gender.numeric' => \"Please, choose a gender.\",\n 'gender.digits' => \"Please, choose a gender.\",\n 'gender.min' => \"Please, choose a gender.\",\n 'gender.max' => \"Please, choose a gender.\",\n\n 'member_type.required' => \"Please, select your Membership Type.\",\n 'member_type.numeric' => \"Please, choose a Membership Type.\",\n 'member_type.digits' => \"Please, choose a Membership Type.\",\n 'member_type.min' => \"Please, choose a Membership Type.\",\n 'member_type.max' => \"Please, choose a Membership Type.\",\n\n 'zipcode.required' => \"Please, enter your zipcode.\",\n 'zipcode.numeric' => \"Please, use only numbers for your zipcode.\",\n 'zipcode.digits' => \"Please, enter a zipcode.\",\n );\n\n $validator = Validator::make($formFields, $formRules, $formMessages);\n\n if ($validator->passes())\n {\n $memberDetailsExist = $this->doEmployeeDetailsExist($verifiedMemberIDArray['memberID']);\n\n // Add Member Details\n $detailsFillableArray = array\n (\n 'member_id' => $verifiedMemberIDArray['memberID'],\n 'first_name' => $formFields['first_name'],\n 'last_name' => $formFields['last_name'],\n 'gender' => $formFields['gender'],\n 'zipcode' => $formFields['zipcode'],\n 'personal_summary' => '',\n 'profile_pic_url' => '',\n 'personal_website_url' => '',\n 'linkedin_url' => '',\n 'google_plus_url' => '',\n 'twitter_url' => '',\n 'facebook_url' => '',\n );\n if($memberDetailsExist)\n {\n $this->updateEmployeeDetails($verifiedMemberIDArray['memberID'], $detailsFillableArray);\n }\n else\n {\n $this->addEmployeeDetails($verifiedMemberIDArray['memberID'], $detailsFillableArray);\n }\n\n // Update Member Object with Member Type\n $memberFillableArray = array\n (\n 'member_type' => $this->getMemberTypeFromFromValue(strtolower($formFields['member_type'])),\n );\n $this->updateMember($verifiedMemberIDArray['memberID'], $memberFillableArray);\n $this->addEmployeeStatus('VerifiedStartupDetails', $verifiedMemberIDArray['memberID']);\n $this->addEmployeeStatus('ValidMember', $verifiedMemberIDArray['memberID']);\n $this->addEmployeeSiteStatus('Member startup details complete.', $verifiedMemberIDArray['memberID']);\n\n // Successful Verification Notification Email\n $this->sendEmail\n (\n 'genericProfileInformationChange',\n array\n (\n 'first_name' => $formFields['first_name'],\n 'last_name' => $formFields['last_name'],\n ),\n array\n (\n 'fromTag' => 'General',\n 'sendToEmail' => $verifiedMemberIDArray['email'],\n 'sendToName' => $formFields['first_name'] . ' ' . $formFields['last_name'],\n 'subject' => 'Profile Change Notification',\n 'ccArray' => FALSE,\n 'attachArray' => FALSE,\n )\n );\n\n\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 1);\n $viewData = array\n (\n 'firstName' => $formFields['first_name'],\n 'emailAddress' => $verifiedMemberIDArray['email'],\n );\n\n return $this->makeResponseView('application/auth/verification-details-success', $viewData);\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n $VerificationDetailsFormErrors = $validator->messages()->toArray();\n $VerificationDetailsFormMessages = array();\n foreach($VerificationDetailsFormErrors as $errors)\n {\n $VerificationDetailsFormMessages[] = $errors[0];\n }\n\n Log::info(\"VerificationDetails form values did not pass.\");\n }\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n Log::info(\"Error #3 - returned value from verifiedMemberIDArray is not an array.\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => 3),\n );\n }\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n Log::info(\"Error #\" . $verifiedMemberIDArray['errorNbr'] . \" - \" . $verifiedMemberIDArray['errorMsg'] . \".\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => $verifiedMemberIDArray['errorNbr']),\n );\n }\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n $this->addAdminAlert();\n Log::warning($SubmittedFormName . \" has invalid dummy variables passed.\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => 23),\n );\n }\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n Log::warning($SubmittedFormName . \" is not being correctly posted to.\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => 23),\n );\n }\n\n if(FALSE != $returnToRoute['name'])\n {\n return Redirect::route($returnToRoute['name'],$returnToRoute['data']);\n }\n else\n {\n $viewData = array\n (\n 'vcode' => Input::get('vcode'),\n 'firstName' => Input::get('first_name'),\n 'lastName' => Input::get('last_name'),\n 'gender' => Input::get('gender') ?: 0,\n 'memberType' => Input::get('member_type') ?: 0,\n 'zipCode' => Input::get('zipcode'),\n 'VerificationDetailsFormMessages' => $VerificationDetailsFormMessages,\n );\n return $this->makeResponseView('application/auth/verified_email_success', $viewData);\n }\n }", "function display() {\n\n\t\t$model = $this->getModel('provider');\n\n\t\t$usersConfig = &JComponentHelper::getParams( 'com_users' );\n\t\tif (!$usersConfig->get( 'allowUserRegistration' )) {\n\t\t\tJError::raiseError( 403, JText::_( 'Access Forbidden' ));\n\t\t\treturn;\n\t\t}\n\n\t\t$user \t=& JFactory::getUser();\n\n\t\tif ( $user->get('guest')) {\n\t\t\tJRequest::setVar('view', 'provider_request');\n\t\t} else {\n\t\t\t$this->setredirect('index.php?option=com_users&task=edit',JText::_('You are already registered.'));\n\t\t}\n\n\n if( !JRequest::getVar( 'view' )) {\n\t\t JRequest::setVar('view', 'provider_request' );\n }\n\n\t\t$view = $this->getView( 'provider_request', 'html' );\n\t\t$view->setModel( $this->getModel( 'provider', 'providerModel' ), true );\n\t\t$view->display();\n\t\t//parent::display();\n\t}", "public function authentication_page( $user ) {\n\t\trequire_once( ABSPATH . '/wp-admin/includes/template.php' );\n\t\t?>\n\t\t<p style=\"padding-bottom:1em;\"><?php esc_html_e( 'Enter a backup Authentication Code.', 'it-l10n-ithemes-security-pro' ); ?></p><br/>\n\t\t<p>\n\t\t\t<label for=\"authcode\"><?php esc_html_e( 'Authentication Code:', 'it-l10n-ithemes-security-pro' ); ?></label>\n\t\t\t<input type=\"tel\" name=\"two-factor-backup-code\" id=\"authcode\" class=\"input\" value=\"\" size=\"20\" pattern=\"[0-9]*\" />\n\t\t</p>\n\t\t<script type=\"text/javascript\">\n\t\t\tsetTimeout( function(){\n\t\t\t\tvar d;\n\t\t\t\ttry{\n\t\t\t\t\td = document.getElementById('authcode');\n\t\t\t\t\td.value = '';\n\t\t\t\t\td.focus();\n\t\t\t\t} catch(e){}\n\t\t\t}, 200);\n\t\t</script>\n\t\t<?php\n\t\tsubmit_button( __( 'Submit', 'it-l10n-ithemes-security-pro' ) );\n\t}", "function verify_email()\n\t{\n\t\t\n\t\tif($this->uri->segment(3))\n\t\t{\n\t\t\t$verification_key = $this->uri->segment(3);\n\t\t\t\n\t\t\tif($this->register_model->verify_email($verification_key))\n\t\t\t{\n\t\t\t\t$data['message'] = '<h1 align=\"center\"> Thank you for verifying your email address. Click <a href=\"'.base_url().'login\">here</a> to login.</h1>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['message'] = '<h1 align=\"center\"> This link is invalid.</h1>';\n\t\t\t}\n\t\t\t$this->load->view('template/header');\n\t\t\t$this->load->view('email_verification', $data);\n\t\t\t$this->load->view('template/footer');\n\t\t}\n\n\t}", "public function showLinkRequestForm()\n {\n return view('pages.admin.auth.passwords.email');\n }", "public function showForm()\n\t{\n echo view($this->config->views['login']);\n\t}", "public function showActivationPage()\n {\n $user = Auth::user();\n $questions = SecurityQuestion::all();\n\n return view('users.activate', compact('user', 'questions'));\n }", "public function show(User $user)\n {\n return view('client.user.verify', [\n 'users' => $user\n ]);\n }", "public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('frontend.auth.register');\n }", "public function showLinkRequestForm()\n {\n return view('auth.affiliate.passwords.email');\n }", "public function showRegistrationForm()\n {\n return view('laboratorio.auth.register');\n \n }", "public function showLinkRequestForm()\n {\n return view('auth.passwords.email');\n }", "public function showLinkRequestForm()\n {\n return view('auth.passwords.email');\n }", "public function showSignupForm()\n {\n return view('signup');\n }", "function verifikasi()\n\t{\n\t\t$data['belum_terverifikasi'] = $this->Kesehatan_M->read('user',array('verified'=>'belum'))->result();\n\t\t$data['sudah_terverifikasi'] = $this->Kesehatan_M->read('user',array('verified'=>'sudah','hak_akses !='=>'1'))->result();\n\t\t$this->load->view('static/header');\n\t\t$this->load->view('static/navbar');\n\t\t$this->load->view('admin/verifikasi',$data);\n\t\t$this->load->view('static/footer');\n\t}", "public function show(Verify $verify)\n {\n //\n }", "public function postVerify()\n\t{\n\t\tif (!$this->userService->verify(Input::all()))\n\t\t{\n\t\t\tif ($this->userService->message())\n\t\t\t{\n\t\t\t\tAlert::error($this->userService->message())->flash();\n\t\t\t}\n\n\t\t\treturn Redirect::back()->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tSession::flash('email', Input::get('email'));\n\n\t\tAlert::success('Your account has been verified!')->flash();\n\t\treturn Redirect::route('auth-login');\n\t}", "public function showRegistrationForm()\n {\n return view('privato.auth.register');\n }", "public function showRegistrationForm()\n {\n return view('auth.officer-register');\n }", "public function regi_form() {\n $template = $this->loadView('registration_page');\n // $template->set('result', $error);\n $template->render();\n }", "public function verifyPhone(){\n return view('auth.register_phone');\n }", "public function actionEmailverification() {\n if (Yii::$app->request->get('id') && Yii::$app->request->get('key')) {\n\n $access_token = Yii::$app->request->get('id');\n $key = Yii::$app->request->get('key');\n\n $customers = \\app\\models\\Customers::find()\n ->leftjoin('user_token', 'user_token.user_id=users.id')\n ->where(['access_token' => $access_token])\n ->andWhere(['token' => $key])\n ->one();\n\n\n if (count($customers)) {\n\n $customers->profile_status = 'ACTIVE';\n $customers->save();\n $user_token = \\app\\models\\UserToken::find()\n ->where(['token' => $key])\n ->andWhere(['user_id' => $customers->id])\n ->one();\n $user_token->delete();\n Yii::$app->session->setFlash('success', 'Your account verified successfully.');\n \\app\\components\\EmailHelper::welcomeEmail($customers->id);\n } else {\n Yii::$app->session->setFlash('danger', 'Illegal attempt1.');\n }\n } else {\n Yii::$app->session->setFlash('danger', 'Illegal attempt2.');\n }\n return $this->render('emailverification');\n }", "function verify()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($_POST))\n\t\t{\n\t\t\t# Approve or reject a confirmation\n\t\t\t$result = $this->_confirmation->verify($_POST);\n\t\t\t\n\t\t\t$actionPart = current(explode(\"_\", $_POST['action']));\n\t\t\t$actions = array('reject'=>'rejected', 'post'=>'posted', 'approve'=>'approved', 'verify'=>'verified');\n\t\t\t$actionWord = !empty($actions[$actionPart])? $actions[$actionPart]: 'made';\n\t\t\t\n\t\t\t$item = in_array($_POST['action'], array('approve','reject'))? 'posting': 'confirmation';\n\t\t\t$this->native_session->set('msg', ($result['boolean']? \"The \".$item.\" has been \".$actionWord: (!empty($result['msg'])? $result['msg']: \"ERROR: The \".$item.\" could not be \".$actionWord) ));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Get list type\n\t\t\t$data['list_type'] = current(explode(\"_\", $data['action']));\n\t\t\t$data['area'] = 'verify_confirmation';\n\t\t\t$this->load->view('confirmation/addons', $data);\n\t\t}\n\t}", "public function showRegistrationForm()\n {\n return view('signup');\n }", "function showform(){\n return view('registration');\n }", "public function showVerifications()\n\t{\n\t\t$this->pageConfig->setMetadata(self::GOOLE_SITE_VERIFICATION, $this->helperData->getVerficationConfig('google'));\n\t\t$this->pageConfig->setMetadata(self::MSVALIDATE_01, $this->helperData->getVerficationConfig('bing'));\n\t\t$this->pageConfig->setMetadata(self::P_DOMAIN_VERIFY, $this->helperData->getVerficationConfig('pinterest'));\n\t\t$this->pageConfig->setMetadata(self::YANDEX_VERIFICATION, $this->helperData->getVerficationConfig('yandex'));\n\t}", "protected function display() {\n\t\t\t$objUrl = AppRegistry::get('Url');\n\t\t\t$strActionType = 'signup';\n\t\t\t\n\t\t\tif ($objUrl->getMethod() == 'POST' && $objUrl->getVariable('action') == $strActionType) {\n\t\t\t\tif (!empty($_POST['promo'])) {\n\t\t\t\t\tif (!($blnValidCode = in_array($_POST['promo'], AppConfig::get('BetaPromoCodes')))) {\n\t\t\t\t\t\tAppLoader::includeModel('PromoModel');\n\t\t\t\t\t\t$objPromo = new PromoModel();\n\t\t\t\t\t\tif ($objPromo->loadByCodeAndType($_POST['promo'], 'beta')) {\n\t\t\t\t\t\t\tif ($objPromoRecord = $objPromo->current()) {\n\t\t\t\t\t\t\t\tif (!$objPromoRecord->get('claimed')) {\n\t\t\t\t\t\t\t\t\t$blnValidCode = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('That promo code has already been claimed'));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Invalid promo code'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error verifying the promo code'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('A promo code is required to register during the private beta'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!empty($blnValidCode)) {\n\t\t\t\t\t$objUser = new UserModel(array('Validate' => true));\n\t\t\t\t\t$objUser->import(array(\n\t\t\t\t\t\t'username'\t=> !empty($_POST['username']) ? $_POST['username'] : null,\n\t\t\t\t\t\t'email'\t\t=> !empty($_POST['email']) ? $_POST['email'] : null,\n\t\t\t\t\t));\n\t\t\t\t\t$objUser->current()->set('password_plaintext', !empty($_POST['password']) ? $_POST['password'] : null);\n\t\t\t\t\t$objUser->current()->set('password_plaintext_again', !empty($_POST['password_again']) ? $_POST['password_again'] : null);\n\t\t\t\t\t\n\t\t\t\t\tif ($objUser->save()) {\n\t\t\t\t\t\tif (isset($objPromoRecord)) {\n\t\t\t\t\t\t\t$objPromoRecord->set('userid', $objUser->current()->get('__id'));\n\t\t\t\t\t\t\t$objPromoRecord->set('claimed', date(AppRegistry::get('Database')->getDatetimeFormat()));\n\t\t\t\t\t\t\t$objPromo->save();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($objUserLogin = AppRegistry::get('UserLogin', false)) {\n\t\t\t\t\t\t\t$objUserLogin->handleFormLogin($objUser->current()->get('username'), $objUser->current()->get('password_plaintext'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tCoreAlert::alert(AppLanguage::translate('Welcome to %s, %s!', AppConfig::get('SiteTitle'), $objUser->current()->get('displayname')), true);\t\n\t\t\t\t\t\tAppDisplay::getInstance()->appendHeader('location: ' . AppConfig::get('BaseUrl') . '/');\n\t\t\t\t\t\texit;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAppRegistry::get('Error')->error(AppLanguage::translate('There was an error signing up. Please try again'), true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->validateFile($strTemplate = $this->strTemplateDir . $this->strThemeDir . 'beta.phtml')) {\n\t\t\t\tAppDisplay::getInstance()->appendTemplate('content', $strTemplate, array_merge($this->arrPageVars, array(\n\t\t\t\t\t'strCssUrl'\t\t\t=> AppConfig::get('CssUrl'),\n\t\t\t\t\t'strJsUrl'\t\t\t=> AppConfig::get('JsUrl'),\n\t\t\t\t\t'strSubmitUrl'\t\t=> AppRegistry::get('Url')->getCurrentUrl(),\n\t\t\t\t\t'strTokenField'\t\t=> AppConfig::get('TokenField'),\n\t\t\t\t\t'strUsernameField'\t=> AppConfig::get('LoginUsernameField'),\n\t\t\t\t\t'strPasswordField'\t=> AppConfig::get('LoginPasswordField'),\n\t\t\t\t\t'strLoginFlag'\t\t=> AppConfig::get('LoginFlag'),\n\t\t\t\t\t'strActionType'\t\t=> $strActionType,\n\t\t\t\t\t'blnSignupForm'\t\t=> !empty($_GET['promo']) || (!empty($_POST['action']) && $_POST['action'] == $strActionType) || (!empty($_GET['form']) && $_GET['form'] == 'signup'),\n\t\t\t\t\t'blnLoginForm'\t\t=> (!empty($_POST) && empty($_POST['action'])) || (!empty($_GET['form']) && $_GET['form'] == 'login'),\n\t\t\t\t\t'arrErrors'\t\t\t=> AppRegistry::get('Error')->getErrors()\n\t\t\t\t)));\n\t\t\t}\n\t\t}", "private static function verify() {\r\n\t\t// create code object for the given code we will be verifying\r\n\t\tif (!isset($_SESSION['user'])) {\r\n\t\t\tself::alertMessage('danger', 'Unable to find session user data. Try logging out and logging in again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$userID = $_POST['userID'] = $_SESSION['user']->getUserID();\r\n\t\t$code = new VerificationCode($_POST);\r\n\r\n\t\t// load and validate expected code from database\r\n\t\t$codeInDatabase = VerificationCodesDB::get($userID);\r\n\t\tif (is_null($codeInDatabase)) {\r\n\t\t\tself::alertMessage('danger', 'No active verification code found. Your code may have expired. Click \"Resend Code\" to send a new code to your phone.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// compare given/expected codes\r\n\t\tif ($code->getCode() !== $codeInDatabase->getCode()) {\r\n\t\t\tself::alertMessage('danger', 'The code you entered is incorrect. Please check your code and try again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// verification successful. mark phone number as verified\r\n\t\t$user = UsersDB::getUser($userID);\r\n\t\t$user->setIsPhoneVerified(true);\r\n\t\tUsersDB::edit($user);\r\n\t\t$_SESSION['user'] = $user;\r\n\r\n\t\t// clean up and show dashboard\r\n\t\tVerificationCodesDB::clear($userID);\r\n\t\tDashboardView::show();\r\n\t}", "public function showRegisterForm(){\n return view('auth.entreprise-register');\n }", "public static function User_management_information_display_user_data()\n {\n if (!self::_enabled()) {\n //account verify not enabled\n return;\n }\n $db = DataAccess::getInstance();\n $msgs = $db->get_text(true, 37);\n\n $verify_icon = \"<img src=\\\"\" . geoTemplate::getUrl('', $msgs[500952]) . \"\\\" alt='' />\";\n\n $not_verified = $msgs[500955];\n\n $user = geoUser::getUser(geoSession::getInstance()->getUserId());\n\n $price_plan_id = (!geoMaster::is('classifieds')) ? $user->auction_price_plan_id : $user->price_plan_id;\n $planItem = geoPlanItem::getPlanItem(self::type, $price_plan_id);\n\n if ($msgs[500956] && $planItem->getEnabled()) {\n $verify_link = $db->get_site_setting('classifieds_file_name') . \"?a=cart&amp;action=new&amp;main_type=verify_account\";\n\n $not_verified .= \"<br /><a href=\\\"{$verify_link}\\\">{$msgs[500956]}</a>\";\n }\n $value = (geoUser::isVerified($user->id)) ? $verify_icon : $not_verified;\n\n return array('label' => $msgs[500954], 'value' => $value);\n }", "public function veridetails() \n\t{\n\t\tUserModel::authentication();\n\t\t\n\t\tVerifyModel::upload_id();\n }", "public static function is_verified($user, $site) \n\t{\n if (USER_VERIFY_ID == 'enabled') \n\t\t{\n\t\t\t//they've not submited a file and we've not verified\n if ($user->user_detailverified == 'unverified' && $user->user_detailssubmitted == 'notsubmitted') \n\t\t\t{\n require Config::get('PATH_VIEWS') . 'views/user/verify.php';\n require Config::get('PATH_VIEWS') . 'views/_templates/footer.php';\n exit();\n \n\t\t\t////they've submited their ID but we've not verified yet\n\t\t\t}else if ($user->user_detailssubmitted == 'submited' && $user->detailverified == 'unverified') \n\t\t\t{\n\t\t\t\t//leave them a message\n\t\t\t\texit('<div class=\"col-md-6 col-xs-offset-3\"><div class=\"alert alert-success\"><strong>'. Filtration\\Core\\System::translate(\"Details Submitted!\").'\n\t\t\t\t\t</strong>'. Filtration\\Core\\System::translate(\"Please wait for our team to verify your details\").'</div></div>');\n }\n }\n }", "public function showLinkRequestForm()\n {\n return view('auth.organizer.passwords.email');\n }", "public function verify($user_id, $user_activation_verification_code)\n {\n if (isset($user_id) && isset($user_activation_verification_code)) {\n RegistrationModel::verifyNewUser($user_id, $user_activation_verification_code);\n $this->View->render('user/verify');\n } else {\n Redirect::to('index');\n }\n }", "public function showRegistrationForm()\n {\n return view('Registration View');\n }", "function verify()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($_POST))\n\t\t{\n\t\t\t# Approve or reject a school\n\t\t\t$result = $this->_job->verify($_POST);\n\t\t\t\n\t\t\t$actionPart = current(explode(\"_\", $_POST['action']));\n\t\t\t$actions = array('save'=>'saved', 'archive'=>'archived');\n\t\t\t$actionWord = !empty($actions[$actionPart])? $actions[$actionPart]: 'made';\n\t\t\t$this->native_session->set('msg', ($result['boolean']? \"The job has been \".$actionWord: (!empty($result['msg'])? $result['msg']: \"ERROR: The job could not be \".$actionWord) ));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Get list type\n\t\t\t$data['list_type'] = current(explode(\"_\", $data['action']));\n\t\t\t$data['area'] = 'verify_job';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t}", "public function showSignUpForm() {\n if(!config('springintoaction.signup.allow')) {\n return view('springintoaction::frontend.signup_closed');\n }\n\n return view('springintoaction::frontend.signup');\n }", "public function show(Request $request)\n {\n return $request->user('users')->hasVerifiedEmail()\n ? redirect()->route('user.home')\n : view('auth.verify',[\n 'resendRoute' => 'user.verification.resend',\n ]);\n }", "public function requestVerificationEmail()\n {\n if (!$this->request->is('post')) {\n $this->_respondWithMethodNotAllowed();\n return;\n }\n\n $user = $this->Guardian->user();\n if (!$user->verified) {\n $this->Users->Tokens->expireTokens($user->id, TokensTable::TYPE_VERIFY_EMAIL);\n $token = $this->Users->Tokens->create($user, TokensTable::TYPE_VERIFY_EMAIL, 'P2D');\n try {\n $this->getMailer('User')->send('verify', [$user, $token->token]);\n $this->set('message', __('Please check your inbox.'));\n } catch (\\Exception $e) {\n $this->_respondWithBadRequest();\n $this->set('message', 'Mailer not configured.');\n }\n } else {\n $this->set('message', __('Your email address is already verified.'));\n }\n\n $this->set('_serialize', ['message']);\n }", "public function _showForm()\n\t{\n\t\t$this->registry->output->setTitle( \"Log In\" );\n\t\t$this->registry->output->setNextAction( 'index&do=login' );\n\t\t$this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() );\n\t\t$this->registry->output->sendOutput();\n\t\texit();\n\t}", "function wcfmu_seller_verification_html() {\r\n\t\tglobal $WCFM, $WCFMu;\r\n\r\n\t\tif( isset( $_POST['messageid'] ) && isset($_POST['vendorid']) ) {\r\n\t\t\t$message_id = absint( $_POST['messageid'] );\r\n\t\t\t$vendor_id = absint( $_POST['vendorid'] );\r\n\r\n\t\t\tif( $vendor_id && $message_id ) {\r\n\r\n\t\t\t\t$vendor_verification_data = (array) get_user_meta( $vendor_id, 'wcfm_vendor_verification_data', true );\r\n\t\t\t\t$identity_types = $this->get_identity_types();\r\n\r\n\t\t\t\t$address = isset( $vendor_verification_data['address']['street_1'] ) ? $vendor_verification_data['address']['street_1'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['street_2'] ) ? ' ' . $vendor_verification_data['address']['street_2'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['city'] ) ? '<br />' . $vendor_verification_data['address']['city'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['zip'] ) ? ' ' . $vendor_verification_data['address']['zip'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['country'] ) ? '<br />' . $vendor_verification_data['address']['country'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['state'] ) ? ', ' . $vendor_verification_data['address']['state'] : '';\r\n\r\n\t\t\t\t$verification_note = isset( $vendor_verification_data['verification_note'] ) ? $vendor_verification_data['verification_note'] : '';\r\n\r\n\t\t\t\t?>\r\n\t\t\t\t<form id=\"wcfm_verification_response_form\">\r\n\t\t\t\t\t<table>\r\n\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t if( !empty( $identity_types ) ) {\r\n\t\t\t\t\t\t\t\tforeach( $identity_types as $identity_type => $identity_type_label ) {\r\n\t\t\t\t\t\t\t\t\t$identity_type_value = '';\r\n\t\t\t\t\t\t\t\t\tif( !empty( $vendor_verification_data ) && isset( $vendor_verification_data['identity'] ) && isset( $vendor_verification_data['identity'][$identity_type] ) ) $identity_type_value = $vendor_verification_data['identity'][$identity_type];\r\n\t\t\t\t\t\t\t\t\tif( $identity_type_value ) {\r\n\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"wcfm_verification_response_form_label\"><?php echo $identity_type_label; ?></td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td><a class=\"wcfm-wp-fields-uploader\" target=\"_blank\" style=\"width: 32px; height: 32px;\" href=\"<?php echo $identity_type_value; ?>\"><span style=\"width: 32px; height: 32px; display: inline-block;\" class=\"placeHolderDocs\"></span></a></td>\r\n\t\t\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td class=\"wcfm_verification_response_form_label\"><?php _e( 'Address', 'wc-frontend-manager-ultimate' ); ?></td>\r\n\t\t\t\t\t\t\t\t<td><?php echo $address; ?></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td class=\"wcfm_verification_response_form_label\"><?php _e( 'Note to Vendor', 'wc-frontend-manager-ultimate' ); ?></td>\r\n\t\t\t\t\t\t\t\t<td><textarea class=\"wcfm-textarea\" name=\"wcfm_verification_response_note\"></textarea></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td class=\"wcfm_verification_response_form_label\"><?php _e( 'Status Update', 'wc-frontend-manager-ultimate' ); ?></td>\r\n\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t <label for=\"wcfm_verification_response_status_approve\"><input type=\"radio\" id=\"wcfm_verification_response_status_approve\" name=\"wcfm_verification_response_status\" value=\"approve\" checked /><?php _e( 'Approve', 'wc-frontend-manager-ultimate' ); ?></label>\r\n\t\t\t\t\t\t\t\t <label for=\"wcfm_verification_response_status_reject\"><input type=\"radio\" id=\"wcfm_verification_response_status_reject\" name=\"wcfm_verification_response_status\" value=\"reject\" /><?php _e( 'Reject', 'wc-frontend-manager-ultimate' ); ?></label>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"wcfm_verification_vendor_id\" value=\"<?php echo $vendor_id; ?>\" />\r\n\t\t\t\t\t<input type=\"hidden\" name=\"wcfm_verification_message_id\" value=\"<?php echo $message_id; ?>\" />\r\n\t\t\t\t\t<div class=\"wcfm-message\" tabindex=\"-1\"></div>\r\n\t\t\t\t\t<input type=\"button\" class=\"wcfm_verification_response_button wcfm_submit_button\" id=\"wcfm_verification_response_button\" value=\"<?php _e( 'Update', 'wc-frontend-manager-ultimate' ); ?>\" />\r\n\t\t\t\t</form>\r\n\t\t\t\t<?php\r\n\t\t\t}\r\n\t\t}\r\n\t\tdie;\r\n\t}", "function _verify()\n {\n $e = \"\";\n if (isset($_POST['login'])) {\n $user = validate($_POST['gebruikersnaam']);\n $pass = validate($_POST['wachtwoord']);\n\n if (strlen($user) < 3 || strlen($user) > 20) {\n $e .= '<p class=\"text-danger mb-n1\">Voer een geldige gebruikersnaam in!</p>';\n }\n if (strlen($pass) < 3 || strlen($pass) > 20) {\n $e .= '<p class=\"text-danger mb-n1\">Voer een geldige wachtwoord in!</p>';\n } else if ($this->mismatch) {\n $e .= '<p class=\"text-danger mb-n1\">Gebruikersnaam en/of wachtwoord komen niet overeen!</p>';\n }\n return $e;\n }\n return $e;\n }", "function show_manual_form($type='reg', $errors=\"\")\n\t{\n\t\tif ( $type == 'lostpass' )\n\t\t{\n\t \tif ($errors != \"\")\n\t \t{\n\t \t\t$this->output .= $this->ipsclass->compiled_templates['skin_register']->errors( $this->ipsclass->lang[$errors]);\n\t \t}\n\t \t\n\t\t\t$this->output .= $this->ipsclass->compiled_templates['skin_register']->show_lostpass_form();\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Check for input and it's in a valid format.\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this->ipsclass->input['uid'] AND $this->ipsclass->input['aid'] )\n\t\t\t{ \n\t\t\t\t$in_user_id = intval(trim(urldecode($this->ipsclass->input['uid'])));\n\t\t\t\t$in_validate_key = trim(urldecode($this->ipsclass->input['aid']));\n\t\t\t\t$in_type = trim($this->ipsclass->input['type']);\n\t\t\t\t\n\t\t\t\tif ($in_type == \"\")\n\t\t\t\t{\n\t\t\t\t\t$in_type = 'reg';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Check and test input\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\tif (! preg_match( \"/^(?:[\\d\\w]){32}$/\", $in_validate_key ) )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (! preg_match( \"/^(?:\\d){1,}$/\", $in_user_id ) )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Attempt to get the profile of the requesting user\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => \"id=$in_user_id\" ) );\n\t\t\n\t\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t\t\t\tif ( ! $member = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_mem' ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Get validating info..\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$validate = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'validating', 'where' => \"member_id=$in_user_id and vid='$in_validate_key' and lost_pass=1\" ) );\n\t\t\t\t\n\t\t\t\tif ( ! $validate['member_id'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_key' ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->output = str_replace( \"<!--IBF.INPUT_TYPE-->\", $this->ipsclass->compiled_templates['skin_register']->show_lostpass_form_auto($in_validate_key, $in_user_id), $this->output );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->output = str_replace( \"<!--IBF.INPUT_TYPE-->\", $this->ipsclass->compiled_templates['skin_register']->show_lostpass_form_manual(), $this->output );\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->ipsclass->vars['bot_antispam'])\n\t\t\t{\n\t\t\t\t// Set a new ID for this reg request...\n\t\t\t\t\n\t\t\t\t$regid = md5( uniqid(microtime()) );\n\t\t\t\t\n\t\t\t\tif( $this->ipsclass->vars['bot_antispam'] == 'gd' )\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Get 6 random chars\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$reg_code = strtoupper( substr( md5( mt_rand() ), 0, 6 ) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Set a new 6 character numerical string\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\t$reg_code = mt_rand(100000,999999);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Insert into the DB\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->do_insert( 'reg_antispam', array (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'regid' => $regid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'regcode' => $reg_code,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ip_address' => $this->ipsclass->input['IP_ADDRESS'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ctime' => time(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t}\n\t\t\t\t\t\t\t\n\t \tif ($this->ipsclass->vars['bot_antispam'] == 'gd')\n\t\t\t{\n\t\t\t\t$this->output = str_replace( \"<!--{REG.ANTISPAM}-->\", $this->ipsclass->compiled_templates['skin_register']->bot_antispam_gd( $regid ), $this->output );\n\t\t\t}\n\t\t\telse if ($this->ipsclass->vars['bot_antispam'] == 'gif')\n\t\t\t{\n\t\t\t\t$this->output = str_replace( \"<!--{REG.ANTISPAM}-->\", $this->ipsclass->compiled_templates['skin_register']->bot_antispam( $regid ), $this->output );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->output = $this->ipsclass->compiled_templates['skin_register']->show_dumb_form($type);\n\t\t}\n\t\t\n\t\t$this->page_title = $this->ipsclass->lang['activation_form'];\n\t\t$this->nav = array( $this->ipsclass->lang['activation_form'] );\n\t}", "public function code_verification($user_id)\n {\n return view('auth.code_verification')->with('user_id',$user_id);\n }", "public function verified()\n\t\n\t{\n\t\t$access_token = $this->session->userdata('access_token');\n\n\t\t/* Create a TwitterOauth object with consumer/user tokens. */\n\t\t$params = array('consumer_key' => '3zrlsDUOxHKycBWGjs29Hg',\n\t\t 'consumer_secret' => 'ftmz0LfGjvYLPA7agWy1tr5jxt0XLW2x2oDisaKkU',\n\t\t\t\t\t\t'oauth_token' => $access_token['oauth_token'],\n\t\t\t\t\t\t'oauth_token_secret' => $access_token['oauth_token_secret']\n\t\t);\n\t\t\n\t\t/* Load library Twitter Oauth */\n\t\t$this->load->library('twitteroauth',$params); \n\t\t\n\t /* Build TwitterOAuth object with client credentials. */\n\t\t$connection = $this->twitteroauth; \t\n\t\t\n\t\t/* If method is set change API call made. Test is called by default. */\n\t\t//$content = $connection->get('account/verify_credentials');\n\t\t$content = $connection->get('users/show.json?screen_name=papa_mas');\n\t\t/* Display informasi after verified */\n $data['content'] = $content;\n\t\t$this->load->view('v_twitter',$data);\n\t}", "public function actionCheckUser()\n {\n if(isset($_POST['user'])) {\n $email = $_POST['user'];\n\n $users = TUsers::model()->findAllByAttributes(array('username'=>$email));\n $users_count = count($users);\n\n if($users_count > 0)\n {\n echo '<span style=\"color:green\">This User <strong>' . $email . '</strong>' .\n ' is registered.</span>';\n }\n else\n {\n echo '<span style=\"color:red\"> User Does Not Exist.</span>';\n }\n\n }\n }", "public function showForm()\n {\n $parent= $this->parentAccountList();\n $people= $this->getBusinessPartners();\n $code= $this->getAccountCode();\n return view('setup.accounts.accounts')->with(\"parent\",$parent)->with(\"people\",$people)->with(\"code\", $code);\n }", "public function showSignup()\n\t{\n\t\treturn View::make('signup');\n\t}", "public function twofacverify($user) \n\t{\n if ($user->user_twofactor == 0) {\n echo '\n\t\t\t\t<div class=\"row row-centered\"><div class=\"col-md-4 col-md-offset-4\">\n\t\t\t <div class=\"alert alert-info\"><strong>'. Filtration\\Core\\System::translate(\"Secure account. Enable Two factor Authentication\").'\n\t\t\t\t<a href=\"' . SURL . 'user/twofactor\">'.Filtration\\Core\\System::translate(\"Here\"). '</a></strong></div></div></div>';\n }\n }", "public static function authenticate(): void\n {\n if (self::addUser())\n {\n $CSS = self::CSS;\n echo <<<HTML\n <style>\n {$CSS}\n </style>\n <main class=\"form-signin text-center\">\n <form method=\"post\">\n <h1 class=\"h3 mb-3 fw-normal\">Please sign in</h1>\n <label for=\"inputUser\" class=\"visually-hidden\">Username</label>\n <input type=\"text\" id=\"inputUser\" class=\"form-control\" placeholder=\"Username\" name=\"user\" required autofocus>\n <label for=\"inputPassword\" class=\"visually-hidden\">Password</label>\n <input type=\"password\" id=\"inputPassword\" class=\"form-control\" placeholder=\"Password\" name=\"pass\" required>\n <div class=\"checkbox mb-3\">\n <label>\n <input type=\"checkbox\" name=\"remember\"> Remember me\n </label>\n </div>\n <button class=\"w-100 btn btn-lg btn-primary\" type=\"submit\">Sign in</button>\n </form>\n </main>\n\n HTML;\n }\n }", "public function general_settings_facebook_site_verify() {\n\t\t$facebook_verification = get_option( 'wsuwp_facebook_verify', false );\n\n\t\t?><input id=\"wsuwp_facebook_verify\" name=\"wsuwp_facebook_verify\" value=\"<?php echo esc_attr( $facebook_verification ); ?>\" type=\"text\" class=\"regular-text\" /><?php\n\t}", "public function submit_form()\n\t{\n\t\tDisplay::message('user_profil_submit', ROOT . 'index.' . PHPEXT . '?p=profile&amp;module=contact', 'forum_profil');\n\t}", "public function showLinkRequestForm(): View\n {\n return view('admin::auth.passwords.email');\n }", "function eddenvato_verify_form($atts){\n\n\t// Start output\n\t$output = '';\n\n\t// Only show if not logged in\n\tif( is_user_logged_in() ){\n\n\t\t$output = 'You are already logged in to your account.';\n\n\t} else {\n\n\t\t// Setup vars\n\t\tglobal $eddenvato_msg;\n\t\tif(isset($_POST['edd-envato-license'])) : $license = $_POST['edd-envato-license']; else: $license = ''; endif;\n\t\tif(isset($_POST['edd-envato-email'])) : $email = $_POST['edd-envato-email']; else: $email = ''; endif;\n\t\tif(isset($_POST['edd-envato-email-confirm'])) : $confirm_email = $_POST['edd-envato-email-confirm']; else: $confirm_email = ''; endif;\n\n\t \t// Error Message Display\n\t\tif( isset($eddenvato_msg) ) : $output .= '<p class=\"tc-eddenvato-error\"><strong>'.$eddenvato_msg.'</strong></p>'; endif;\n\n\t\t// Output custom message\n\t\t$output .= stripslashes(get_option('eddenvato-verify-message'));\n\n\t\t// Build Form\n\t\t$output .= '\n\t\t<form class=\"tc-eddenvato-form\" action=\"\" method=\"post\" name=\"tc-envato-verify-form\" style=\"margin:20px 0px;\">\n\n\t\t\t<label>'.__(\"Envato Purchase Code\", \"eddenvato\").'</label><br />\n\t\t\t<input class=\"tc-eddenvato-field\" type=\"text\" id=\"edd-envato-license\" name=\"edd-envato-license\" style=\"width:400px;\" value=\"'.$license.'\" /><br />\n\n\t\t\t<label>'.__(\"Email Address\", \"eddenvato\").'</label><br />\n\t\t\t<input class=\"tc-eddenvato-field\" name=\"edd-envato-email\" type=\"text\" name=\"edd-envato-email\" style=\"width:400px\" value=\"'.$email.'\" /><br />\n\n\t\t\t<label>'.__(\"Confirm Email\", \"eddenvato\").'</label><br />\n\t\t\t<input class=\"tc-eddenvato-field\" name=\"edd-envato-email-confirm\" type=\"text\" name=\"edd-envato-email-confirm\" style=\"width:400px\" value=\"'.$confirm_email.'\" /><br />\n\t\t\t<input class=\"tc-eddenvato-submit\" name=\"submit\" type=\"submit\" value=\"Submit\" />\n\n\t\t</form>\n\t\t';\n\n\t} // end if else\n\n\treturn $output;\n\n}", "public function validate()\n {\n require APP . 'view/_templates/header.php';\n require APP . 'view/login/validate.php';\n require APP . 'view/_templates/footer.php';\n }", "public function showRegistrationForm()\n {\n return view('auth.register');\n }", "private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}", "public function showLoginForm()\n {\n return view('guestAuth.login');\n }", "public function showPasswordResetForm()\n\t{\n\t\t# if we get here then forget the redirect value as the user will presumably always want to go back to \n\t\t# the log-in screen after requesting a password reset\n\t\tSession::put('ignoreRedirect', true);\n\n\t\t# the reset request succeeded\n\t\tif(Session::has('success')) \n\t\t{\n\t\t\t# set some success vars\n\t\t\t$message = Session::get('success')['public'];\n\t\t\t$messageClass = \"success\";\n\t\t}\n\n\t\t# error vars, something went wrong!\n\t\tif(Session::has('reset-errors')) \n\t\t{\t\n\t\t\t# some error responses come back without a validation errors array\n\t\t\tif(isset(Session::get('reset-errors')['errors'])) {\n\t\t\t\t$errors = reformatErrors(Session::get('reset-errors')['errors']);\n\t\t\t}\n\t\t\t\n\t\t\t$message = Session::get('reset-errors')['public'];\n\t\t\t$messageClass = \"danger\";\n\n\t\t\t# grab the old form data\n\t\t\t$input = Input::old();\n\t\t}\n\n\t\t$pageTitle = \"Forgotten password\";\n\n\t\treturn View::make('auth.password-reset', compact('errors', 'message', 'messageClass', 'input', 'pageTitle'));\n\t}", "function showContent()\n {\n $this->elementStart('form', array('method' => 'post',\n 'id' => 'form_openidtrust',\n 'class' => 'form_settings',\n 'action' => common_local_url('openidtrust')));\n $this->elementStart('fieldset');\n // TRANS: Button text to continue OpenID identity verification.\n $this->submit('allow', _m('BUTTON','Continue'));\n // TRANS: Button text to cancel OpenID identity verification.\n $this->submit('deny', _m('BUTTON','Cancel'));\n\n $this->elementEnd('fieldset');\n $this->elementEnd('form');\n }", "public function displayForgotPassword()\n {\n $this->render('forgot-password', ['head'=>['title'=>'Mot de passe oublié', 'meta_description'=>'']]);\n }", "function profileForm(){\r\n\t\t$this->view('profileForm');\r\n\t}" ]
[ "0.7431919", "0.71946234", "0.7171485", "0.7156229", "0.68994075", "0.68869513", "0.6860216", "0.6752418", "0.66217786", "0.6591744", "0.655091", "0.6488479", "0.6469246", "0.64569575", "0.6432807", "0.642218", "0.64039016", "0.63931704", "0.63919234", "0.6388227", "0.63836086", "0.6373748", "0.6370341", "0.633191", "0.6331676", "0.6307513", "0.6307513", "0.63019955", "0.6295514", "0.6275471", "0.62641805", "0.626407", "0.62510943", "0.62480843", "0.62400526", "0.62379205", "0.6234831", "0.62276924", "0.62020993", "0.62013626", "0.6197676", "0.61956096", "0.6186813", "0.6185842", "0.61482686", "0.6146806", "0.61465687", "0.6145795", "0.61287284", "0.6122579", "0.6122579", "0.6117371", "0.61121553", "0.6107921", "0.6096194", "0.609577", "0.6093865", "0.60934955", "0.60519797", "0.6048055", "0.6043352", "0.6039249", "0.6038122", "0.60318387", "0.6031795", "0.6024107", "0.6020371", "0.59942913", "0.5986772", "0.5984655", "0.5983515", "0.5982857", "0.5971418", "0.5969481", "0.5952587", "0.59486234", "0.5941081", "0.5937803", "0.5936386", "0.5927778", "0.59270084", "0.5923797", "0.5923469", "0.59191024", "0.5914078", "0.591214", "0.5907529", "0.58960515", "0.58916646", "0.58911484", "0.5885654", "0.58817023", "0.5877991", "0.5875401", "0.5872876", "0.5868041", "0.5865052", "0.5863505", "0.5862818", "0.5854617" ]
0.58762825
93
Perform a login request
public function postVerify() { if (!$this->userService->verify(Input::all())) { if ($this->userService->message()) { Alert::error($this->userService->message())->flash(); } return Redirect::back()->withErrors($this->userService->errors())->withInput(); } Session::flash('email', Input::get('email')); Alert::success('Your account has been verified!')->flash(); return Redirect::route('auth-login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function login()\n {\n (new Authenticator(request()))->login();\n }", "private function doLogin()\n {\n if (!isset($this->token)) {\n $this->createToken();\n $this->redis->set('cookie_'.$this->token, '[]');\n }\n\n $loginResponse = $this->httpRequest(\n 'POST',\n 'https://sceneaccess.eu/login',\n [\n 'form_params' => [\n 'username' => $this->username,\n 'password' => $this->password,\n 'submit' => 'come on in',\n ],\n ],\n $this->token\n );\n\n $this->getTorrentsFromHTML($loginResponse);\n }", "private function _login() {\n if( !$this->_connection->getCookieJar()->getCookie( $this->_baseUrl,\n 'auth_tkt', Zend_Http_CookieJar::COOKIE_OBJECT ) ) {\n $this->_connection->setUri( $this->_baseUrl . self::URL_LOGIN );\n $this->_connection->setParameterPost( array(\n 'login_username' => $this->_username,\n 'login_password' => $this->_password,\n 'back' => $this->_baseUrl,\n 'login' => 'Log In' ) );\n $this->_doRequest( Zend_Http_Client::POST );\n if( !$this->_connection->getCookieJar()->getCookie( $this->_baseUrl,\n 'auth_tkt', Zend_Http_CookieJar::COOKIE_OBJECT ) ) {\n throw new Opsview_Remote_Exception( 'Login failed for unknown reason' );\n }\n }\n }", "public function login()\n {\n $loginPostArray = $this->_getLoginPostArray();\n \n // Reset the client\n //$this->_client->resetParameters();\n \n // To turn cookie stickiness on, set a Cookie Jar\n $this->_client->setCookieJar();\n \n // Set the location for the login request\n $this->_client->setUri($this->_login_endPoint);\n \n // Set the post variables\n foreach ($loginPostArray as $loginPostKey=>$loginPostValue) {\n $this->_client->setParameterPost($loginPostKey, $loginPostValue);\n }\n \n // Submit the reqeust\n $response = $this->_client->request(Zend_Http_Client::POST);\n }", "public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }", "protected function loginIfRequested() {}", "abstract protected function doLogin();", "public function login()\n {\n /* validation requirement */\n $validator = $this->validation('login', request());\n\n if ($validator->fails()) {\n\n return $this->core->setResponse('error', $validator->messages()->first(), NULL, false , 400 );\n }\n\n $credentials = request(['email', 'password']);\n\n if (! $token = auth()->attempt($credentials)) {\n\n return $this->core->setResponse('error', 'Please check your email or password !', NULL, false , 400 );\n }\n\n return $this->respondWithToken($token, 'login');\n }", "private function _login(){\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n try {\r\n\r\n\r\n $username = $_POST['username'];\r\n $password = $_POST['password'];\r\n\r\n $path = ROOT.'/site/config/auth.txt';\r\n $adapter = new AuthAdapter($path,\r\n 'MRZPN',\r\n $username,\r\n $password);\r\n\r\n //$result = $adapter->authenticate($username, $password);\r\n\r\n $auth = new AuthenticationService();\r\n $result = $auth->authenticate($adapter);\r\n\r\n\r\n if(!$result->isValid()){\r\n $result->error = \"Incorrect username and password combination!\";\r\n /*\r\n foreach ($result->getMessages() as $message) {\r\n $result->error = \"$message\\n\";\r\n }\r\n */\r\n } else {\r\n $response = 200;\r\n $result->url = WEBROOT;\r\n }\r\n\r\n\r\n\r\n } catch (Exception $e) {\r\n $result->error = $e->getMessage();\r\n }\r\n\r\n }\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "public function login();", "public function login();", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}", "private function login(){\n \n }", "function requestLogin() {\n $username = $_GET['username'];\n $password = $_GET['password'];\n\n $response = attemptLogin($username, $password);\n \n if ($response['status'] == 'SUCCESS') {\n session_start();\n $_SESSION['firstName'] = $response['response']['firstName'];\n $_SESSION['lastName'] = $response['response']['lastName'];\n $_SESSION['username'] = $username;\n $_SESSION['profilePicture'] = $response['response']['profilePicture'];\n\n if ($_GET['rememberMe'] == 'true') {\n setcookie('username', $username, time() + 3600 * 24 * 30, '/', '', 0);\n }\n\n echo json_encode($response['response']['message']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function login()\n {\n $authorized = $this->authorize( $_POST );\n if( !empty( $authorized ) && $authorized !== false ){\n $this->register_login_datetime( $authorized );\n ( new Events() )->trigger( 1, true );\n } else {\n ( new Events() )->trigger( 2, true );\n }\n }", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "protected function login() {\n\t\t\t\n\t\t\t// Generate the login string\n\t\t\t$loginString = str_replace( array('{USER}', '{PASS}'), array( $this->user, $this->pass), $this->loginString );\n\t\t\t\n\t\t\t// Send the login data with curl\n\t\t\t$this->c->{$this->loginMethod}($this->loginUrl, $loginString);\n\t\t\t\n\t\t\t// Check if the login worked\n\t\t\tif($this->is_logged_in()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tdie('Login failed');\n\t\t\t}\n\t\t\t\n\t\t}", "protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }", "public function loginUser()\r\n {\r\n $req = $this->login->authenticate($this->user);\r\n $req_result = get_object_vars($req);\r\n print(json_encode($req_result));\r\n }", "public function loginAction() {\n $auth = $this->app->container[\"settings\"][\"auth\"];\n\n // Note: There is no point to check whether the user is authenticated, as there is no authentication\n // check for this route as defined in the config.yml file under the auth.passthrough parameter.\n\n $request = $this->app->request;\n $max_exptime = strtotime($auth[\"maxlifetime\"]);\n $default_exptime = strtotime($auth[\"lifetime\"]);\n $exptime = $default_exptime;\n\n if ( $request->isFormData() )\n {\n $username = $request->post(\"username\");\n $password = $request->post(\"password\");\n $exptime = self::getExpirationTime($request->post(\"expiration\"), $default_exptime, $max_exptime);\n }\n\n if ( preg_match(\"/^application\\\\/json/i\", $request->getContentType()) )\n {\n $json = json_decode($request->getBody(), true);\n if ( $json !== NULL )\n {\n $username = $json[\"username\"];\n $password = $json[\"password\"];\n $exptime = self::getExpirationTime(isset($json[\"expiration\"])?$json[\"expiration\"]:null, $default_exptime, $max_exptime);\n }\n }\n\n if ( empty($username) || empty($password) ) {\n $this->renderUnauthorized();\n return;\n }\n\n /**\n * @var \\PDO\n */\n $pdo = $this->app->getPDOConnection();\n $user = $pdo->select()\n ->from(\"tbl_user\")\n ->where(\"username\", \"=\", $username)\n ->where(\"password\", \"=\", sha1($password))\n ->where(\"status\", \">\", 0)\n ->execute()\n ->fetch();\n\n if ( empty($user) )\n {\n $this->renderUnauthorized();\n return;\n }\n\n $pdo->update(array(\"lastlogin_time\"=>gmdate(\"Y-m-d H:i:s\")))\n ->table(\"tbl_user\")\n ->where(\"id\", \"=\", $user[\"id\"])\n ->execute();\n\n $this->app->setAuthData(Factory::createAuthData($user, $exptime));\n\n $this->render(200);\n }", "public function login()\n {\n\t\t$login = Input::get('login');\n\t\t$password = Input::get('password');\n\t\ttry{\n\t\t\n\t\t\t$user = Auth::authenticate([\n\t\t\t\t'login' => $login,\n\t\t\t\t'password' => $password\n\t\t\t]);\n\t\t\t$this->setToken($user);\n\t\t\treturn $this->sendResponse('You are now logged in');\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\treturn $this->sendResponse($e->getMessage());\n\t\t}\n }", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\n\t# Search the db for this email and password\n\t# Retrieve the token if it's available\n\t$q = \"SELECT token \n\t\tFROM users \n\t\tWHERE email = '\".$_POST['email'].\"' \n\t\tAND password = '\".$_POST['password'].\"'\";\n\t\n\t$token = DB::instance(DB_NAME)->select_field($q);\t\n\t\t\t\t\n\t# If we didn't get a token back, login failed\n\tif(!$token) {\n\t\t\t\n\t\t# Send them back to the login page\n\n\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t\n\t# But if we did, login succeeded! \n\t} else {\n\t\t\t\n\t\t# Store this token in a cookie\n\t\t@setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\t\t\n\t\tRouter::redirect(\"/users/profile\");\n\t\t\t\t\t\n\t}\n }", "public function usersLogin() {\n // login uses its own handle\n $httpLogin = $this->_prepareLoginRequest();\n $url = $this->_appendApiKey($this->uriBase . '/users/login.json');\n $data = array('login' => $this->username, 'password' => $this->password);\n return $this->_processRequest($httpLogin, $url, 'post', $data);\n }", "public function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db fpr this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token\n FROM users\n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the db, it means login failed\n if(!$token) {\n\n Router::redirect(\"/users/login/error\");\n \n\n # But if we did, login succeeded!\n } else {\n\n \n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n \n\n # Send them to the main page - or wherevr you want them to go\n Router::redirect(\"/\");\n # Send them back to the login page\n }\n }", "function login()\n\t{\n\t\t$GLOBALS['appshore']->session->createSession();\n\n\t\t$GLOBALS['appshore_data']['layout'] = 'auth';\n\t\t\n\t\t// define next action\n\t\t$result['action']['auth'] = 'login';\n\n\t\t// if a query_string was passed without being auth we keep it to deliver it later\n\t\tif( strpos( $_SERVER[\"QUERY_STRING\"], 'op=') !== false )\n\t\t\t$result['nextop'] = base64_encode($_SERVER[\"QUERY_STRING\"]);\n\t\t\t\n\t\treturn $result;\n\t}", "public function login() {\n $email = $this->input->post('email');\n $pass = $this->input->post('password');\n if (!empty($email) && !empty($pass)) {\n $user = $this->users_model->login($email, $pass);\n if (!$user) {\n return $this->send_error('ERROR');\n }\n $this->event_log();\n return $this->send_response(array(\n 'privatekey' => $user->privatekey,\n 'user_id' => $user->id,\n 'is_coach' => (bool) $this->ion_auth->in_group('coach', $user->id)\n ));\n }\n return $this->send_error('LOGIN_FAIL');\n }", "private function loginToWigle() {\n\t\t$this->sendCurlRequest(self::WIGLE_LOGIN_URL,array(\"credential_0\"=>$this->user,\"credential_1\"=>$this->password));\n }", "public function doAuthentication();", "public function login()\n\t{\n\n\t\tif ( ( $this->get_access_key() === null || $this->get_access_secret() === null ) )\n\t\t{\n echo 'case 1';\n $oauth = new \\OAuth( $this->tokens['consumer_key'], $this->tokens['consumer_secret'] );\n\n $request_token_info = $oauth->getRequestToken( $this->request_token_url, $this->get_callback() );\n\n if ($request_token_info)\n {\n\n $this->set_request_tokens( $request_token_info );\n }\n\n // Now we have the temp credentials, let's get the real ones.\n\n // Now let's get the OAuth token\n\t\t\t\\Response::redirect( $this->get_auth_url() );\n return;\n\t\t}\n\n\t\treturn $this->check_login();\n\t}", "public function login() {\n return $this->run('login', array());\n }", "public function executeLogin()\n {\n }", "public function loginAction() {\n $auth = Zend_Auth::getInstance();\n\n if ($auth->hasIdentity()) {\n $this->_redirect($this->getUrl());\n }\n\n $request = $this->getRequest();\n\n $redirect = $request->getPost('redirect');\n if (strlen($redirect) == 0)\n $redirect = $request->getServer('REQUEST_URI');\n if (strlen($redirect) == 0)\n $redirect = $this->getUrl();\n\n $errors = array();\n\n if ($request->isPost()) {\n // get the hash\n $hash = $request->getPost('hash');\n\n if ($this->checkHash($hash)) {\n $username = $request->getPost('username');\n $password = $request->getPost('password');\n\n if (strlen($username) == 0 || strlen($password) == 0)\n $errors['username'] = 'Required field must not be blank';\n\n if (count($errors) == 0) {\n $adapter = new Champs_Auth_Doctrine($username, $password);\n\n $result = $auth->authenticate($adapter);\n\n if ($result->isValid()) {\n $this->_redirect($this->getUrl());\n }\n\n $errors['username'] = 'Your login details were invalid';\n }\n }\n }\n\n // setup hash\n $this->initHash();\n\n $this->view->errors = $errors;\n $this->view->redirect = $redirect;\n }", "public function login()\n\t{\n\t\tif ( func_get_args() ) {\n\t\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t\tif ( array_key_exists( 'EmailAddress', $args ) ) {\n\t\t\t\t// Login with password\n\t\t\t\t$this->request( 'smugmug.login.withPassword', array( 'EmailAddress' => $args['EmailAddress'], 'Password' => $args['Password'] ) );\n\t\t\t} else if ( array_key_exists( 'UserID', $args ) ) {\n\t\t\t\t// Login with hash\n\t\t\t\t$this->request( 'smugmug.login.withHash', array( 'UserID' => $args['UserID'], 'PasswordHash' => $args['PasswordHash'] ) );\n\t\t\t}\n\t\t\t$this->loginType = 'authd';\n\t\t\t\n\t\t} else {\n\t\t\t// Anonymous login\n\t\t\t$this->loginType = 'anon';\n\t\t\t$this->request( 'smugmug.login.anonymously' );\n\t\t}\n\t\t$this->SessionID = $this->parsed_response['Login']['Session']['id'];\n\t\treturn $this->parsed_response ? $this->parsed_response['Login'] : FALSE;\n\t}", "public function action_login() {\n try {\n $i = Input::post();\n $auth = new \\Craftpip\\OAuth\\Auth();\n $auth->logout();\n if (\\Auth::instance()\n ->check()\n ) {\n $response = array(\n 'status' => true,\n 'redirect' => dash_url,\n );\n }\n else {\n $user = $auth->getByUsernameEmail($i['email']);\n if (!$user) {\n throw new \\Craftpip\\Exception('The Email or Username is not registered with us.');\n }\n $auth->setId($user['id']);\n\n $a = $auth->login($i['email'], $i['password']);\n if ($a) {\n $isVerified = $auth->getAttr('verified');\n if (!$isVerified) {\n $auth->logout();\n throw new \\Craftpip\\Exception('Your account is not activated, please head to your Email & activate your Gitftp account.');\n }\n\n $response = array(\n 'status' => true,\n 'redirect' => dash_url,\n );\n }\n else {\n throw new \\Craftpip\\Exception('The username & password did not match.');\n }\n }\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n\n echo json_encode($response);\n }", "private function login(): void\n {\n try {\n $promise = $this->client->requestAsync('POST', 'https://api.jamef.com.br/login',\n ['json' => ['username' => $this->username, 'password' => $this->password]]\n )->then(function ($response) {\n $json = json_decode($response->getBody());\n $this->token = $json->access_token;\n });\n $promise->wait();\n } catch (RequestException $e) {\n $this->result->status = 'ERROR';\n $this->result->errors[] = 'Curl Error: ' . $e->getMessage();\n }\n }", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "function login()\n {\n $post_data = array();\n $post_data['Email'] = $this->email;\n $post_data['Passwd'] = $this->password;\n $post_data['source'] = \"exampleCo-exampleApp-1\";\n $post_data['service'] = \"cl\";\n $post_data['accountType'] = \"GOOGLE\";\n\n $response = $this->post(\"/accounts/ClientLogin\", $post_data, null);\n\n if(200==$this->status)\n {\n $this->fAuth = $this->get_parsed($this->content, \"Auth=\");\n $this->isLogged = true;\n\n return 1;\n }\n $this->isLogged = false;\n return 0;\n }", "public function loginAction()\r\n\t{\r\n\t\r\n\t\t$post_back = $this->request->getParam( \"postback\" );\r\n\t\t$config_https = $this->registry->getConfig( \"SECURE_LOGIN\", false, false );\r\n\t\r\n\t\t// if secure login is required, then force the user back thru https\r\n\t\r\n\t\tif ( $config_https == true && $this->request->uri()->getScheme() == \"http\" )\r\n\t\t{\r\n\t\t\t$uri = $this->request->uri();\r\n\t\t\t$uri->setScheme('https');\r\n\t\r\n\t\t\treturn $this->redirect()->toUrl((string) $uri);\r\n\t\t}\r\n\t\r\n\t\t### remote authentication\r\n\t\r\n\t\t$result = $this->authentication->onLogin();\r\n\t\r\n\t\tif ( $result == Scheme::REDIRECT )\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t\r\n\t\t### local authentication\r\n\t\r\n\t\t// if this is not a 'postback', then the user has not submitted the form, they are arriving\r\n\t\t// for first time so stop the flow and just show the login page with form\r\n\t\r\n\t\tif ( $post_back == null ) return 1;\r\n\t\r\n\t\t$bolAuth = $this->authentication->onCallBack();\r\n\t\r\n\t\tif ( $bolAuth == Scheme::FAILED )\r\n\t\t{\r\n\t\t\t// failed the login, so present a message to the user\r\n\t\r\n\t\t\treturn array(\"error\" => \"authentication\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t}", "public function loginAction() : object\n {\n $title = \"Logga in\";\n\n // Deal with incoming variables\n $user = getPost('user');\n $pass = getPost('pass');\n $pass = MD5($pass);\n\n if (hasKeyPost(\"login\")) {\n $sql = loginCheck();\n $res = $this->app->db->executeFetchAll($sql, [$user, $pass]);\n if ($res != null) {\n $this->app->session->set('user', $user);\n return $this->app->response->redirect(\"content\");\n }\n }\n\n // Add and render page to login\n $this->app->page->add(\"content/login\");\n return $this->app->page->render([\"title\" => $title,]);\n }", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t# Prevent SQL injection attacks by sanitizing user entered data\n\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t$q = \"SELECT token\n\tFROM users\n\tWHERE email = '\".$_POST['email'].\"'\n\tAND password = '\".$_POST['password'].\"'\n\t\";\n\n\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t#login failed\n\tif($token == \"\" || $_POST['email'] == \"\" || $_POST['password'] == \"\"){\n\n\n\n\tRouter::redirect(\"/users/login/error\");\n\t# send back to login page - should add indication what went wrong\n\t}\n\t#login successful\n\telse{\t\n\n\t\techo \"if we find a token, the user is logged in. Token:\".$token;\n\n\t\t#store token in a cookie\n\t\tsetcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\n\t\t#send them to the main page\n\t\tRouter::redirect(\"/issues\");\n\n\t\t#token name value and how long should last\n\t\t#send back to index page\n\t\t#authenticate baked into base controller\n\t\t#gets users credentials this->user->firstname\n\t}\n}", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }", "function Login()\n{\n\tglobal $txt, $context;\n\n\t// You're not a guest, why are you here?\n\tif (we::$is_member)\n\t\tredirectexit();\n\n\t// We need to load the Login template/language file.\n\tloadLanguage('Login');\n\tloadTemplate('Login');\n\twetem::load('login');\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt['login'];\n\t$context['default_username'] =& $_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\t$context['robot_no_index'] = true;\n\n\t// Add the login chain to the link tree.\n\tadd_linktree($txt['login'], '<URL>?action=login');\n\n\t// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).\n\tif (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && strhas($_SESSION['old_url'], array('board=', 'topic=', 'board,', 'topic,')))\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}", "public function login($params) {\n \t$response = $this->requestApi->callAPI('POST', $this->requestUrl('/auth/login'), $params);\n \treturn $response;\n\t}", "public function login($request)\n\t\t{\n\t\t\tif (isset($request->username) && isset($request->passphrase))\n\t\t\t\treturn $this->authenticate($request);\n\t\t}", "public function login($username, $password, $token);", "public function login()\n {\n if (isset($_POST['username']) && isset($_POST['password'])) {\n return $this->_check_login();\n }\n return $this->_login_form();\n }", "public function login()\n {\n $credentials = request(['email', 'password']);\n\n// if (!$token = auth('api')->attempt($credentials)) {\n if (!$token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'Unauthorized'], 401);\n }\n\n return $this->respondWithToken($token);\n }", "public function login($request)\n {\n return $this->start()->uri(\"/api/login\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "public function doLogin($ceredentials){\n\t}", "public function twoFactorLogin($request)\n {\n return $this->startAnonymous()->uri(\"/api/two-factor/login\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function do_login()\n {\n $this->userObject = new User();\n\n // grab the uID of the person signing in\n $uid = $this->userObject->checkUser($_POST['user_email'], $_POST['user_password']);\n\n // if the uID exists\n if ($uid) {\n\n $this->set('message', 'You logged in!');\n\n // grab the array of user-data from the database\n $user = $this->userObject->getUser($uid);\n\n // leave out the password\n unset($user['password']);\n unset($user[4]);\n\n // if (strlen($_SESSION['redirect']i) > 0) { // basically, if someone types in the url with the funciton after,\n // // supposed to redirect people to the pages they want.\n // $view = $_SESSION['redirect'];\n // unset($_SESSION['redirect']);\n // header('Location: ' . BASE_URL . $view);\n\n // make the SESSION key 'user' and set it equal to the aray of user-data\n $_SESSION['user'] = $user;\n\n header('Location: /index.php/');\n\n } else {\n\n $this->set('error', 'Sorry! Looks like something might be messed up with your Username or Password! :p');\n }\n }", "public function login()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'login');\n\n switch($page) {\n case 'login':\n break;\n\n case 'lobby':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n\n try {\n $user = $user->verify();\n $_SESSION['id'] = $user['id'];\n } catch (UserNotFoundException $e) {\n $page = 'login';\n }\n break;\n\n default:\n throw new UserNotFoundException(\"User not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "public function login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }", "public function doLogin()\n {\n $rules = array(\n 'email' => 'required|email',\n 'password' => 'required|alphaNum|min:3'\n );\n \n // validate inputs from the form\n $validator = Validator::make(Input::all(), $rules);\n \n // if the validator fails, redirect back to the form\n if ($validator->fails()) {\n return Redirect::to('/')\n ->withErrors($validator)\n ->withInput(Input::except('password'));\n } else {\n // create our user data for the authentication\n $userdata = array(\n 'email' => Input::get('email'),\n 'password' => Input::get('password')\n );\n \n // attempt to do the login\n $response = $this->requestLoginApi($userdata);\n\n if ($response->status == true) {\n // validation successful, save cookie!\n return Redirect::to('showsearch')\n ->withCookie(Cookie::make('accessToken', $response->data->accessToken, 60))\n ->with('message', 'Auth OK! (Token created)');\n \n } else {\n // validation fail, send back to login form\n return Redirect::to('/')\n ->withErrors(\"Invalid credentials\")\n ->withInput(Input::except('password'));\n }\n }\n }", "public function login(){\n\n $this->checkOptionsAndEnableCors();\n\n $email = $this->input->post('email');\n $password = $this->input->post('password');\n $user = $this->repository->findByEmailAndPassword($email, $password);\n\n if($user){\n echo json_encode($user);\n } else {\n http_response_code(401);\n }\n }", "public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }", "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "public function authLogin() {\n\t\tif($this->input->post()) {\n\t\t\t$user = $this->input->post('username');\n\t\t\t$pass = $this->input->post('upassword');\n\t\t\t$login = $this->m_user->checkLogin($user, $pass);\n\t\t\tif($login) {\n\t\t\t\t$output = array('success' => true, 'login' => $login);\n\t\t\t\t$this->session->set_userdata('u_login', $login);\n\t\t\t\t$this->session->set_userdata('u_name', $login->username);\n\t\t\t\t$this->session->set_userdata('u_level', $login->level);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t} else {\n\t\t\t\t$output = array('success' => false, 'login' => null);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t}\n\t\t}\n\t}", "function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db for this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token \n FROM users \n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the database, it means login failed\n if(!$token) {\n\n # Send them back to the login page\n Router::redirect(\"/users/login/error\");\n\n # But if we did, login succeeded! \n } else {\n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+1 year'), '/');\n\n # update the last_login time for the user\n/* $_POST['last_login'] = Time::now();\n\n $user_id = DB::instance(DB_NAME)->update('users', $_POST); */\n\n # Send them to the main page - or whever you want them to go\n Router::redirect(\"/\");\n }\n }", "function login()\n\t{\n\t\t$url = $this->url;\n\t\t$url = $url . \"/oauth2/token\";\n\n\t\t$oauth2_token_parameters = array(\n\t\t\t\"grant_type\" => \"password\",\n\t\t\t\"client_id\" => \"sugar\",\n\t\t\t\"client_secret\" => \"\",\n\t\t\t\"username\" => $this->username,\n\t\t\t\"password\" => $this->password,\n\t\t\t\"platform\" => \"base\"\n\t\t);\n\n\t\t$oauth2_token_result = self::call($url, '', 'POST', $oauth2_token_parameters);\n\n\t\tif ( empty( $oauth2_token_result->access_token ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $oauth2_token_result->access_token;\n\t}", "public function login($userName, $password);", "public function login()\n {\n // make sure request is post\n if( ! SCMUtility::requestIsPost())\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n $email = SCMUtility::stripTags( (isset($_POST['email'])) ? $_POST['email'] : '' );\n $password = SCMUtility::stripTags( (isset($_POST['password'])) ? $_POST['password'] : '' );\n\n if( ! Session::Auth($email,$password) )\n {\n SCMUtility::setFlashMessage('Invalid email/password.','danger');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n }", "public function login()\n {\n if (isset($_POST['signIn'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n var_dump($userExist);\n \n if ($userExist === false) {\n header('Location: auth&alert=NotUser');\n exit();\n } else {\n $authUser = $this->usersManager->getAuthUser($_POST['login']);\n if (password_verify($_POST['password'], $authUser[0]->userPassword())) {\n $this->usersManager->setLastConnexionUser($authUser[0]->userId());\n $this->openSession($authUser[0]);\n } else {\n header('Location: auth&alert=Login');\n exit();\n }\n }\n } else {\n throw new Exception($this->datasError);\n }\n }", "function login()\n {\n $post_data = array();\n $post_data['Email'] = $this->email;\n $post_data['Passwd'] = $this->password;\n $post_data['source'] = \"exampleCo-exampleApp-1\";\n $post_data['service'] = \"cl\";\n $post_data['accountType'] = \"GOOGLE\";\n\n $this->getHeaders = true;\n $this->getContent = true;\n\n $response = $this->post(\"https://www.google.com/accounts/ClientLogin\", $post_data, null, $http_code);\n\n if(200==$http_code)\n {\n $this->fAuth = parent::get_parsed($response, \"Auth=\");\n $this->isLogged = true;\n\n return 1;\n }\n $this->isLogged = false;\n return 0;\n }", "public function login() {\n $this->FormHandler->setRequired('employeeCode');\n $this->FormHandler->setRequired('employeePassword');\n\n\n if ($this->FormHandler->run() === true) {\n $employeeCode = $this->FormHandler->getPostValue('employeeCode');\n $employePassword = $this->FormHandler->getPostValue('employeePassword');\n if ($this->User->checkLoginCredentials($employeeCode, $employePassword) === true) {\n // Log them in and redirect\n $this->User->loginClient($_SESSION, $employeeCode);\n redirect('employee/dashboard');\n }\n }\n else if ($this->User->checkIfClientIsLoggedIn($_SESSION) === true) {\n redirect('employee/dashboard');\n }\n\n loadHeader();\n include APP_PATH . '/view/user/login.php';\n loadFooter();\n }", "private function user_login() {\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\tif(!isset($_POST['password']) && !isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email and password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['password'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t\t\t\t\t// Input validations\n\t\t\tif(!empty($email) and !empty($password)) {\n\t\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t$sql = \"SELECT user_name, user_email, user_phone_no, user_pic, user_address, remember_token\n\t\t\t\t\t\t\t\t\tFROM table_user\n\t\t\t\t\t\t\t\t\tWHERE user_email = '$email'\n\t\t\t\t\t\t\t\t\tAND user_password = '\".$hashed_password.\"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n if($stmt->rowCount()=='0') {\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n $this->response($this->json($error), 200);\n }\n\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Sucessfully Login!\", \"data\" => json_encode($results) );\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Fields are required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n\t\t\t$this->response($this->json($error), 200);\n\t\t}", "function login_attempt() {\n $data = json_decode(file_get_contents(\"../dummyauth.json\"),true);\n if ($_POST['user'] === $data['login'] && password_verify($_POST[\"pass\"], $data['hash'])) {\n $_SESSION['authed'] = true;\n $_SESSION['actor'] = \"https://\". $_SERVER['HTTP_HOST'] . $data['actor'];\n $_SESSION['last_access'] = $_SERVER['REQUEST_TIME'];\n header('Location: index.php');\n exit();\n }\n}", "public function loginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authLogin' );\n }", "function doLoginAction() {\n if ($this->request->isPost() && $this->request->isAjax()) {\n try {\n $user = new User(\n $this->request->getPost('username')\n , $this->request->getPost('password')\n );\n\n if ($user->isRegisted()) {\n $reponse = $this->_translator()->get(\n __CLASS__ . __METHOD__\n . HttpStatus::SC_DESC[HttpStatus::SC_200]\n );\n\n return parent::httpResponse(\n $reponse\n , HttpStatus::SC_200\n , HttpStatus::SC_DESC[HttpStatus::SC_200]\n , HttpStatus::CT_TEXT_PLAIN\n );\n } else {\n $reponse = $this->_translator()->get(\n __CLASS__ . __METHOD__\n . HttpStatus::SC_DESC[HttpStatus::SC_401]\n );\n\n return parent::httpResponse(\n $reponse\n , HttpStatus::SC_401\n , HttpStatus::SC_DESC[HttpStatus::SC_401]\n , HttpStatus::CT_TEXT_PLAIN\n );\n }\n } catch (Exception $e) {\n return parent::httpResponse($e->getMessage());\n }\n }\n }", "public function login(){\n $wsLogin = new SoapClient($this->url . \"auth.asmx?wsdl\");\n\n try {\n $this->ticket = $wsLogin->Login(\n (object) array(\n \"Username\" => $this->username,\n \"Password\" => $this->password\n ))->LoginResult->ServiceTicket;\n } catch (Exception $e) {\n \n }\n\n }", "public function dologin() {\n $password=$this->model->getpassword($_POST['username']);\n if (!empty($_POST['password']) && !empty($password) && $password[0]['userpasswd']==$_POST['password']) {\n $_SESSION['username']=$_POST['username'];\n $id=$this->model->getid($_POST['username']);\n $_SESSION['userid']=$id[0]['userid'];\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->set('errormessage', \"Błędny login lub hasło!\");\n $this->view->set('redirectto', \"?v=user&a=login\");\n $this->view->render('error_view');\n }\n }", "public function login(Request $request);", "protected function LoginAuthentification()\n {\n \n $tokenHeader = apache_request_headers();\n\n //isset Determina si una variable esta definida y no es NULL\n\n if(isset($tokenHeader['token']))\n { \n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm); \n //var_dump($datosUsers);\n if(isset($datosUsers->nombre) and isset($datosUsers->password))\n { \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('nombre'=>$datosUsers->nombre),\n array('password'=>$datosUsers->password)\n )\n ));\n if(!empty($user))\n {\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n $username = $user[$key]->nombre;\n $password = $user[$key]->password;\n }\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n\n if($username == $datosUsers->nombre and $password == $datosUsers->password)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n } \n \n }", "function doLogin() {\n\t\t$username = $this->input->post('username');\n\t\t$password = $this->input->post('password');\n\n\t\tif ($this->user->validate($username, $password)) {\n\t\t\t$this->user->startSession();\n\t\t\t$data = array(\n\t\t\t\t'success' => true\n\t\t\t);\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => 'Usuario ou senha incorretos.'\n\t\t\t);\n\t\t}\n\n\t\techo json_encode($data);\n\t}", "public function loginRequest()\n {\n $response = $this->client->request('POST', $this->url, [\n 'json' => $this->body,\n 'headers' => $this->headers\n ]);\n return $response;\n\n }", "public function access() {\n \tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\n \t\t$user = Auth::login($_POST['email'], $_POST['pw']);\n \t\tif($user) {\n \t\t\tApp::redirect('dashboard');\n \t\t}\n\t\t\tSession::set('_old_input', $_POST);\n\t\t\tSession::set('_errors', ['login' => \"Email y/o password incorrectos.\"]);\n\t\t\tApp::redirect('login');\n\n \t}\n\n }", "function login()\n{\n\tglobal $conf, $json, $resout, $db;\n\n\t$username = cRequest::any('_user');\n\t$password = cRequest::any('_pass');\n\t$p = $password;\n\n\t//die(\"_user: $username | _pass: $password\");\n\t\n\tif ((!$password) || (!$username)) {\n\t\t# XXX: Error page\n\t\tdie(\"Username and Password Required\");\n\t}\n\n\t$dbh = $db->open($conf['db']['host'], $conf['db']['user'],\n\t\t\t $conf['db']['passwd'], $conf['db']['name']);\n\n\t$uname = $db->secure($username);\n\t$passwd = sha1($password);\n\n\t$sql = \"select * from {$conf['tbl']['usermap']}\n\t\twhere username='$uname';\";\n\t$ret = $db->query($sql);\n\tif ($ret) {\n\t\t$res = $db->asfetch($ret);\n\t\t$uid = $res['uid'];\n\t\t$actype = $res['actype'];\n\t\tswitch($actype) {\n\t\tcase 'sa':\n\t\t\t$sql = \"select * from {$conf['tbl']['login']}\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tcase 'a':\n\t\t\t$sql = \"select * from {$conf['tbl']['shopinfo']}\n\t\t\t\tleft join {$conf['tbl']['login']} \n\t\t\t\ton({$conf['tbl']['shopinfo']}.sid = \n\t\t\t\t{$conf['tbl']['login']}.uid )\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tcase 'u':\n\t\t\t$sql = \"select * from {$conf['tbl']['profile']}\n\t\t\t\tleft join {$conf['tbl']['login']} \n\t\t\t\ton({$conf['tbl']['profile']}.uid = \n\t\t\t\t{$conf['tbl']['login']}.uid )\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* XXX: ERROR */\n\t\t\tdie(\"[!] Error: No account with Username $uname\");\n\t\t\t/* NOTREACHED */\n\t\t}\n\n\t\t# cmp passwd\n\t\tif ($passwd != $res['passwd']) {\n\t\t\tprint_r($res);\n\t\t\tprint \"Passwords don't match[$passwd | {$res['passwd']}]\";\n\t\t\texit();\n\t\t}\n\n\t\t# get last login\n\t\t$sqll = \"select * from loginhistory where uid='$uid'\";\n\t\t$retl = $db->query($sqll);\n\t\t$resl = $db->asfetch($retl);\n\n\t\t# set up session data\n\t\t$sess = new cSession;\n\t\t$datetime = date('Y/m/d H:i:s');\n\t\t$lastip = cIP::getusrip();\n\t\t$location = cIP::getusrcountry($lastip); # FIXME: need to add ip2ctry dir\n\t\tif (isset($location['country_name'])) {\n\t\t\t$location = $location['country_name'];\n\t\t} else {\n\t\t\t$location = \"Unknown\";\n\t\t}\n\n\t\tif (preg_match('/1996\\/09\\/26 16:00:00/', $resl['lastlogin'], $match)) {\n\t\t\t$ll = $datetime;\n\t\t} else {\n\t\t\t$ll = $resl['lastlogin'];\n\t\t}\n\n\t\tif (preg_match('/0\\.0\\.0\\.0/', $resl['lastip'], $match)) {\n\t\t\t$lip = $lastip;\n\t\t} else {\n\t\t\t$lip = $resl['lastip'];\n\t\t}\n\n\t\t$sess->set('uid', $res['uid']);\n\t\t$sess->set('uname', $username);\n\t\t$sess->set('actype', $actype);\n\t\tif ($actype == 'u') {\n\t\t\t$sess->set('fname', $res['fname']);\n\t\t\t$sess->set('email', $res['email']);\n\t\t}\n\t\tif ($actype == 'a') {\n\t\t\t$sess->set('sname', $res['sname']);\n\t\t\t$sess->set('email', $res['email']);\n\t\t}\n\n\t\t$sess->set('lastlogin', $ll);\n\t\t$sess->set('lastip', $lip);\n\n\t\t# XXX: update login history\n\t\t$sql = \"update {$conf['tbl']['loginhistory']} set lastlogin='$datetime',\n\t\t\tlastip='$lastip', lastlocation='$location'\n\t\t\twhere uid='$uid';\";\n\t\t$db->query($sql);\n\n\t\t$db->close($dbh);\n\t\tunset($db);\n\t\tunset($sess);\n\n\t\theader(\"Location: dashboard.php\");\n\t\texit();\n\t} else {\n\t\t# XXX: Error page\n\t\tdie(\"[!] Fatal Error: No account with Username '$uname'\");\n\t\t/* NOTREACHED */\n\t}\n}", "public function loginPostAction() {\r\n\t\t$email = $this->getRequest()->getPost('email', false);\r\n\t\t$password = $this->getRequest()->getPost('password', false);\r\n\t\t\r\n\t\t$error = '';\r\n\t\tif ($email && $password) {\r\n\t\t\ttry {\r\n\t\t\t\t$this->_getCustomerSession()->login($email, $password);\r\n\t\t\t}\r\n\t\t\tcatch(Exception $ex) {\r\n\t\t\t\t$error = $ex->getMessage();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$result = array();\r\n\t\t$result['error'] = $error;\r\n\t\tif ($error == '') $result['success'] = true;\r\n\t\t$this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t}", "public function loginAction()\n {\n $session = new Zend_Session_Namespace(__CLASS__);\n $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();\n try {\n $referer = Zend_Uri_Http::factory($_SERVER['HTTP_REFERER']);\n } catch (Exception $e) {\n }\n if ($this->_getParam('referer')) {\n $session->referer = $this->_getParam('referer');\n } else if ($referer && \n $referer->getHost() == $_SERVER['HTTP_HOST'] &&\n (!$referer->getPort() || $referer->getPort() == $_SERVER['SERVER_PORT']) &&\n substr($referer->getPath(), 0, strlen($baseUrl)) == $baseUrl) {\n $session->referer = substr($referer->getPath(), strlen($baseUrl));\n $session->referer = ltrim($session->referer, '/'); \n if ($referer->getQuery()) {\n $session->referer .= '?' . $referer->getQuery();\n }\n if ($referer->getFragment()) {\n $session->referer .= '#' . $referer->getFragment();\n }\n } else {\n $session->referer = $this->_getDefaultLandingPath();\n }\n \n $this->_redirect($this->_getCasAdapter()->getLoginUrl());\n }", "public function doLogin()\n {\n\n //check if all the fields were filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity with the spcific login data\n $userEntity = new User(array('username' => Request::post('username'), 'password' => Request::post('password'), 'email' => null, 'name' => null));\n\n //check if the user exists and get it as entity if exists\n if (!$userEntity = $this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username does not exist!\", \"type\" => \"error\")));\n exit;\n }\n\n //get the user ID from database\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //check if the login credentials are correct for login\n if (!$this->repository->checkLogin($userEntity, Request::post('password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The user/email is incorrect!\", \"type\" => \"error\")));\n exit;\n }\n\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //set the session using the user data\n $this->session->setSession($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"You successfully logged in!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "function login() {\n $params = $this->objService->get_request_params();\n $isSuccess = $this->objQuery->count('user','email= ? AND password = ?', array($params->email,$params->password));\n echo $isSuccess;\n }", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "public function login($username, $password);", "public function login ($request)\n {\n if ($request->getMethod() === 'POST') {\n\n $datas = $this->getParams($request);\n $users = $this->container->get('users.login');\n $user = $this->getNewEntity($datas);\n\n $found_username = array_search($user->username, array_column($users,'username'));\n $found_email = array_search($user->username, array_column($users,'email'));\n\n // Match -> (Username or Email) and Password Ok\n if (\n (strlen($found_username) > 0) &&\n (password_verify($user->password,$users[$found_username]['password'])) ||\n (strlen($found_email) > 0) && \n (password_verify($user->password,$users[$found_email]['password'])) \n ) {\n return $this->openGate($user); \n }\n\n }\n\n // fuction for encrypt new password\n // $this->encrypt('password');die();\n\n $header = $this->getHeaderEntity('login');\n $username = '';\n return $this->renderer->render($this->viewPath . '/login', compact('header', 'username'));\n }", "public function passwordlessLogin($request)\n {\n return $this->startAnonymous()->uri(\"/api/passwordless/login\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function processLogin(): void;", "function login_post()\n {\n if(!$this->post('user') || !$this->post('pass')){\n $this->response(NULL, 400);\n }\n\n $this->load->library('authentication');\n $array = array(\n 'user' => $this->post('user'),\n 'pass' => $this->post('pass')\n );\n $auth_result = $this->authentication->authenticate($array);\n \n if($auth_result['success'] == 1){\n $this->response(array('status' => 'success'));\n }else{\n $this->response(array('status' => 'failed'));\n }\n }", "public function login()\n\t{\n\t\tif ($this->request->is('post')) {\n\n\t\t\t// If no parameter passed to login(), CakePHP automatically give the request params as parameters.\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\treturn $this->redirect($this->Auth->redirectUrl());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->set('signInFail', true); // view vars\n\t\t\t}\n\t\t}\n\t}", "public function login(RequestInterface $request, ResponseInterface $response, array $args)\n {\n $username = $_POST['login'];\n $password = $_POST['password'];\n\n\n //Get token\n $ch = curl_init();\n $username = curl_escape($ch, $username);\n $password = curl_escape($ch, $password);\n $url_token = \"https://estudy.salle.url.edu/login/token.php?username={$username}&password={$password}&service=moodle_mobile_app\";\n $token = $this->curl_call($url_token);\n $token = json_decode($token);\n\n if (!$token || isset($token->error))\n {\n $response = $response->withStatus(400);\n $response->getBody()->write(json_encode(array('status'=> false, 'reason'=>'No user with said password found')));\n return $response;\n }\n else {\n $token = $token->token;\n\n $id_url = 'https://estudy.salle.url.edu/webservice/rest/server.php?moodlewsrestformat=json&wstoken=$token&wsfunction=core_webservice_get_site_info';\n $id_url = str_replace('$token', $token, $id_url);\n\n $answer = $this->curl_call($id_url);\n $row = json_decode($answer);\n\n session_start();\n\n $user = array(\n 'id' => $row->userid,\n 'login' => $row->username,\n 'firstname' => $row->firstname,\n );\n\n $_SESSION['user'] = $user;\n CourseHandler::addCoursesToSession($this->container);\n\n\n $response = $response->withStatus(200);\n $response = $response->getBody()->write(json_encode(array('status'=> true)));\n return $response;\n }\n }", "function login() {\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\t\t\t$password = $_REQUEST['password'];\n\n\t\t\tinclude_once(\"login.php\");\n\n\t\t\t$log = new login();\n\t\t\t$authenticate = $log->userLogin($username, $password);\n\n\t\t\t// checking if bookings have been gotten from database\n\t\t\tif (!$authenticate) {\n\t\t\t echo '{\"result\":0,\"message\":\"Error authenticating\"}';\n\t\t\t return;\n\t\t\t}\n\n\t\t\t$row = $log->fetch();\n\t\t\tif (!$row) {\n\t\t\t echo '{\"result\":0, \"message\":\"username or password is wrong\"}';\n\t\t\t return;\n\t\t\t} else {\n\t\t\t\techo '{\"result\":1,\"userInfo\": ';echo json_encode($row);echo '}'; \n\t\t\t}\n\t\t}\n\t}", "abstract public function login(array $input);", "public function login()\n {\n $formLoginEnabled = true;\n $this->set('formLoginEnabled', $formLoginEnabled);\n\n $this->request->allowMethod(['get', 'post']);\n $result = $this->Authentication->getResult();\n // regardless of POST or GET, redirect if user is logged in\n if ($result->isValid()) {\n // redirect to /users after login success\n // TODO: redirect to /users/profile after login success [cakephp 2.x -> 4.x migration]\n $redirect = $this->request->getQuery('redirect', [\n 'controller' => 'Admin',\n 'action' => 'users/index', \n ]);\n\n return $this->redirect($redirect);\n }\n // display error if user submitted and authentication failed\n if ($this->request->is('post') && !$result->isValid()) {\n $this->Flash->error(__('Invalid username or password'));\n }\n }", "public function login_post() {\n $email = $this->post('email');\n $password = $this->post('password');\n \n // Validate the post data\n if(!empty($email) && !empty($password)){\n \n // Check if any LoginModel exists with the given credentials\n $con['returnType'] = 'single';\n $con['conditions'] = array(\n 'email' => $email,\n 'password' => md5($password),\n 'status' => 1\n );\n $LoginModel = $this->LoginModel->getRows($con);\n \n if($LoginModel){\n // Set the response and exit\n $this->response([\n 'status' => TRUE,\n 'message' => 'LoginModel login successful.',\n 'data' => $LoginModel\n ], REST_Controller::HTTP_OK);\n }else{\n // Set the response and exit\n //BAD_REQUEST (400) being the HTTP response code\n $this->response(\"Wrong email or password.\", REST_Controller::HTTP_BAD_REQUEST);\n }\n }else{\n // Set the response and exit\n $this->response(\"Provide email and password.\", REST_Controller::HTTP_BAD_REQUEST);\n }\n }", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "private static function loginGet(){\r\n \r\n if(!isset($_POST['login']) || !isset($_POST['password']))\r\n return false;\r\n \r\n $client = new Login(addslashes($_POST['login']), addslashes($_POST['password']));\r\n if($client->identification()){\r\n //for agency\r\n $_SESSION['account'] = $_POST['login'];\r\n $_SESSION['login'] = $client->login;\r\n \r\n if (!Security::isAdmin()){\r\n $date = Client::GetConfigurationStatic($_SESSION['login'], 'LAST_CONNEXION');\r\n Client::setConfigurationStatic($_SESSION['login'], 'BEFORE_LAST_CONNEXION', $date);\r\n Client::setConfigurationStatic($_SESSION['login'], 'LAST_CONNEXION', date('Y-m-d H:i:s'));\r\n header ('location:/');\r\n }else\r\n header ('location:/admin');\r\n \r\n exit;\r\n }\r\n \r\n return false;\r\n }", "protected function Login()\n {\n $this->redirectParams[\"openid.realm\"] = $this->config[\"realm\"];\n $this->redirectParams[\"openid.return_to\"] = $this->config[\"return_to\"];\n\n $params = http_build_query($this->redirectParams);\n\n $url = $this->urlAuthorize . \"?$params\";\n\n header(\"Location: $url\");\n exit();\n }" ]
[ "0.8164283", "0.7831355", "0.7760793", "0.7711111", "0.76224077", "0.7602633", "0.75985044", "0.754405", "0.75189525", "0.74888885", "0.74888885", "0.74364245", "0.7425378", "0.7380272", "0.736745", "0.7335202", "0.7313254", "0.73130876", "0.73100847", "0.7293768", "0.7281126", "0.727591", "0.727487", "0.7271509", "0.72662467", "0.7240297", "0.723051", "0.72276556", "0.72209835", "0.71984136", "0.7177174", "0.7173414", "0.7168973", "0.716276", "0.71604013", "0.7127661", "0.71238464", "0.70984334", "0.7089478", "0.7084578", "0.7061449", "0.70576024", "0.7050703", "0.7050238", "0.7027995", "0.702453", "0.70241606", "0.70148224", "0.70129144", "0.7010543", "0.70057243", "0.70036656", "0.69768816", "0.6973208", "0.6972135", "0.6967761", "0.6960204", "0.69561", "0.6954955", "0.69519824", "0.69504106", "0.6945149", "0.69431907", "0.69394755", "0.69336283", "0.69210684", "0.6918823", "0.69121814", "0.6911781", "0.69031566", "0.69031304", "0.6900227", "0.68998194", "0.68968916", "0.6883203", "0.687973", "0.6878772", "0.6878173", "0.68760645", "0.6875947", "0.68726784", "0.6866749", "0.68661267", "0.68650794", "0.68589103", "0.6853679", "0.68496734", "0.6836756", "0.6835361", "0.68259865", "0.68200594", "0.68195236", "0.6814101", "0.68110025", "0.68067205", "0.67985284", "0.67980874", "0.6793818", "0.6792268", "0.67915756", "0.6788739" ]
0.0
-1
Show manual registration form
public function register() { return View::make('user.register'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showRegistrationForm()\n {\n return view('skins.' . config('pilot.SITE_SKIN') . '.auth.register');\n }", "public function displayRegisterForm()\n {\n // charger le HTML de notre template\n require OPROFILE_TEMPLATES_DIR . 'register-form.php';\n }", "public function showRegistrationForm()\n {\n $askForAccount = false;\n return view('client.auth.register',compact(\"askForAccount\"));\n }", "public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('frontend.auth.register');\n }", "private function _registerForm()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->plugin->runHooks( 'register_main' );\n\t\t\n\t\t$MySmartBB->template->display( 'register' );\n\t}", "public function showRegistrationForm() {\n //parent::showRegistrationForm();\n $data = array();\n\n $data = $this->example_of_user();\n $data['title'] = 'RegisterForm';\n\n return view('frontend.auth.register', $data);\n }", "public function showForm()\n {\n return view('auth.register-step2');\n }", "public function showRegistrationForm()\n {\n return view('privato.auth.register');\n }", "public function showRegistrationForm()\n {\n return view('laboratorio.auth.register');\n \n }", "public function showRegistrationForm()\n {\n return view('adminlte::auth.register');\n }", "public function registrationForm() {\n\n }", "public function showRegistrationForm()\n {\n return view('admin.auth.register');\n }", "public function showRegistrationForm()\n {\n return view('instructor.auth.register');\n }", "public function showRegisterForm()\n {\n return view('ui.pages.register');\n }", "public function formRegister(){\n $this->view->registerForm();\n }", "public function showRegisterForm()\n {\n return view('estagiarios.auth.register');\n }", "public function registration()\n {\n $view = new View('login_registration');\n $view->title = 'Bilder-DB';\n $view->heading = 'Registration';\n $view->display();\n }", "public function showRegistrationForm()\n\t{\n\t\t$data = [];\n\t\t\n\t\t// References\n\t\t$data['countries'] = CountryLocalizationHelper::transAll(CountryLocalization::getCountries());\n\t\t$data['genders'] = Gender::trans()->get();\n\t\t\n\t\t// Meta Tags\n\t\tMetaTag::set('title', getMetaTag('title', 'register'));\n\t\tMetaTag::set('description', strip_tags(getMetaTag('description', 'register')));\n\t\tMetaTag::set('keywords', getMetaTag('keywords', 'register'));\n\t\t\n\t\t// return view('auth.register.indexFirst', $data);\n\t\treturn view('auth.register.index', $data);\n\n\t}", "public function showRegistrationForm()\n {\n return view('auth.register');\n }", "public function showRegisterForm(){\n return view('auth.entreprise-register');\n }", "public function showRegistrationForm()\n {\n return redirect()->route('frontend.account.register');\n //return theme_view('account.register');\n }", "public function showRegistrationForm()\n {\n return view('frontend.user_registration');\n }", "public function getRegistrationForm()\n\t{\n\n\t}", "public function add_to_register_form() {\n\t\t$this->recaptcha->show_recaptcha( array( 'action' => ITSEC_Recaptcha::A_REGISTER ) );\n\t}", "public function ShowRegistrationForm(){\n return view('Auth.register');\n }", "public function showRegistrationForm()\n {\n return view('auth.officer-register');\n }", "public function showRegistrationForm()\n {\n // get all roles expet root.\n $roles = Role::where('name', '!=', 'root')->get();\n $specialties = Specialty::all();\n\n return view('auth.register')->with([\n 'roles' => $roles, \n 'specialties' => $specialties\n ]);\n }", "public function showRegisterForm(){\n return view('frontend.register');\n }", "public function showRegistrationForm()\n {\n //Custom code here\n return view('auth.register')->with('packages', Package::all()->where('status', 1));\n }", "public function showRegisterForm()\n {\n return view('dashboard.user.registerForm');\n }", "public function showRegistrationForm()\n {\n $navList = Nav::getMenuTree(Nav::orderBy('sort', 'asc')->get()->toArray());\n $categories = Category::getMenuTree(Category::orderBy('sort', 'asc')->select('id', 'name', 'pid')->get()->toArray());\n View::share([\n 'nav_list' => $navList,\n 'category_list' => $categories,\n ]);\n return view('auth.register');\n }", "public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }", "public function registerForm()\n {\n return view('register', [\n 'titlePart' => '| Register',\n ]);\n }", "public function regi_form() {\n $template = $this->loadView('registration_page');\n // $template->set('result', $error);\n $template->render();\n }", "public function showRegistrationForm()\n {\n $jurusan = \\App\\Models\\Jurusan::where('active', 1)->get();\n return view('auth.register', ['jurusan' => $jurusan]);\n }", "public function showregistrationform(){\n return view('register');\n }", "public function showRegistrationForm()\n {\n return view('Registration View');\n }", "public function getRegistrationForm()\n {\n \treturn view('auth.institute_register'); \n }", "function showform(){\n return view('registration');\n }", "public function showRegistrationForm()\n {\n $countries = Country::all();\n $counties = County::all();\n $nationalities = Nationality::all();\n\n return view('auth.register', compact('countries', 'counties', 'nationalities'));\n }", "public function registerForm(): Response\n {\n $this->init('You\\'r already loggedIn', '/chatroom');\n return $this->render('register.html.twig');\n }", "public function showRegistrationForm()\n {\n if(Role::first()){\n $role = Role::pluck('name', 'id')->toArray();\n return view('Admin::auth.register', compact('role'));\n }else{\n return redirect()->route('admin.createRole');\n }\n }", "function displayRegForm() {\r\n displayUserForm(\"processRegistration.php\", \"registrationForm\", \"Register\",\r\n \"Your name\", \"\",\r\n \"Your email address\", \"\",\r\n \"Your chosen username\", \"\",\r\n \"Your chosen password\", \"Confirm your password\",\r\n true, -1);\r\n}", "public function showRegistrationForm()\n {\n return view('signup');\n }", "public function showRegistrationForm()\n {\n if (property_exists($this, 'registerView')) {\n return view($this->registerView);\n }\n\n $roles = Role::assignable()->orderBy('id')->get();\n return view('auth.register', compact('roles'));\n }", "public function showRegistrationForm()\n {\n return view('user.auth.login');\n }", "private static function printRegForm() {\n\t\t\tinclude 'engine/values/site.values.php';\n\t\t\tif($site_reg_open){\n\t\t\techo \"<form action=\\\"?module=handler&action=registration\\\" method=\\\"post\\\">\n\t\t\t\t <div class=\\\"form_settings\\\">\n\t\t\t\t \t<center><h2>\".strip_tags($site_title).\" - Registration</h2></center>\n\t\t\t\t \t<br>\n\t\t\t\t <p><span>Email</span><input type=\\\"text\\\" name=\\\"email1\\\" tabindex=\\\"1\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Confirm email</span><input type=\\\"text\\\" name=\\\"email2\\\" tabindex=\\\"2\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Name</span><input type=\\\"text\\\" name=\\\"name\\\" tabindex=\\\"3\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Password</span><input type=\\\"password\\\" name=\\\"password1\\\" tabindex=\\\"4\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Confirm password</span><input type=\\\"password\\\" name=\\\"password2\\\" tabindex=\\\"5\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>User agreement</span><textarea class=\\\"contact textarea\\\" name=\\\"useragreement\\\" readonly=\\\"readonly\\\">\".file_get_contents('engine/values/user.agreement.txt').\"</textarea></p>\n\t\t\t\t <p>By pressing submit you agree to the user agreement above.</p>\n\t\t\t\t <p style=\\\"padding-top: 15px\\\"><span>&nbsp;</span><input class=\\\"submit\\\" type=\\\"submit\\\" tabindex=\\\"6\\\" name=\\\"contact_submitted\\\" value=\\\"Submit\\\" /></p>\n\t\t\t\t </div>\n\t\t\t\t</form>\";\n\t\t\t} else {\n\t\t\t\techo \"Registration is currently closed. For more information contact the administrators.\";\n\t\t\t}\n\t\t}", "public function showRegistrationForm()\n {\n $countries = Country::getCountries();\n\n return view('auth.register', compact('countries'));\n }", "public function showAdminRegisterForm()\n {\n return view('admin.register');\n }", "public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \n }", "public function showReg()\n {\n //show the form\n if (Auth::check())\n {\n return Redirect::route('account');\n }\n\n // Show the page\n return View::make('account.reg');\n }", "public function showRegistrationForm()\n {\n $groups = Group::all();\n return view('auth.register', compact('groups'));\n }", "public function showRegisterForm() {\n return view('seller.registerSeller');\n }", "function registrationPage() {\n\t\t $display = &new jzDisplay();\n\t\t $be = new jzBackend();\n\t\t $display->preHeader('Register',$this->width,$this->align);\n\t\t $urla = array();\n\n\t\t if (isset($_POST['field5'])) {\n\t\t $user = new jzUser(false);\n\t\t if (strlen($_POST['field1']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field2']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field3']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field4']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field5']) == 0) {\n\t\t echo \"All fields are required.<br>\";\n\t\t }\n\t\t else if ($_POST['field2'] != $_POST['field3']) {\n\t\t echo \"The passwords do not match.<br>\";\n\t\t }\n\t\t else if (($id = $user->addUser($_POST['field1'],$_POST['field2'])) === false) {\n\t\t echo \"Sorry, this username already exists.<br>\";\n\t\t } else {\n\t\t // success!\n\t\t $stuff = $be->loadData('registration');\n\t\t $classes = $be->loadData('userclasses');\n\t\t $settings = $classes[$stuff['classname']];\n\n\t\t $settings['fullname'] = $_POST['field4'];\n\t\t $settings['email'] = $_POST['field5'];\n\t\t $un = $_POST['field1'];\n\t\t $settings['home_dir'] = str_replace('USERNAME',$un,$settings['home_dir']);\n\t\t $user->setSettings($settings,$id);\n\n\t\t echo \"Your account has been created. Click <a href=\\\"\" . urlize($urla);\n\t\t echo \"\\\">here</a> to login.\";\n\t\t $this->footer();\n\t\t return;\n\t\t }\n\t\t }\n\n\t\t ?>\n\t\t\t<form method=\"POST\" action=\"<?php echo urlize($urla); ?>\">\n\t\t\t<input type=\"hidden\" name=\"<?php echo jz_encode('action'); ?>\" value=\"<?php echo jz_encode('login'); ?>\">\n\t\t\t<input type=\"hidden\" name=\"<?php echo jz_encode('self_register'); ?>\" value=\"<?php echo jz_encode('true'); ?>\">\n\t\t\t<table width=\"100%\" cellpadding=\"5\" style=\"padding:5px;\" cellspacing=\"0\" border=\"0\">\n\t\t\t<tr>\n\t\t\t<td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Username\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field1\" value=\"<?php echo $_POST['field1']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Password\"); ?>\n\t\t\t</font></td>\n\t\t\t<td width=\"50%\">\n\t\t\t<input type=\"password\" class=\"jz_input\" name=\"field2\" value=\"<?php echo $_POST['field2']; ?>\"></td></tr>\n\t\t\t <tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t &nbsp;\n\t\t\t</td>\n\t\t\t<td width=\"50%\">\n\t\t\t<input type=\"password\" class=\"jz_input\" name=\"field3\" value=\"<?php echo $_POST['field3']; ?>\"></td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Full name\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field4\" value=\"<?php echo $_POST['field4']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Email\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field5\" value=\"<?php echo $_POST['field5']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"100%\" colspan=\"2\" align=\"center\">\n\t\t\t<input class=\"jz_submit\" type=\"submit\" name=\"<?php echo jz_encode('submit_login'); ?>\" value=\"<?php echo word(\"Register\"); ?>\">\n\t\t\t</td></tr></table><br>\n\t\t\t</form>\n\t\t\t<?php\n\t\t $this->footer();\n\t }", "public function showRegistrationForm()\n {\n $tiposDocumento = TipoDocumento::orderBy('nombre')->get();\n $perfiles = Perfil::orderBy('nombre')->get();\n $bodegas = Bodega::orderBy('nombre')->get();\n return view('auth.register') -> with( compact('tiposDocumento','perfiles','bodegas') );\n }", "public function registrationForm(){\n self::$signUpName = $_POST['signup-name'];\n self::$signUpEmail = $_POST['signup-email'];\n self::$signUpPassword = $_POST['signup-password'];\n\n self::sanitize();\n if(self::checkIfAvailable()){\n self::$signUpName =\"\";\n self::$signUpEmail = \"\";\n self::$signUpPassword = \"\";\n }\n }", "public function registered()\n { \n $data = [\n 'judul_seminar' => $this->judul_seminar,\n 'nama_pembicara' => $this->nama_pembicara,\n 'tulisan_seminar' => $this->tulisan_seminar\n ];\n $this->load->view('seminar/form_registered', $data); \n }", "function register() {\n\n/* ... this form is not to be shown when logged in; if logged in just show the home page instead (unless we just completed registering an account) */\n if ($this->Model_Account->amILoggedIn()) {\n if (!array_key_exists( 'registerMsg', $_SESSION )) {\n redirect( \"mainpage/index\", \"refresh\" );\n }\n }\n\n/* ... define values for template variables to display on page */\n $data['title'] = \"Account Registration - \".$this->config->item( 'siteName' );\n\n/* ... set the name of the page to be displayed */\n $data['main'] = \"register\";\n\n/* ... complete our flow as we would for a normal page */\n $this->index( $data );\n\n/* ... time to go */\n return;\n }", "public function getRegister()\n {\n return $this->showRegistrationForm();\n }", "public function getRegister()\n {\n return $this->showRegistrationForm();\n }", "public function signupForm()\n {\n \t# code...\n \treturn view(\"external-pages.sign-up\");\n }", "private function _show_registration_form(&$xregistration=null, $task='create')\n\t{\n\t\t$username = Request::getString('username', User::get('username'), 'get');\n\t\t$isSelf = (User::get('username') == $username);\n\n\t\t// Get the registration object\n\t\tif (!is_object($xregistration))\n\t\t{\n\t\t\t$xregistration = new \\Components\\Members\\Models\\Registration();\n\t\t}\n\n\t\t// Push some values to the view\n\t\t$rules = \\Hubzero\\Password\\Rule::all()\n\t\t\t->whereEquals('enabled', 1)\n\t\t\t->rows();\n\n\t\t$password_rules = array();\n\n\t\tforeach ($rules as $rule)\n\t\t{\n\t\t\tif (!empty($rule['description']))\n\t\t\t{\n\t\t\t\t$password_rules[] = $rule['description'];\n\t\t\t}\n\t\t}\n\n\t\t$this->view->registrationUsername = Field::state('registrationUsername', 'RROO', $task);\n\t\t$this->view->registrationPassword = Field::state('registrationPassword', 'RRHH', $task);\n\t\t$this->view->registrationConfirmPassword = Field::state('registrationConfirmPassword', 'RRHH', $task);\n\t\t$this->view->registrationFullname = Field::state('registrationFullname', 'RRRR', $task);\n\t\t$this->view->registrationEmail = Field::state('registrationEmail', 'RRRR', $task);\n\t\t$this->view->registrationConfirmEmail = Field::state('registrationConfirmEmail', 'RRRR', $task);\n\t\t$this->view->registrationOptIn = Field::state('registrationOptIn', 'HHHH', $task);\n\t\t$this->view->registrationCAPTCHA = Field::state('registrationCAPTCHA', 'HHHH', $task);\n\t\t$this->view->registrationTOU = Field::state('registrationTOU', 'HHHH', $task);\n\n\t\tif ($task == 'update')\n\t\t{\n\t\t\tif (empty($this->view->xregistration->login))\n\t\t\t{\n\t\t\t\t$this->view->registrationUsername = Field::STATE_REQUIRED;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->view->registrationUsername = Field::STATE_READONLY;\n\t\t\t}\n\n\t\t\t$this->view->registrationPassword = Field::STATE_HIDDEN;\n\t\t\t$this->view->registrationConfirmPassword = Field::STATE_HIDDEN;\n\t\t}\n\n\t\tif ($task == 'edit')\n\t\t{\n\t\t\t$this->view->registrationUsername = Field::STATE_READONLY;\n\t\t\t$this->view->registrationPassword = Field::STATE_HIDDEN;\n\t\t\t$this->view->registrationConfirmPassword = Field::STATE_HIDDEN;\n\t\t}\n\n\t\tif (User::get('auth_link_id') && $task == 'create')\n\t\t{\n\t\t\t$this->view->registrationPassword = Field::STATE_HIDDEN;\n\t\t\t$this->view->registrationConfirmPassword = Field::STATE_HIDDEN;\n\t\t}\n\n\t\t$fields = Field::all()\n\t\t\t->including(['options', function ($option){\n\t\t\t\t$option\n\t\t\t\t\t->select('*')\n\t\t\t\t\t->ordered();\n\t\t\t}])\n\t\t\t->where('action_' . ($task == 'update' ? 'create' : $task), '!=', Field::STATE_HIDDEN)\n\t\t\t->ordered()\n\t\t\t->rows();\n\n\t\t// Display the view\n\t\t$this->view\n\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER'))\n\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t->set('config', $this->config)\n\t\t\t->set('task', $task)\n\t\t\t->set('fields', $fields)\n\t\t\t->set('showMissing', true)\n\t\t\t->set('isSelf', $isSelf)\n\t\t\t->set('password_rules', $password_rules)\n\t\t\t->set('xregistration', $xregistration)\n\t\t\t->set('registration', $xregistration->_registration)\n\t\t\t->setLayout('default')\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}", "public function formRegistrazionePrivato() {\n $this->smarty->display('reg_privato.tpl');\n }", "public function showSignUpForm() {\n if(!config('springintoaction.signup.allow')) {\n return view('springintoaction::frontend.signup_closed');\n }\n\n return view('springintoaction::frontend.signup');\n }", "function viewSignUpForm() {\n\t$view = new viewModel();\n\t$view->showSignUpForm();\t\n}", "public function registration()\n\t{\n\t\t$this->load->view('register');\n }", "public function showRegistrationForm()\n {\n $roles = Role::orderBy('name','asc')->whereNotIn('name',array('Administrator'))->get();\n return view('auth.register',compact('roles'));\n }", "function RegistrationForm() {\n\t\t$data = Session::get(\"FormInfo.Form_RegistrationForm.data\");\n\n\t\t$use_openid =\n\t\t\t($this->getForumHolder()->OpenIDAvailable() == true) &&\n\t\t\t(isset($data['IdentityURL']) && !empty($data['IdentityURL'])) ||\n\t\t\t(isset($_POST['IdentityURL']) && !empty($_POST['IdentityURL']));\n\n\t\t$fields = singleton('Member')->getForumFields($use_openid, true);\n\n\t\t// If a BackURL is provided, make it hidden so the post-registration\n\t\t// can direct to it.\n\t\tif (isset($_REQUEST['BackURL'])) $fields->push(new HiddenField('BackURL', 'BackURL', $_REQUEST['BackURL']));\n\n\t\t$validator = singleton('Member')->getForumValidator(!$use_openid);\n\t\t$form = new Form($this, 'RegistrationForm', $fields,\n\t\t\tnew FieldList(new FormAction(\"doregister\", _t('ForumMemberProfile.REGISTER','Register'))),\n\t\t\t$validator\n\t\t);\n\n\t\t// Guard against automated spam registrations by optionally adding a field\n\t\t// that is supposed to stay blank (and is hidden from most humans).\n\t\t// The label and field name are intentionally common (\"username\"),\n\t\t// as most spam bots won't resist filling it out. The actual username field\n\t\t// on the forum is called \"Nickname\".\n\t\tif(ForumHolder::$use_honeypot_on_register) {\n\t\t\t$form->Fields()->push(\n\t\t\t\tnew LiteralField(\n\t\t\t\t\t'HoneyPot',\n\t\t\t\t\t'<div style=\"position: absolute; left: -9999px;\">' .\n\t\t\t\t\t// We're super paranoid and don't mention \"ignore\" or \"blank\" in the label either\n\t\t\t\t\t'<label for=\"RegistrationForm_username\">' . _t('ForumMemberProfile.LeaveBlank', 'Don\\'t enter anything here'). '</label>' .\n\t\t\t\t\t'<input type=\"text\" name=\"username\" id=\"RegistrationForm_username\" value=\"\" />' .\n\t\t\t\t\t'</div>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$member = new Member();\n\n\t\t// we should also load the data stored in the session. if failed\n\t\tif(is_array($data)) {\n\t\t\t$form->loadDataFrom($data);\n\t\t}\n\n\t\t// Optional spam protection\n\t\t$form->enableSpamProtection();\n\n\t\treturn $form;\n\t}", "private function genRegistration()\n {\n ob_start(); ?>\n <form name=\"login\" action=\"./\" method=\"post\">\n <fieldset class=\"uk-fieldset\">\n <legend class=\"uk-legend\">[[legend]]</legend>\n <div class=\"uk-margin\">\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: user\"></span>\n <input class=\"uk-input\" type=\"text\" name=\"username\" value=\"[[value_username]]\"\n placeholder=\"[[placaholder_username]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: mail\"></span>\n <input class=\"uk-input\" type=\"email\" name=\"email\" value=\"[[value_email]]\"\n placeholder=\"[[placaholder_email]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"password\" placeholder=\"[[placaholder_password]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"confirm\" placeholder=\"[[placaholder_confirm]]\">\n </div>\n </div>\n <p>[[terms_and_conditions_text]] <a href=\"../privacy-policy/\">[[terms_and_conditions_link]]</a></p>\n <div class=\"uk-margin-bottom\">\n <input type=\"hidden\" name=\"action\" value=\"registration\">\n <button class=\"uk-button uk-button-default\">[[submit_text]]</button>\n </div>\n </div>\n <p>[[login_text]] <span uk-icon=\"icon: link\"></span> <a href=\"../login/\">[[login_link]]</a></p>\n </fieldset>\n </form>\n <?php return ob_get_clean();\n }", "public function showUserCreationForm()\n {\n return view('admin.user_create');\n }", "function login_form_register()\n {\n }", "public function actionRegister()\n\t{\t\n\t\t$model=new RegistrationForm('registration');\n\t\n\t\t// if it is ajax validation request\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='registration-form')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\t\n\t\t// collect user input data\n\t\tif(isset($_POST['RegistrationForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RegistrationForm'];\n\t\t\tif($model->save()){\n\t\t\t\t$loginForm = new LoginForm();\n\t\t\t\t$loginForm->fakeLogin($model->email, $_POST['RegistrationForm']['password']);\n\t\t\t\t$this->redirect(array('site/index')); // automaticke prihlaseni uzivatele\n\t\t\t\t//@todo presmerovani na administraci\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// display the login form\n\t\t$this->render('register', array('model'=>$model));\n\t}", "public function actionRegister()\n\t{\n\t\tUtilities::updateCallbackURL();\n\t\t$this->render('registration');\n\t}", "public function showSignupForm()\n {\n return view('auth.signup');\n }", "public function showSignupForm()\n {\n return view('auth.signup');\n }", "public function showSalesRegistrationForm()\n {\n return view('auth.sales-register');\n }", "public function showRegister()\n {\n return view('my_register');\n }", "public function showRegistrationForm()\n {\n return redirect('login');\n }", "function show_manual_form($type='reg', $errors=\"\")\n\t{\n\t\tif ( $type == 'lostpass' )\n\t\t{\n\t \tif ($errors != \"\")\n\t \t{\n\t \t\t$this->output .= $this->ipsclass->compiled_templates['skin_register']->errors( $this->ipsclass->lang[$errors]);\n\t \t}\n\t \t\n\t\t\t$this->output .= $this->ipsclass->compiled_templates['skin_register']->show_lostpass_form();\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Check for input and it's in a valid format.\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this->ipsclass->input['uid'] AND $this->ipsclass->input['aid'] )\n\t\t\t{ \n\t\t\t\t$in_user_id = intval(trim(urldecode($this->ipsclass->input['uid'])));\n\t\t\t\t$in_validate_key = trim(urldecode($this->ipsclass->input['aid']));\n\t\t\t\t$in_type = trim($this->ipsclass->input['type']);\n\t\t\t\t\n\t\t\t\tif ($in_type == \"\")\n\t\t\t\t{\n\t\t\t\t\t$in_type = 'reg';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Check and test input\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\tif (! preg_match( \"/^(?:[\\d\\w]){32}$/\", $in_validate_key ) )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (! preg_match( \"/^(?:\\d){1,}$/\", $in_user_id ) )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Attempt to get the profile of the requesting user\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => \"id=$in_user_id\" ) );\n\t\t\n\t\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t\t\t\tif ( ! $member = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_mem' ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Get validating info..\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$validate = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'validating', 'where' => \"member_id=$in_user_id and vid='$in_validate_key' and lost_pass=1\" ) );\n\t\t\t\t\n\t\t\t\tif ( ! $validate['member_id'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_key' ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->output = str_replace( \"<!--IBF.INPUT_TYPE-->\", $this->ipsclass->compiled_templates['skin_register']->show_lostpass_form_auto($in_validate_key, $in_user_id), $this->output );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->output = str_replace( \"<!--IBF.INPUT_TYPE-->\", $this->ipsclass->compiled_templates['skin_register']->show_lostpass_form_manual(), $this->output );\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->ipsclass->vars['bot_antispam'])\n\t\t\t{\n\t\t\t\t// Set a new ID for this reg request...\n\t\t\t\t\n\t\t\t\t$regid = md5( uniqid(microtime()) );\n\t\t\t\t\n\t\t\t\tif( $this->ipsclass->vars['bot_antispam'] == 'gd' )\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Get 6 random chars\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$reg_code = strtoupper( substr( md5( mt_rand() ), 0, 6 ) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Set a new 6 character numerical string\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\t$reg_code = mt_rand(100000,999999);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Insert into the DB\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->do_insert( 'reg_antispam', array (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'regid' => $regid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'regcode' => $reg_code,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ip_address' => $this->ipsclass->input['IP_ADDRESS'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ctime' => time(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t}\n\t\t\t\t\t\t\t\n\t \tif ($this->ipsclass->vars['bot_antispam'] == 'gd')\n\t\t\t{\n\t\t\t\t$this->output = str_replace( \"<!--{REG.ANTISPAM}-->\", $this->ipsclass->compiled_templates['skin_register']->bot_antispam_gd( $regid ), $this->output );\n\t\t\t}\n\t\t\telse if ($this->ipsclass->vars['bot_antispam'] == 'gif')\n\t\t\t{\n\t\t\t\t$this->output = str_replace( \"<!--{REG.ANTISPAM}-->\", $this->ipsclass->compiled_templates['skin_register']->bot_antispam( $regid ), $this->output );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->output = $this->ipsclass->compiled_templates['skin_register']->show_dumb_form($type);\n\t\t}\n\t\t\n\t\t$this->page_title = $this->ipsclass->lang['activation_form'];\n\t\t$this->nav = array( $this->ipsclass->lang['activation_form'] );\n\t}", "public function ulogiraj_registiraj()\r\n\t{\r\n\t\tif(isset($_POST['ulogiraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Login';\r\n\t\t\t$this->registry->template->show( 'login' );\r\n\t\t}\r\n\t\tif(isset($_POST['registriraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Registriraj se';\r\n\t\t\t$this->registry->template->show( 'register' );\r\n\t\t}\r\n\r\n\t}", "public function registerAction() {\n $request = $this->getRequest();\n\n $fp = new Champs_Form_Account_Register($this->em);\n\n if ($request->isPost()) {\n // get the hash\n $hash = $request->getPost('hash');\n\n if ($this->checkHash($hash)) {\n if ($fp->process($request)) {\n $session = new Zend_Session_Namespace('registration');\n $session->user_id = $fp->user->id;\n $this->_redirect($this->getUrl('complete'));\n }\n }\n }\n\n // setup hash\n $this->initHash();\n // assign form to view\n $this->view->fp = $fp;\n }", "public function showRegistrationForm(Request $request)\n {\n\n\n\n if($request->allow_register == 1){\n\n return view('auth.register');\n }else{\n\n return view('index');\n }\n\n\n }", "public function register() {\n $next = $this->input->get('next');\n $data['next'] = $next;\n $data['title'] = translate('register');\n $this->load->view('front/register', $data);\n }", "public function showRegistrationForm()\n {\n $country = DB::table('countries')->get();\n return view('auth.register',['country' => $country]);\n }", "public function registerAction() {\n $request = $this->getRequest();\n $plan = $request->get('plan', '25139');\n $entity = new CoolwayFestivales\\SafetyBundle\\Entity\\User();\n $form = $this->createForm(new CoolwayFestivales\\SafetyBundle\\Form\\UserType(), $entity);\n\n return $this->render('AppBundle:Backend:register.html.twig', array(\n 'form' => $form->createView(),\n 'error' => false,\n 'plan' => $plan\n ));\n }", "public function showRegistrationForm()\n {\n $api = new meta(); \n \n eval(str_rot13(gzinflate(str_rot13(base64_decode('LUnHEuy4DfyarV3flFQqn5TTjGW+uJRmzvptRn7WgQUCYAOkwAaXbbj/2fojXu+hXP4Zh28hsP/My5TMyz/50Ef5/f/J3+pCTotR5CyJ+wuxbNjjMRtW7UMr0BsiBSI0lr8QHZjwJYe/F4lb7IzEVM+mr+5tFMjigVEi4Rhy4QqPaKSMbxQAnV3W6FfsYLm9RzI1123YaArcUu0E/Vyictop3OIs9iWW7zYvS2GP/qgRoeZBqTCXE9GJcRtefAWf+G46MWBcxr3D0rfnF7Q0PvzUUimJleX6jN+m2a9vg+SOcYtZUf1TRwxTKYEn7fG2Q4RaG9oeyCsaEjBpX+4HeWvaUWA2WL9nD+zwyCOmh0pOEymg5TpviAc5l5HIUaEkFAuglHRYcLl5FjxHO/HTs79sT9hS7SXN8eNYjdnT6kZiJ6YWmxqDgLp0YQQmw/SkYdD2T0OWFAd2HALxp+GcxyEcPHclfu0Xvc6fEIB/wBbtmwryi05ShVfZmBm57RyK01QrImpVQWlRPnPxhCMM3xh+Vk9Ox6R4uUSnZYVKWYrW2JjCgWEH9LUKPkIYHkix54yvs/qFK/Js6Cvbs/hx1uurfL0l+1L5Lkp2WvOxZl7XUK6OEfFLE5pX4dy8Omm3cgj90M5w+nZQ9xtz1cp04y9OnfEGCWJcQCGLOQnyTHUzjnE887PNdHafDy5TYaYpoAphi0PMy440gZdQxb7ilSSr+957hKwKgz9lYTgR9G/tRUcburAQ6tZF/8AGuaD3qYu/IJCeTMMzmZsIKw9XGTryCE7+iGW3MA04ZGFl/VpR2TTU6XMdmxho56wS1ulvVxm1hW3DGEELHggN4DonxYaF/krlulPDm68gOVfP1vAppDvO0WiPMnWm6H4vKIf+IV3R6SSiN6WuzFxG1R6yq0K4Oluh3ZjhFcm4OcvofbL6rS/3mzn0jteDiEdwXT2hjHYuId8JqqUWFsL7dBmmmMliyXVAjOTKWvReRnEW/VkoGBE1668gvPUuwS7Y+VVqFLaIA4knPjslnfgAG9NFlwkjtTeysT/lxtRBZDkw8pwhXhM/tCLlfXo138/MXMnAbVyucix6WO5kD54udNlOxdxsCMxeWal1MaWGnIaem12tmkeLHFZE5+zn1Eod9lvj5MZw5k6+n+neWnmlm8Jd7S7HkkhKU87PkgZhKO1EXMqD2XEPFkWcoBQHiRYrFZSeJLrHFLrORoDA98WKH9wNXLrsUMwMulDI2CdJDIG0v063jgK7zrCiisYogr9xq8aR/MiQ9droJ/s8BLjLO/wL7a11uytd5lh0KgbClsOls/05MwxFFOnJ75NUKhIN/5XG7ECN3TJMioaBBbI6eUdRAPTXDiXRmLO6oIitjfUy8bLSd9tD2r2O1SmGnlIEDXLgbeDfgAgshqzLkrpk/qE761J1lQOdAOSHo6EWdENRROjli8Qm1DXJ+UZ1aa+Amc9ItvY7+eBlK08wjl9u+4aWcr7grHEhywW8cl+nExYoZbioJElCnrxHZQi3cce4Pj+Yniq96dprjOVVqEzzddZk4JkjcTNPEJ11Gvl9K8StWXcWwplEC9aPVwlLCQXgTgiYVdfztd7750p1k5lOz/GptrJ7OWWE2lKSzn5GZszO4l5dh0PkNJsb2NUR2yNOtL7jd0lnkIz9CsjM047EOx6XxAFM32OTqB98opYvZJcZUmh6u2Dn/TS4d+LlTFJEbl/Jrvc0v15w3n7OYSqoUIT2qyN8TFvEm+vU96AyLpFN2uilVJd76U9jdzf2vXK5nUfuW5++etyGy8Fmnj2Pwkb0yoCwo27pHNO3A+byO9qJnLHtdlhup5ep0RRiABipKR/SFF8mTY+afNKehHL4/IhYxs7W7jdeIgfESlnYdZwZYzqE+iK+i03xWPWZJ8jUMBv4PSn+Rp0iTRwXr6pCoU3qvBrdWwK5eW9YuqYyKztcW2U+VqQqe8LqWGC5xcVdOBDTQcVYknIwEoQG+5YQIxcSIzZlL0XilwKNFBDm0lu8kAzGtdtkR/GDs1TmqNOjJ0+8sBRu/bUEpXN29ot7SC+1HzQeyxmAIVj9W9ZJb2TyTM9GypnmjT7tDBjPJQPob2V9zF4wb8tYuoiJmVXxID95VLfS8rWwUuDZWYg584jvbInTYA5cLvV6Hi5k1gSwSVcbwA+yIYwvDAND1FShSiokfPWsKImdWgn0dBTNAfu94P6Q+byDS0U6p7yj7ZB18+DHHfdkxN276U3jCsf4b9S6/W0Pd3hrnreI/Ga+/bLjivg5dUo/HKMzn/xgcMLdAvdAY/MCDm2Uj8ZXtqKPK+81cf15e4kHgWil7QsncY4Mz7vYK9J+ONHWuMlE/XrvcKYa1iDmpRquS05LNZJyJD7a3NFPtHTEqhiqlo3g3C8JnESaPRQkpchX+VUvKwU+CPKzOlBl26T6BbpwXEHI7vEv+Fcu9KTa25em2QZw5iaOQW/7yHOGjV0dFI5xIXBhiq3Zg8YFIRvCradTVlp6bOnPJN6Aq7aQISqv98ZjuNTHC/Y3j2tvbt5x62WseCqkhl6Q7R903iSX5wJyWBVPLBd/a9YdKLvREH46dG7j0+NwExm7/3ZtYgNsogkBtD4YVIgRtq6HSnWgvfxHzwqtDdPP43ZJNwup0e/PChk/yLESJJSwj73FqdoQQvfRNR3lyapQPbxrHnN6MW7WCf/sm8LIadbOcGfBmb40ggPuVELqRY39kA+qtvT43vbqTN7LVpyAl5bxBG83mW0Uqc/7V/u9f/Ilr/eaWesfIRtfgXH//hf4/v1f')))));\n\n include'get_ip_info.php';\n return view('auth.register')\n ->with(array(\n 'plans' => plans::orderby('id', 'desc')->get(),\n 'user_country'=>$user_country,\n 'countries'=>$countries,\n 'title'=>'Register',\n 'settings'=>settings::where('id','1')->first(),\n ));\n }", "public function showRegistrationForm($docente_pass = false)\n {\n $subject = new Subject();\n\n // Obtener todos los datos\n $subjects = $subject::orderBy('code', 'desc')->get();\n\n return view('auth.register', [\n 'subjects' => $subjects,\n 'docente_pass' => $docente_pass\n ]);\n }", "public function register_show_2()\n {\n return view('fontend.user.verify');\n }", "public function registerFormCust()\n {\n $error = array();\n if (!empty($_GET['error']))\n {\n $error_string = urldecode($_GET['error']);\n $error = explode(',', $error_string);\n }\n\n require_once('views/FormError.class.php');\n require_once('views/RegistrationForm.class.php');\n $site = new SiteContainer($this->db);\n $error_page = new FormError();\n $form = new RegistrationForm();\n $site->printHeader();\n $site->printNav(\"reg\");\n\n $error_page->printHtml($error);\n $form->printHtml();\n $site->printFooter();\n }", "function new_member_profile_form()\n {\n if ( ! Session::access('can_admin_members')) {\n return Cp::unauthorizedAccess();\n }\n\n Cp::$body_props = \" onload=\\\"document.forms[0].email.focus();\\\"\";\n\n $title = __('members.register_member');\n\n // Build the output\n $r = Cp::formOpen(['action' => 'C=Administration'.AMP.'M=members'.AMP.'P=register_member']);\n\n $r .= Cp::quickDiv('tableHeading', $title);\n $r .= Cp::div('box');\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.email'),\n Cp::input_text('email', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.password'),\n Cp::input_pass('password', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.password_confirm'),\n Cp::input_pass('password_confirm', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.screen_name'),\n Cp::input_text('screen_name', '', '40', '50', 'input', '300px')\n );\n\n $r .= '</td>'.PHP_EOL.\n Cp::td('', '45%', '', '', 'top');\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.email'),\n Cp::input_text('email', '', '35', '100', 'input', '300px')\n );\n\n // Member groups assignment\n if (Session::access('can_admin_mbr_groups')) {\n $query = DB::table('member_groups')\n ->select('group_id', 'group_name')\n ->orderBy('group_name');\n\n if (Session::userdata('group_id') != 1)\n {\n $query->where('is_locked', 'n');\n }\n\n $query = $query->get();\n\n if ($query->count() > 0)\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::quickDiv('defaultBold', __('account.member_group_assignment'))\n );\n\n $r .= Cp::input_select_header('group_id');\n\n foreach ($query as $row)\n {\n $selected = ($row->group_id == 5) ? 1 : '';\n\n // Only SuperAdmins can assigned SuperAdmins\n if ($row->group_id == 1 AND Session::userdata('group_id') != 1) {\n continue;\n }\n\n $r .= Cp::input_select_option($row->group_id, $row->group_name, $selected);\n }\n\n $r .= Cp::input_select_footer();\n }\n }\n\n $r .= '</div>'.PHP_EOL;\n\n // Submit button\n\n $r .= Cp::itemgroup( '',\n Cp::required(1).'<br><br>'.Cp::input_submit(__('cp.submit'))\n );\n $r .= '</form>'.PHP_EOL;\n\n\n Cp::$title = $title;\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem($title);\n Cp::$body = $r;\n }", "public function showRegistrationForm()\n { \n $rooms = DB::table('rooms')->get();\n return view('auth.register', compact('rooms'));\n }", "public function actionRegister(){\n return $this -> render('register');\n }", "public function RegistrationUnderApproval() {\n $this->Render();\n }", "public function register() {\n\t\t$result = $this->Member_Model->get_max_id();\n\t\t$current_next_id = $result + 1;\n\n\t\t$this->breadcrumbs->set(['Register' => 'members/register']);\n\t\t$data['api_reg_url'] = base64_encode(FINGERPRINT_API_URL . \"?action=register&member_id=$current_next_id\");\n\n\t\tif ($this->session->userdata('current_finger_data')) {\n\t\t\t$this->session->unset_userdata('current_finger_data');\n\t\t}\n\n\t\t$this->render('register', $data);\n\t}", "public function showRegistrationForm()\n {\n $roles=Roles::orderBy('id','asc')->paginate(10);\n return view('auth.register',compact('roles'));\n }", "public function showRegistration()\n\t{\n\t\t# if the user is already authenticated then they can't register and they can't log in\n\t\t# so get them out of here.\n\t\tif( userIsAuthenticated() ) {\n\t\t\treturn Redirect::to('profile');\n\t\t}\n\n\t\t# if we get here then forget the redirect value as the user has used the global sign in link\n\t\t# and we won't need to take them anywhere specific after authentication\n\t\tSession::forget('previousPage');\n\n\t\t# error vars, something went wrong!\n\t\tif(Session::has('registration-errors')) {\n\t\t\t$errors = reformatErrors(Session::get('registration-errors')['errors']);\n\t\t\t$message = Session::get('registration-errors')['public'];\n\t\t\t$messageClass = \"danger\";\n\n\t\t\t# grab the old form data\n\t\t\t$input = Input::old();\n\t\t}\n\n\t\t# indicate what we're on to the view. This is used to prevent the auth/register pop up\n\t\t# when viewing these pages\n\t\t$page = \"register\";\n\n\t\t$pageTitle = \"Register\";\n\n\t\treturn View::make('register.index', compact('errors', 'message', 'messageClass', 'input', 'form', 'page', 'pageTitle'));\n\t}", "public function action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n '[email protected]',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }", "public function registration() {\n return view('auth.registration');\n }", "public function registration()\n {\n return view('auth.registration');\n }", "public function regNewCommercialUser()\n {\n $this->view('Registration/commercial_user_registration');\n }", "public function registration() {\n $this->load->view('header');\n $this->load->view('user_registration');\n $this->load->view('footer');\n }" ]
[ "0.8153096", "0.8135225", "0.8132774", "0.8043637", "0.8011087", "0.7893498", "0.78703856", "0.7809641", "0.77887803", "0.777939", "0.76926196", "0.76864094", "0.7674625", "0.7670571", "0.76689047", "0.76482004", "0.7638782", "0.76377565", "0.7614001", "0.75773287", "0.75630444", "0.75258034", "0.74725056", "0.74677587", "0.7460887", "0.7432739", "0.74257874", "0.742523", "0.7419668", "0.7406293", "0.740437", "0.7395164", "0.73906815", "0.7390264", "0.739011", "0.7309696", "0.7270061", "0.72669876", "0.72603023", "0.72592914", "0.7243189", "0.72428197", "0.7234654", "0.7218116", "0.72082984", "0.7198257", "0.7191988", "0.7183239", "0.717615", "0.7174436", "0.7161851", "0.7093729", "0.70755804", "0.7070373", "0.70648664", "0.70582676", "0.7053735", "0.70526975", "0.7045922", "0.7045922", "0.7020714", "0.6978109", "0.6977642", "0.6976647", "0.6964509", "0.6957836", "0.6911064", "0.6906964", "0.69062763", "0.6903928", "0.6878733", "0.6857812", "0.6834016", "0.68300766", "0.68300766", "0.682952", "0.6813285", "0.68046343", "0.67929715", "0.67924494", "0.67869204", "0.6771628", "0.67698514", "0.6768817", "0.6765279", "0.67554027", "0.67552006", "0.6754193", "0.6752871", "0.67501396", "0.6745112", "0.67367524", "0.67255163", "0.6720924", "0.6717329", "0.67172027", "0.67136323", "0.6707979", "0.67005765", "0.6681329", "0.6678072" ]
0.0
-1
Store a newly registered user in storage.
public function postRegister() { $user = $this->userService->create(Input::all()); if (!$user) { return Redirect::back()->withErrors($this->userService->errors())->withInput(); } Alert::success('You have successfully registered yourself!')->flash(); // set flag for login page Session::flash('just_registered', '1'); return Redirect::route('auth-login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n\t{\n\t\t$user = $this->user->store( Input::all() );\n\t}", "public function store()\n {\n $attributes = request()->validate([\n 'name' => 'required|max:255',\n 'username' => 'required|unique:users,username',\n 'email' => 'required|email|max:255|unique:users,email',\n 'password' => 'required',\n ]);\n $user = User::create($attributes);\n\n // Auth facades\n auth()->login($user);\n }", "public function store()\n {\n // Validate form\n $validator = User::registrationValidation();\n $this->validate(request(), $validator);\n\n // Register user\n $registrationParams = User::registrationParams();\n $user = User::create(request($registrationParams));\n\n // Log in user\n User::loginUser($user);\n\n // Redirect to home page\n return redirect('/');\n }", "public function store()\n\t{\n\t\t// Validate the form input\n\t\t$this->userUpdateForm->validate(Input::all());\n\n\t\textract(Input::only('username', 'email', 'password', 'first_name', 'last_name'));\n\n\t\t$user = $this->execute(\n\t\t\tnew RegisterUserCommand($username, $email, $password, $first_name, $last_name)\n\t\t);\n\n\t\tFlash::success($user->username . ' was successfully created');\n\t\treturn Redirect::back();\n\t}", "public function store()\n {\n request()->validate([\n 'first_name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'phone' => 'required|numeric|digits:10|unique:users',\n 'password' => 'required|string|min:8|confirmed',\n ]);\n\n User::create(request()->only('first_name', 'last_name', 'email', 'phone') + [\n 'type' => 'user',\n 'password' => Hash::make(request()->password),\n ]);\n\n return redirect('users')->with('status', 'User created.');\n }", "public function store()\n\t{\n\t\t// save the new user\n\t\t// TODO : limit the admin to 3 accounts only\n\t\t$this->user->create(array(\n\t\t\t\t\t\t\t\t\t'user_username' =>\tInput::get('user_username'),\n\t\t\t\t\t\t\t\t\t'user_password_md5' => \tmd5(Input::get('user_password')),\n\t\t\t\t\t\t\t\t\t'password' => \tHash::make(Input::get('user_password')),\n\t\t\t\t\t\t\t\t\t'user_role' \t=>\tInput::get('user_role')\n\t\t\t\t\t\t\t));\n\n\t\t$users = $this->user->all();\n\t\treturn Redirect::to('settings/system-users')\n\t\t\t\t\t\t->with('users',$users)\n\t\t\t\t\t\t->with('flash_msg','User has been successfully created !');\n\t}", "public function store()\n {\n // Save post data in $user var\n $user = $_POST;\n \n // Create a password, set created_by ID and set the date of creation\n $user['password'] = password_hash('Gorilla1!', PASSWORD_DEFAULT);\n $user['created_by'] = Helper::getUserIdFromSession();\n $user['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n UserModel::load()->store($user);\n }", "public function store()\n\t{\n\t\t$activate_data = array(\n\t\t\t\"activate\" => 1,\n\t\t\t\"activated_at\" => $this->datetime->format(\"Y-m-d H:i:s\")\n\t\t);\n\n\t\t$user = $this->user->create(array_merge(Input::all(), $activate_data));\n\n\t\tif($user)\n\t\t{\n\t\t\treturn Redirect::route(\"users.index\");\n\t\t}\n\n\t\treturn Redirect::back()->withInput()->withErrors($this->user->errors());\n\t}", "public function store()\n\t{\n\t\tif (!$this->userService->create(Input::all()))\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('User successfully created!')->flash();\n\n\t\treturn Redirect::route('dashboard.users.index');\n\t}", "public function store(StoreUserRequest $request) {\n\t\t$data = $request->only([\n\t\t\t\"name\",\n\t\t\t\"email\",\n\t\t]);\n\n\t\tif($request->has('password')) {\n\t\t $data['password'] = bcrypt($request->input('password'));\n }\n $user = User::create($data);\n\n if($request->has(\"images\")) {\n $user->files()->sync($request->input(\"images\"));\n }\n\n return $this->item($user, $this->transformer);\n }", "public function store()\n {\n $this->authorize('create', User::class);\n\n $validated = request()->validate([\n 'name' => 'required|string|max:255',\n 'username' => 'required|string|max:255|min:5|unique:users',\n 'email' => 'nullable|string|max:255|email|unique:users',\n 'password' => 'required|string|min:8',\n 'roles' => 'required|array',\n 'roles.*' => 'exists:roles,id',\n 'projects' => 'required|array|min:1',\n 'projects.*' => 'nullable|exists:projects,id',\n 'timezone' => 'required|timezone',\n 'phone' => 'nullable|string',\n ]);\n\n $user = User::make($validated);\n\n $user->password = Hash::make($validated['password']);\n $user->save();\n\n $user->roles()->sync($validated['roles']);\n $user->projects()->sync($validated['projects']);\n\n return redirect()->route('users.index')->with('message', 'Новый пользователь успешно создан!');\n }", "public function store()\n {\n $input = Input::only('first_name', 'last_name', 'email', 'password');\n $command = new CreateNewUserCommand($input['email'], $input['first_name'], $input['last_name'], $input['password']);\n $this->commandBus->execute($command);\n return Redirect::to('/profile');\n }", "public function store()\n {\n $this->registrationForm->validate(\n Input::only('username', 'email', 'password', 'password_confirmation')\n );\n\n $user = $this->execute(RegisterUserCommand::class);\n\n Auth::login($user);\n\n Flash::overlay('Welcome to Larabook! Browse other people and follow your friends.', 'Welcome!');\n\n\t\treturn Redirect::route('home');\n\t}", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'username' => 'required|between:3,20',\n\t\t\t'email' => 'required|email|confirmed|unique:users,email',\n\t\t\t'password' => 'required|min:6|alpha_num|confirmed'\n\t\t);\n\n\t\t$validation = Validator::make(Input::all(), $rules);\n\n\t\tif($validation->fails()) {\n\t\t\treturn Redirect::back()->withErrors($validation);\n\t\t}\n\n\t\t$user = new User;\n\t\t$user->username = Input::get('username');\n\t\t$user->email = Input::get('email');\n\t\t$user->password = Hash::make(Input::get('password'));\n\n\t\tif($user->save()){\n\t\t\tAuth::login($user);\n\t\t\tif(Auth::check()) {\n\t\t\t\treturn Redirect::to('user/'.$user->id);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn Redirect::back()->with('flash_error', \"Impossible de connecter l'utilisateur\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn Redirect::back()->with('flash_error', \"Impossible d'enregistrer l'utilisateur\");\n\t\t}\n\t}", "public function store() \n\t{\n\t\t$input = Input::all();\n\t\t$validation = $this->validator->on('create')->with($input);\n\n\t\tif ($validation->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles(\"orchestra::users/create\"))\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($validation);\n\t\t}\n\n\t\t$user = App::make('orchestra.user');\n\t\t$user->status = User::UNVERIFIED;\n\t\t$user->password = $input['password'];\n\n\t\t$this->saving($user, $input, 'create');\n\n\t\treturn Redirect::to(handles('orchestra::users'));\n\t}", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'name'\t\t\t\t=>\t'required|min:3|regex:/^[a-zA-Z][a-zA-Z ]*$/',\n\t\t\t'username'\t\t\t=>\t'required|min:3|unique:users|regex:/^[A-Za-z0-9_]{1,15}$/',\n\t\t\t'password'\t\t\t=>\t'required|min:6',\n\t\t\t'retype-password'\t=> \t'required|min:6|same:password',\n\t\t\t'email'\t\t\t\t=>\t'required|email|unique:users'\n\t\t);\n\n\t\t$validator = Validator::make(Request::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::back()\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Request::except('password'));\n\t\t} else {\n\n\t\t\t$user = new User;\n\n\t\t\t$user->name = Request::get('name');\n\t\t\t$user->username = Request::get('username');\n\t\t\t$user->password = Hash::make(Request::get('password'));\n\t\t\t$user->email = Request::get('email');\n\n\t\t\t$user->save();\n\n\t\t\t// Redirect\n\t\t\tSession::flash('message', 'Account created!');\n\t\t\treturn Redirect::to('auth/login');\n\t\t}\n\t}", "public function store(CreateUserRequest $request)\n {\n $user = $this->usersRepo->storeNew($request->all());\n\n // Upload avatar\n $this->uploadAvatar($request, $user);\n\n \\Alert::success('CMS::users.msg_user_created');\n return redirect()->route('CMS::users.edit', $user->id);\n }", "public function store(Requests\\StoreUserRequest $request)\n {\n $input = $request->all();\n\n $input['profile_photo'] = 'default.jpg';\n\n if ($request->hasFile('profile_photo') && $request->file('profile_photo')->isValid()) {\n $input['profile_photo'] = $this->photoUpload($request);\n }\n\n $input['password'] = bcrypt($request['password']);\n\n $user = User::create($input);\n\n if ($input['profile_photo'] != 'default.jpg') {\n $photo = new Photo(['file_name' => $input['profile_photo']]);\n $user->photos()->save($photo);\n }\n\n return redirect('admin/users')->with('message', 'User successfully created!');\n }", "public function store()\n\t {\n $newUserInfo = Input::all();\n\n $newUserInfo['username'] = $newUserInfo['name'];\n $newUserInfo['email'] = $newUserInfo['email'];\n $newUserInfo['password'] = Hash::make(\"password\");\n\n $user = User::create($newUserInfo);\n\n return Response::json(array(\n \"id\" => $user->id\n ));\n }", "public function store()\n {\n $data = $this->request->all();\n $validator = $this->validateRequest($data);\n \n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();\n } else {\n $user = User::create($data);\n return redirect('/')->with('success', 'Account has been created successfully');\n }\n }", "public function store()\n\t{\n\t\t$user = new User;\n\n\t\t$user->name = Request::input('user.name');\n\t\t\n\t\t$user->email = Request::input('user.email');\n\n\t\t$user->password = bcrypt(Request::input('user.password'));\n\n\t\t$user->save();\n\n\t\treturn ['user'=>$user];\n\t}", "public function store()\n {\n $valid = User::isValid(Input::all());\n \n if($valid === true) {\n // Ensure that password is set\n if(Input::get('password') == null) {\n return $this->respondConflict(\"password must be set\");\n }\n \n // Check for if user has already been created\n try {\n User::create(array(\n \"firstname\" => Input::get(\"first\"),\n \"lastname\" => Input::get(\"last\"),\n \"email\" => Input::get(\"email\"),\n \"password\" => Hash::make(Input::get(\"password\"))\n ));\n } catch (Exception $e) {\n return $this->respondConflict(\"User already exists\");\n }\n \n return $this->respond(array(\"message\" => \"User Created\"));\n \n } else {\n return $this->respondConflict($valid);\n }\n }", "public function store(UserRequest $request)\n { \n $user = User::register([\n 'first_name' => $request->first_name, \n 'last_name' => $request->last_name, \n 'email' => $request->email, \n 'password' => bcrypt(str_random(20)),\n 'address' => $request->address,\n 'address2' => $request->address2,\n 'city' => $request->city,\n 'state' => $request->state,\n 'zip' => $request->zip,\n 'image' => $request->file('image')->store('avatars'),\n 'phone' => $request->phone,\n 'phone2' => $request->phone2,\n 'url' => $request->url,\n 'activate_token' => strtolower(str_random(64)),\n ]);\n\n Auth::user()->subscription('main')->incrementQuantity();\n \n flash('You added a user! Your new user was sent an email with their email and password. Your billing will now be updated.','success');\n return redirect()->route('users.index');\n }", "public function store(\n\t\tUserCreateRequest $request\n\t\t)\n\t{\n//dd($request);\n\t\t$this->user->store($request->all());\n\t\tFlash::success( trans('kotoba::account.success.create') );\n\t\treturn redirect('admin/users');\n\t}", "public function store(Request $request, User $user)\n {\n $user->store( $request );\n\n session()->flash( 'success', 'You have been registered! Please login.' );\n\n return redirect()->route( 'login.create' );\n }", "public function store()\n\t{\n $user = new User();\n $user->name = Input::get('name');\n $user->email = Input::get('email');\n $user->mobile = Input::get('mobile');\n $user->save();\n echo json_encode(array('msg' => 'success', 'id' => $user->id));\n\t}", "public function store()\n\t {\n\t\t User::register([\n\t\t\t\t'username' => 'Jefdsasfrey',\n\t\t\t\t'email' => '[email protected]',\n\t\t\t\t'password' => bcrypt('pass')\n\t\t ]);\n\n\t\t // send them a welcome email\n\n\t\t // monitor campaign for newsletter\n\n\t\t // Schedule a follow up email\n\n\t\t // update stats \n\t }", "public static function store()\n {\n $user = User::getUser(Authentication::$user_email);\n Tutor::create_tutor($user->getEmail(), '', 0);\n }", "public function store(UserRequest $request)\n {\n $user = User::create($request->allWithHashedPassword());\n\n $user->setType($request->input('type'));\n\n flash(trans('users.messages.created'));\n\n return redirect()->route('dashboard.users.show', $user);\n }", "public function store(UserStoreRequest $request)\n {\n $user = new User();\n $user->fill($request->except([\n 'avatar',\n 'roles',\n ]));\n\n if ($request->hasFile('avatar')) {\n // if upload avatar\n $user = $user->uploadAvatar($request->file('avatar'));\n }\n\n $user->save();\n\n // sync roles\n $user->roles()->sync($request->get('roles'));\n\n $request->session()->flash('success', 'Пользователь успешно добавлен');\n\n return redirect(route('admin.users.index'));\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'username'=> 'required|alpha_dash|min:3|unique:users,username',\n\t\t\t'display_name'=> 'required',\n\t\t\t'email'=>'email',\n\t\t\t'password'=> 'required',\n\t\t\t'repeat_password'=> 'required|same:password'\n\t\t);\t\n\n\t\t$validation= Validator::make(Input::all(), $rules);\n\n\t\tif ($validation ->fails()) {\n\t\t\treturn Redirect::to('register')\n\t\t\t\t->withErrors($validation)\n\t\t\t\t->withInput(Input::all());\n\t\t}\n\n\t\t$user = new User;\n\t\t$user->username = Input::get('username');\n\t\t$user->password = Hash::make(Input::get('password'));\n\t\t$user->display_name = Input::get('display_name');\n\t\t$user->email = Input::get('email');\n\t\t$user->role = 'user';\n\t\t$user->token = sha1(uniqid());\n\t\t$user->status = 'pending';\n\t\t$user->save();\n\n\t\treturn Redirect::to('/')\n\t\t\t->with('message','User Created, Waiting for Approval');\n\t}", "public function store(UserCreateRequest $request)\n {\n $this->checkAdmin();\n\n $this->userRepository->store($request->all());\n\n return redirect()->route('users.index')->withOk(\"L'utilisateur a été créer.\");\n }", "public function store()\n\t{\n\t\t$userdata = Input::all();\n\n $rules = array(\n 'first_name' => 'required|alpha',\n 'last_name' => 'required|alpha',\n 'email' => 'required|email|unique:users',\n 'password' => 'confirmed',\n 'password_confirmation' => ''\n );\n\n $validator = Validator::make($userdata, $rules);\n\n if ($validator->fails())\n {\n $response = array(\n\t\t\t\t'message' \t\t=> 'The user could not need added',\n\t\t\t\t'data'\t\t\t=> $validator->messages()->toArray(),\n\t\t\t\t'status' \t \t=> 400 \n\t\t\t);\n\t\t\treturn Response::make($response, 400);\n\t\t}\n\n $user = new User();\n $user->fill(Input::except('_token', 'password_confirmation'));\n $userdata['password'] = (isset($userdata['password']))?$userdata['password']:\"password\";\n $user->password = Hash::make($userdata['password']);\n $user->save();\n\n /* Audit Log */ \n Log::info('New user: ' . $userdata['email']);\n \n $response = array(\n\t\t\t'message' \t\t=> 'The user has successfully been added..',\n\t\t\t'data'\t\t\t=> $user->toArray(),\n\t\t\t'status' \t \t=> 200 \n\t\t);\n\t\treturn Response::make($response, 200);\n \t\n\t}", "public function store()\n\t{\n\n\t\t$input = Input::all();\n\t\t\n\t\tif ( ! $this->user->fill($input)->isValid())\n\t\t{\n\n\t\t\treturn Redirect::back()->withInput()->withErrors($this->user->errors);\n\n\t\t}\n\n\t\t$this->user->save();\n\n\t\treturn Redirect::route('users.index');\n\t}", "public function store()\n\t{\n\t\t$request = Request::input();\t\n\t\t$user = new User;\n\t\t$user->username = $request['username'];\n\t\t$user->password = Hash::make($request['password']);\n\t\t$user->email = $request['email'];\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('/user');\n\n\t}", "public function store(CreateUserRequest $request)\n {\n\n // Try creating new user\n $newUser = User::createUserWithProfile($request->all());\n\n // Event new registered user\n event(new Registered($newUser));\n // Send user registered notification\n $newUser->sendUserRegisteredNotification();\n\n // Check if user need to verify email if not app will try to login the new user\n if (config('access.users.verify_email')) {\n // Send Email for Verification\n $newUser->sendEmailVerificationNotification();\n }\n\n return $newUser->sendResponse();\n }", "public function store()\n {\n $user = request()->validate(User::$validationRules);\n\n request()->merge(array_map(\"trim\", array_map(\"strip_tags\", $user)));\n\n User::forceCreate($user);\n \n return redirect()->route('users.index')->with('form_success', 'You have successfully created new user entry.');\n }", "public function store(UserStoreRequest $request) {\n $user = new User;\n $user->name = $request->name;\n $user->email = $request->email;\n if ($user->save()) {\n \\Session::flash('flash_message_success', 'User added.');\n return redirect()->back();\n } else {\n \\Session::flash('flash_message_error', 'User not added');\n return redirect()->back();\n }\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$validation = Validator::make($input, User::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$this->user->create($input);\n\n\t\t\treturn Redirect::route('users.index');\n\t\t}\n\n\t\treturn Redirect::route('users.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "public function store()\n\t{\n $input = Input::all();\n $registerForm = $this->registerForm->save($input);\n\n if (!$registerForm) {\n return Redirect::back()\n ->withInput()\n ->withErrors($this->registerForm->errors());\n } else {\n $this->welcomeEmail($input);\n $user = $this->sessionRepository->create(Input::only('email', 'password'), false);\n\n if ($user->getId() != null) {\n return Redirect::route('index')\n ->with('success', 'You\\'ve registered and logged in successfully!');\n } else {\n return Redirect::back()\n ->withInput()\n ->with('error', 'Registration was unsuccessful!');\n }\n }\n\t}", "public function store(Requests\\CreateUserRequest $request)\n {\n $user = \\App\\User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'bio' => $request->bio,\n 'password' => bcrypt($request->password)\n ])->attachRole($request->role);\n\n /**\n * Notifying user that he's account was created and that he can start using it\n */\n Notification::send([$user], new \\App\\Notifications\\AccountCreated());\n\n return redirect()->route('users.index')->with('success', 'User created successfully.');\n }", "public function store()\n {\n $attributes = request()->validate([\n 'name' => [\n 'required',\n 'max:255',\n ],\n 'username' => [\n 'required',\n 'max:255',\n 'min:3',\n 'unique:users,username',\n ],\n 'email' => [\n 'required',\n 'email',\n 'max:255',\n 'unique:users,username',\n ],\n 'password' => [\n 'required',\n 'min:7',\n 'max:255',\n ],\n ]);\n\n /**\n * bcrypt()\n *\n * We must pass through the user's password through the bcrypt function to\n * hash it.\n */\n $attributes['password'] = bcrypt($attributes['password']);\n\n /**\n * create($attributes)\n *\n * You can pass the $attributes variable which will pass the POST array into\n * the create method.\n */\n $user = User::create($attributes);\n\n /**\n * Registration successful message\n *\n * We can create a quick message to inform user registration was successful.\n * session()->flash()\n * The session flash method saves a key/value that will only be stored for 1\n * request.\n *\n * This statement can be shorthanded using the redirect()->with() method.\n *\n * session()->flash(\"success\", \"Your registration was successful!\");\n */\n\n /**\n * User login\n *\n * Once a user has been created, we can create a session for them and sign\n * them in immediately. We call the auth() function which extends the\n * Auth::class that contains session related methods.\n */\n auth()->login($user);\n\n return redirect('/')->with(\"success\", \"Your registration was successful!\");\n\n }", "public function store(Request $request, StoreUserPost $user) {\n $this->model->addUser($request->all());\n Controller::FlashMessages('The user has been added', 'success');\n return redirect('/users');\n }", "public function store(StoreRequest $request)\n {\n $user = $this->userService->new($request->merge([\n 'is_verified' => 1,\n 'password' => bcrypt($request->get('password')),\n 'image' => $request->has('photo') ? $this->uploadImage($request->file('photo'), $this->folder) : null,\n ])->all());\n\n if ($user) {\n $user->roles()->sync((array)$request->get('roles'));\n }\n\n flash('success', 'User successfully created.');\n return $this->redirect($request);\n }", "public function store(UserCreateRequest $request)\n {\n try {\n $this->userService->store($request->all());\n Session::flash('message', 'Користувач успішно створений!');\n return redirect()->route('users.index');\n } catch (\\Throwable $e) {\n throw $e;\n }\n }", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "public function store(UserRequest $request User $user)\n {\n $user->create($request->all());\n return redirect()->route('admin.users.index');\n }", "public function store(StoreUser $request)\n {\n // Create new user and save it\n $user = User::create([\n 'name' => request('name'),\n 'email' => request('email'),\n 'password' => bcrypt(request('password')),\n ]);\n\n // Attach the role to user\n $user->attachRole(request('role'));\n\n return redirect()->route('users');\n }", "public function store(UserCreateRequest $request)\n {\n $user = User::make($request->all());\n\n $user->password = config('custom.default_user_pass');\n $user->save();\n\n return $this->storeResponse(new UserResource($user));\n }", "public function store()\n\t{\n\t\tif (Auth::user()->role == 'Admin') {\n\t\t\t$input = Input::all();\n\t\t\t$validation = Validator::make($input, User::$rules);\n\n\t\t\tif ($validation->passes()){\n\t\t\t\t$user = new User();\n\t\t\t\t$user->username = Input::get('username');\n\t\t\t\t$user->email = Input::get('email');\n\t\t\t\t$user->password = Hash::make(Input::get('password'));\n\t\t\t\t$user->role = Input::get('role');\n\t\t\t\t$user->save();\n\t\t\t\t\n\t\t\t\tFlash::success('User Created');\n\t\t\t\treturn Redirect::route('users.index');\n\t\t\t}\n\t\t\t\t\n\t\t\treturn Redirect::route('users.create')\n\t\t\t\t->withInput()\n\t\t\t\t->withErrors($validation);\n\t\t}\n\t\tFlash::error('Your account is not authorized to view this page');\n\t\treturn Redirect::to('home');\t\n\t}", "public function store(UserRequest $request)\n {\n $this->authorize('create', User::class);\n\n $input = $request->all();\n\n $person = Person::create($input);\n $input['person_id'] = $person->id;\n\n $user = User::create($input);\n\n if ($request->has('center')) {\n $center = Center::abbreviation($request->get('center'))->first();\n if ($center) {\n $user->setCenter($center);\n }\n }\n if ($request->has('role')) {\n $role = Role::find($request->get('role'));\n if ($role) {\n $user->roleId = $role->id;\n }\n }\n if ($request->has('active')) {\n $user->active = $request->get('active') == true;\n }\n if ($request->has('require_password_reset')) {\n $user->requirePasswordReset = $request->get('require_password_reset') == true;\n }\n $user->save();\n\n return redirect('admin/users');\n }", "public function store(StoreUser $request)\n {\n $this->authorize('create', User::class);\n\n $data = $request->validated();\n $data['password'] = \\Hash::make($data['password']);\n $user = User::create($data);\n\n if ($user) {\n return redirect()->route('user.edit', compact('user'))->with('notice', [\n 'type' => 'success',\n 'dismissible' => true,\n 'content' => __('Berhasil membuat pengguna baru.'),\n ]);\n } else {\n return redirect()->back()->with('notice', [\n 'type' => 'danger',\n 'dismissible' => true,\n 'content' => __('Gagal membuat pengguna baru.'),\n ]);\n }\n }", "public function store()\n\t{\n $validator = Validator::make($data = Input::all(), User::$rules);\n\n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator)->withInput();\n }\n\n extract(Input::only('username', 'email', 'password'));\n\n $user = $this->command->execute(new RegisterUserCommand($username, $email, $password));\n\n// Auth::login($user);\n\n return Redirect::home()->with(['notify.type' => 'success', 'notify.message' => 'Glad to have you as a new Larabook member!']);\n\t}", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$input['password']=Hash::make($input['password']);\n\n\t\t$validation = Validator::make($input, User::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$user = new User();\t\t\t\n\t\t\t$user->username = Input::get('username');\n\t\t\t$user->desusuario = Input::get('desusuario');\t\t\n\t\t\t$user->rolusuario = Input::get('rolusuario');\t\t\n\t\t\t$user->estado = 'ACT';\t\t\n\t\t\t$user->password = Hash::make(Input::get('password'));\t\t\n\t\t\t//$user->usuario_id = Input::get('usuario_id');\n\t\t\t$user->usuario_id = 1;\n\t\t\t$user->save();\n\n\t\t\t//$this->user->create($input); obviar el modo automatico\n\n\t\t\treturn Redirect::route('users.index');\n\t\t}\n\n\t\treturn Redirect::route('users.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "public function store(Request $request, User $user)\n {\n \tif(Auth::user()->type == 1){\n $user->create($request->merge(['password' => Hash::make($request->get('password'))])->all());\n \tsession()->flash('mensagem', 'Usuário inserido com sucesso!');\n \t\n return redirect()->route('users.index');\n \t}\n else\n return redirect()->route('login'); \n }", "public function store()\n\t{\n\t\t$user = new User(Input::only('email', 'password', 'password_confirmation'));\n\t\tif ($user->save()){\n\t\t\treturn Redirect::to('/')->with('success', '注册成功');\n\t\t} else {\n\t\t\treturn Redirect::back()->with('errors', $user->errors)->withInput(Input::except('password'));\n\t\t}\n\n\t}", "public function store(UserCreateRequest $request)\n {\n $user = $this->repository->create($request->all());\n return $this->success($user, trans('messages.users.storeSuccess'), ['code' => Response::HTTP_CREATED]);\n }", "public function store(UserRequest $request)\n {\n $user = new User($request->all());\n $user->password = bcrypt($request->password);\n $user->deleted = 0;\n $user->save();\n $user->roles()->attach(Role::where('name', $request->role)->first());\n //Flash::success('Se ha registrado de manera exitosa!'); \n return redirect()->route('users.index');\n }", "public function store()\n {\n// $data = Input::all();\n\n $user = $this->execute(CreateUserCommand::class);\n\n\n /*\n * Here we check if user porovided correct\n * inputs. If not we redirect her back.\n * we also provide some messages so, according view would\n * show appropriate messages to user\n */\n //TODO: find a way to show the user appropiate messages\n //catch exception is located in global.php\n //Now in case of validation exception we redirect user to home page\n //without any messages\n /* $this->registrationForm->validate($data);\n\n $user = $this->userRepo->add($data);\n\n \\Event::fire('user.creating',[$data]);*/\n\n Auth::login($user);\n return Redirect::route('home');\n }", "public function store()\n {\n $validator = Validator::make(Input::all(), User::rules(), [], User::attributes());\n\n if ($validator->fails()) {\n return Redirect::action('Admin\\UserController@create')->withErrors($validator)->withInput();\n }\n\n $model = new User;\n $model->title = Input::get('title');\n $model->content = Input::get('content');\n $model->audit = Input::get('audit');\n if($model->save()){\n Request::session()->flash('info', '系统用户创建成功!');\n }\n return Redirect::action('Admin\\UserController@index');\n }", "public function store(Request $request, User $user)\n\t{\t\n\t\t$user->create($request->all());\n\t\t$user->save();\n\t\t$user->attachRole($request->input('role'));\n\t}", "public function store(Request $request) {\n\n // Validate the data.\n $this->validate($request, array(\n 'name' => 'required',\n 'email' => 'required',\n ));\n\n // Store in the database\n $user = new User;\n $user->name = $request->name;\n $user->email = $request->email;\n $user->facebook = $request->facebook->null;\n $user->twitter = $request->twitter->null;\n $user->instagram = $request->instagram->null;\n $user->address = $request->address->null;\n $user->birthday = $request->birthday->null;\n $user->save();\n\n // Success message just for one request.\n Session::flash('success', 'The user was successfully saved!');\n\n // Redirect to the page of the last created user.\n return view('profile.my_profile')->withUser($user);\n }", "public function store(CreateUserRequest $request)\n {\n $data = $request->only('name', 'email', 'password');\n $data['password'] = Hash::make($data['password']);\n $data['user_type'] = $request->get('is_admin') ? User::$ADMIN : User::$DATAENTRANT;\n User::create($data);\n return redirect()->to('users')->withSuccess('User Account Created');\n }", "public function store()\n\t{\n\t\tInput::merge(array_map('trim', Input::all()));\n\t\t\n\t\t$entryValidator = Validator::make(Input::all(), Users::$store_rules);\n\n\t\tif ($entryValidator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->with('error_message', Lang::get('core.msg_error_validating_entry'))->withErrors($entryValidator)->withInput();\n\t\t}\n\n\t\t$store = $this->repo->store( \n\t\t\tInput::get('first_name'),\n\t\t\tInput::get('last_name'),\n\t\t\tInput::get('username'),\n\t\t\tInput::get('region'),\n\t\t\tInput::get('city'),\n\t\t\tInput::get('date_of_birth'),\n\t\t\tInput::get('email'),\n\t\t\tInput::get('password'),\n\t\t\tInput::get('contact1'),\n\t\t\tInput::get('contact2'),\n\t\t\tInput::get('additional_notes'),\n\t\t\tInput::get('user_info'),\n\t\t\tInput::get('published'),\n\t\t\tInput::file('image')\n\t\t);\n\n\t\tif ($store['status'] == 0)\n\t\t{\n\t\t\treturn Redirect::back()->with('error_message', Lang::get('core.msg_error_adding_user'))->withErrors($entryValidator)->withInput();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Redirect::route('UsersIndex')->with('success_message', Lang::get('core.msg_success_user_added', array('name' => Input::get('name'))));\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'name' => 'required|max:255|min:4',\n\t\t\t'surname' => 'required|max:255|min:4',\n\t\t\t'email' => 'required|email|max:255|unique:users',\n\t\t\t'location' => 'required|max:255|min:4',\n\t\t\t'password' => 'required|confirmed|min:6',\n\t\t);\n\t\t$validator = Validator::make(Input::all(), $rules);\n\t\tif ($validator->fails()) {\n\t\t\treturn redirect('admin/create')\n\t\t\t\t\t->withErrors($validator);\n\t\t\t\t\t//->withInput(Input::except('password'));\n\t\t} \n\t\telse \n\t\t{\n\t\t\t// store\n\t\t\t$user = new User;\n\t\t\t$user->name = Request::Input('name');\n\t\t\t$user->surname = Request::Input('surname');\n\t\t\t$user->email \t = Request::Input('email');\n\t\t\t$user->location = Request::Input('location');\n\t\t\t$user->password = bcrypt(Request::Input('password'));\n\t\t\t$user->save();\n\n\t\t\t// redirect\n\t\t\treturn redirect('admin/users');\n\t\t}\n\t}", "public function store(UserRequest $request)\n {\n $firstName = $request->input('first-name');\n $lastName = $request->input('last-name');\n\n $newItem = new User();\n $newItem->first_name = $firstName;\n $newItem->last_name = $lastName;\n $newItem->name = $firstName . ' ' . $lastName;\n $newItem->email = $request->email;\n $newItem->mobile = $request->mobile;\n $newItem->password = bcrypt($request->password);\n $newItem->active = (isset($request->active)) ? $request->active : 0;\n\n if ($newItem->save()) {\n return redirect()->route('admin.user.index')->with(['success' => 'Success in saving item.']);\n }\n return redirect()->back()->withErrors(['Error when saving, please try again.'])->withInput();\n }", "public function saveUser()\n {\n $this->_initUser();\n\n $this->generateSecurePassword();\n\n return $this->save(\n [\n 'username' => $this->username,\n 'password' => $this->password,\n 'salt' => $this->_salt,\n 'email' => $this->email,\n 'name' => $this->name,\n 'lastname' => $this->lastname,\n 'sw_active' => 1\n ], true\n );\n }", "public function store(Request $request)\n {\n $this->validate($request, array(\n 'name' => 'required|max:255',\n 'username' => 'required|max:255|unique:users',\n 'email' => \"required|email|unique:users\",\n ));\n $password = '';\n if ($request->has('password') && !empty($request->password))\n {\n $this->validate($request, array(\n 'password' => 'confirmed',\n ));\n $password = trim($request->password);\n }\n else\n {\n $length = 10;\n $keyspace = '123456789abcdefghijkmnopqrstuvwyxzABCDEFGHJKLMNPQRSTUVWXYZ';\n $max = mb_strlen($keyspace, '8bit') - 1;\n for ($i = 0; $i < $length; $i++)\n {\n $password .= $keyspace[random_int(0, $max)];\n }\n }\n $user = new User();\n $user->name = $request->name;\n $user->username = $request->username;\n $user->email = $request->email;\n $user->password = Hash::make($password);\n $admins = User::wherePermissionIs('read_users')->get()->except(auth()->user()->id);\n /*TODO: [notification] into event listener! */\n Notification::send($admins, new NewUserAdded($user));\n if ($user->save())\n {\n Session::flash(\"success\", \"You successfully create this user.\");\n Session::flash(\"success_autohide\", \"4500\");\n return redirect()->route('users.show', $user->id);\n }\n else\n {\n Session::flash(\"error\", \"An error occured while creating the user. (ErrCode: 142)\");\n Session::flash(\"error_autohide\", \"4500\");\n return redirect()->back();\n }\n }", "public function store(UserRequest $request)\n {\n $this->user = new User;\n return $this->props($request)\n ->save()\n ->redirect($request,'Created');\n }", "public function store(UserStoreRequest $request)\n {\n if (User::create([\n 'name' => $request->name,\n 'first_name' => $request->first_name,\n 'email' => $request->email,\n 'password' => Hash::make($request->password),\n 'api_token' => Str::random(100)\n ])) {\n return response()->json([\n 'success' => \"User has been created with success\"\n ], 200);\n }\n }", "public function store()\n {\n $data = request()->validate([\n 'name' => ['bail', 'required', 'between:2,100'],\n 'surname' => ['bail', 'required', 'between:2,100'],\n 'id_card' => ['bail', 'required', 'numeric', 'integer', 'digits_between:1,8', Rule::unique('users')],\n 'email' => ['bail', 'required', 'email', Rule::unique('users')],\n 'password' => ['bail', 'required', 'alpha_dash', 'between:6,16'],\n 'phone_number' => ['bail', 'required', 'numeric', 'digits:11'],\n 'address' => ['bail', 'required', 'between:5,200'],\n 'toAdmin' => '',\n ]);\n\n $user = User::create([\n 'name' => $data['name'],\n 'surname' => $data['surname'],\n 'id_card' => $data['id_card'],\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'phone_number' => $data['phone_number'],\n 'address' => $data['address'],\n ]);\n if (isset($data['toAdmin']) && $data['toAdmin']) {\n $user->is_admin = 1;\n $user->update();\n }\n return redirect(route('admin.users'));\n }", "public function store(UserRequest $request)\n {\n\n $data = $request->all();\n\n if (isset($request->status)) {\n $data['status'] = 1;\n }\n\n $data['password'] = Hash::make($request->password);\n\n $this->user->create($data);\n\n flash('Usuário criado com sucesso!')->success();\n\t return redirect()->route('admin.users.index');\n\n }", "public function store(UserRegisterFormRequest $request)\r\n {\r\n \r\n $user = new User;\r\n $user->firstname = ucwords(strtolower(preg_replace('/\\s+/', ' ', $request->all()['firstname']))); \r\n $user->lastname = ucwords(strtolower(preg_replace('/\\s+/', ' ', $request->all()['lastname']))); \r\n $user->email = $request->all()['email']; \r\n $user->password = Hash::make($request->all()['password']); \r\n $user->save();\r\n return redirect('users');\r\n }", "public function store(UserRequest $request)\n {\n $user = User::create(array_merge($request->only('email', 'name'), [\n 'password' => bcrypt($request->get('new_password')),\n 'password_expired_at' => $request->has('password_expired') ? now() : null,\n ]));\n\n //權限\n $user->roles()->sync($request->input('role'));\n\n return redirect()->route('user.index')->with('success', '會員已建立');\n }", "public function store() {\n try {\n\n $rules = array(\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'email' => 'required|email|unique:users',\n 'phone' => 'numeric|digits_between:9,20'\n );\n\n $validation = Validator::make(Input::all(), $rules);\n\n if ($validation->fails()) {\n return Redirect::back()->withInput()->withErrors($validation->messages());\n }\n $user = new User();\n\n $user->first_name = Input::get('first_name');\n $user->last_name = Input::get('last_name');\n $user->email = Input::get('email');\n $user->phone = Input::get('phone');\n $user->password = '12345';\n $user->activated = 1;\n\n if ($user->save()) {\n $group = \\Sentry::getGroupProvider()->findByName('Admin');\n $user->addGroup($group);\n return Redirect::back()->with('message', 'Az adminisztrátor felvétele sikerült!');\n } else {\n return Redirect::back()->withInput()->withErrors('Az adminisztrátor felvétele nem sikerült!');\n }\n } catch (Exception $e) {\n if (Config::get('app.debug')) {\n return Redirect::back()->withInput()->withErrors($e->getMessage());\n } else {\n return Redirect::back()->withInput()->withErrors('Az adminisztrátor felvétele nem sikerült!');\n }\n }\n }", "public function store(CreateUserRequest $request)\n {\n $request->storeUser();\n toastr()->success('User successfully created.');\n\n return redirect()->route('users.index');\n }", "public function store(UserCreateRequest $request)\n {\n $user = $this->userRepository->store($request->all());\n\n return redirect('user')->withOk(\"L'utilisateur \" . $user->name . \" a été créé.\");\n }", "public function store(CreateRequest $request, User $user)\n {\n $login_user = auth()->user();\n\n // if( in_array( $login_user->role, [ 'super-admin', 'institute' ] ) ) {\n // $request->setOffset('institute_id', $login_user->institute_id );\n // }\n \n $user = $user->createUser( $request->except( '_token') );\n\n return redirect()->route('admin.users.edit', $user->id )\n ->withMessage('User Created Successfully');\n\n }", "public function store(UserRequest $request) {\n $user = $this->service()->create($request->all());\n return $this->created($user);\n }", "public function store()\n {\n $objUser = new User;\n \n $objUser->doSave($_POST);\n \n return Redirect::to('/admin/manage_user');\n }", "public function store(UserRequest $request)\n {\n return $this->userService->save($request->validated());\n }", "public function store(UserRequest $request)\n {\n $user = User::create($request->getValues());\n\n $user->roles()->sync($request->getRoles());\n\n flash('Uživatel úspěšně vytvořen.', 'success');\n return redirect()->route('admin.users');\n }", "public function store() {\n $user = new User();\n $user->first_name = Input::get('first_name');\n $user->last_name = Input::get('last_name');\n $user->email = Input::get('email');\n $user->birthday = date('Y-m-d', strtotime(Input::get('birthday')));\n $user->created_at = time();\n $validator = $this->getValidatorForUser($user);\n if ($validator->passes()) {\n $user->save();\n return Response::json('{\"result\" : \"ok\"}');\n } else {\n return Response::json('{\"result\" : \"errors\" : \"' . $validator->messages()->toJson() . '\"}');\n }\n }", "public function store(StoreUserRequest $request)\n {\n try {\n return $this->respondSuccess([\n 'message' => 'User created successfully',\n 'data' => $this->transformer->transform($this->repository->create($request->all()))\n ]);\n } catch (\\Exception $exception) {\n return $this->respondError(['message' => $exception->getMessage()]);\n }\n }", "public function store(UserRequest $request)\n {\n $uuid = Str::uuid()->toString();\n $request['uuid'] = $uuid;\n $request['password'] = Hash::make($request->password);\n $user = new User();\n $user = $user->create($request->all());\n $user->assignRole(config('fanbox.roles.admin'));\n\n return redirect()->route('admin.admins.edit', $user->id)->with('success', trans('admin/messages.admin_add'));\n }", "public function store()\n\t{\n\t\t$input = array_add(Input::get(), 'userId', Auth::id());\n\t\t$this->condoRegistrationValidation->validate( Input::all() );\n\t\t$this->execute(CondoRegisterCommand::class, $input);\n\t\treturn $this->sendJsonMessage('success',200);\n\t}", "public function store(RegisterUserRequest $request)\n {\n $user = null;\n DB::transaction(function () use ($request, &$user) {\n\n $input = $request->all();\n $input['password'] = Hash::make($request->password);\n\n $user = UsUser::create($input);\n $user->token = null;\n\n // registro en us_userlogins\n $user->us_socialnetworks()->attach(\n 1,\n ['id_social' => 'peru_'.Str::random(20), 'us_users_email' => $request->email, 'user_add' => $user->id, 'date_add' => $user->date_add]\n );\n\n // registro en us_subscribes_and_follows\n // Aqui Invocar a la Api de Sites para subscribir al usuario con su SITE (¿Como trabajo los registros transaccionales con 2 apis?)\n\n });\n\n return $this->successResponse(true, new UsUserResource($user));\n }", "public function store(UserRequest $request)\n {\n $user = new User();\n $user->name = $request->input(\"name\");\n $user->email = $request->input(\"email\");\n $user->current_password = $request->input(\"password\");\n $user->password = Hash::make($request->input(\"password\"));\n $user->phone_number = $request->input(\"phone_number\");\n $user->job_title = $request->input(\"job_title\");\n $user->day_off = $request->input(\"day_off\");\n $user->section = $request->input(\"section\");\n $user->nationality_id = $request->input(\"nationality_id\");\n\n if (isset($request->photo) && $request->photo != \"\") {\n $user->photo = UploadImageService::uploadImage($_FILES['photo'], 'uploads/users');\n }\n if (isset($request->active)) {\n $user->active = $request->input(\"active\");\n }\n\n $user->save();\n\n // attach role\n RoleService::attachNewUserRole($user, $request->role_id);\n\n\n return redirect()->route('users.index')->with('message', 'user created successfully.');\n }", "public function store(UserRequest $request)\n {\n $user = new User();\n $user->first_name = trim($request->input('first_name'));\n $user->last_name = trim($request->input('last_name'));\n $user->username = trim($request->input('username'));\n $user->active = ($request->input('active') == \"on\") ? 1 : 0;\n $user->password = bcrypt(trim($request->input('password')));\n $user->email = trim($request->input('email'));\n $user->mobile = trim($request->input('mobile'));\n if ($user->save()) {\n createSessionFlash('User Create', 'SUCCESS', 'User create successfully');\n } else {\n createSessionFlash('User Create', 'FAIL', 'Error in User create');\n }\n return redirect('admin/users');\n }", "public function store(UserStoreRequest $request)\n {\n $user = $this->userRepository->store($request->all());\n return redirect('user')->withOk(\"The user \".$user->name.\" is registered\");\n }", "public function store(StoreRequest $request, User $user)\n {\n $user = $user->store($request);\n return redirect()->route('backoffice.user.show', $user);\n }", "public function store(StoreUserRequest $request)\n {\n $password = Str::upper(Str::random(6));\n\n $user = User::create([\n 'email' => ($request->validated()['email']),\n 'title' => ($request->validated()['title']),\n 'firstname' => ucwords($request->validated()['firstname']),\n \n 'middlename' => ucwords($request->validated()['middlename']),\n 'lastname' => ucwords($request->validated()['lastname']),\n 'nickname' => ucwords($request->validated()['nickname']),\n\n 'certificate_name' => ucwords($request->validated()['certificate_name']),\n 'contactno' => ($request->validated()['contactno']),\n 'address' => ucwords($request->validated()['address']),\n\n 'occupation' => ucwords($request->validated()['occupation']),\n 'sex' => $request->validated()['sex'],\n 'birthday' => ($request->validated()['birthday']),\n\n 'department_id' => ($request->validated()['department']),\n 'course_id' => ($request->validated()['course']),\n 'section_id' => ($request->validated()['section']),\n 'year' => ($request->validated()['year']),\n\n 'institution' => ucwords($request->validated()['institution']),\n 'username' => $request->validated()['username'],\n 'temppassword' => $password,\n 'password' => Hash::make($password),\n 'role' => $request->validated()['role'],\n ]);\n \n if($user){\n $name = $user->firstname.\" \".$user->lastname;\n\n session()->flash('success', $name.':Created Successfully');\n\n return response()->json([\n 'success' => true,\n 'message' => $name.': Created Successfully'\n ]);\n }\n\n }", "public function store(UserCreateRequest $request)\n {\n $data = $request->toArray();\n $data['password'] = Hash::make($data['password']);\n User::create($data);\n\n return redirect()->route('users.index')->with('success', 'User successfully added!');\n }", "public function store(UserRequest $request)\n {\n User::query()->create($request->validated());\n return redirect(route('users.index'));\n }", "public function store(StoreUser $request)\n {\n $response = $this->userService::store($request->username,$request->url,$request->email,$request->password,$request->role);\n\n return json_encode($response);\n }", "public function store(UserStoreRequest $request)\n {\n return $this->userService->store($request->all());\n }", "public function store(UserCreateRequest $request): UserResource\n {\n /* Convert request to array */\n $data = $request->all();\n\n /* Hashing password */\n $data['password'] = bcrypt($request->input('password'));\n\n /* Store data to database */\n $user = User::create($data);\n\n /* Send Register email to the user */\n event(new Registered($user));\n\n activity(\"Admin\")\n ->on($user)\n ->withProperties([\n ['IP' => $request->ip()],\n ['user_data' => $request->all()],\n ])\n ->log('Store a user');\n\n return new UserResource($user->loadMissing('plans'));\n }", "public function store(StoreUser $request)\n {\n $input = $request->all();\n $input['password'] = Hash::make($input['password']);\n\n $user = User::create($input);\n $user->roles()->attach($this->roleRepository->findOrFail($request->input('roles')));\n\n return redirect()->back()->with('status', 'Thêm User Thành Công');\n }", "public function store(UserRequest $request)\n {\n $user = $this->dispatch(new RegisterUserCommand(\n $user_firstname = $request->input('user_firstname'),\n $user_lastname = $request->input('user_lastname'),\n $email = $request->input('email'),\n $user_phone = $request->input('user_phone'),\n $password = $request->input('password')\n ));\n// Flash::success('You have registred! Your login credentials will be sent to your mobile phone number');\n return redirect('login');\n }", "public function store_user_data() {\n\n\t\t$user = User::where('mobile_number', session('phone_number'))->where('type', 0)->get();\n\n\t\tif (count($user)) {\n\t\t\tflash_message('danger', trans('messages.driver.this_number_already_have_account_please_login'));\n\t\t\treturn redirect()->route('login');\n\t\t} else {\n\t\t\t$user = new User;\n\t\t\t$user->mobile_number = session('phone_number');\n\t\t\t$user->name = session('user_name');\n\t\t\t$user->type = 0;\n\t\t\t$user->password = bcrypt(session('password'));\n\t\t\t$user->country_code = session('country_code');\n\t\t\t$user->email = session('email_address');\n\t\t\t$user->status = \"1\";\n\t\t\t$user->save();\n\n\t\t\tif (Auth::guard()->attempt(['mobile_number' => session('phone_number'), 'password' => session('password')])) {\n\t\t\t\t$intended_url = session('url.intended');\n\t\t\t\tif ($intended_url) {\n\t\t\t\t\t//create new order use session values\n\t\t\t\t\tadd_order_data();\n\t\t\t\t\treturn redirect()->route($intended_url); // Redirect to intended url page\n\t\t\t\t} else {\n\t\t\t\t\treturn redirect()->route('search'); // Redirect to search page\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\treturn redirect()->route('login'); // Redirect to login page\n\t\t\t}\n\t\t}\n\t}", "public function store(FormUserCreateRequest $request)\n {\n $user = new User();\n $user->name = $request->name;\n $user->surname = $request->surname;\n $user->email = $request->email;\n $user->role = $request->role;\n $user->department_id = $request->department;\n $user->active = $request->active;\n $user->password = Hash::make($request->password);\n $saved = $user->save();\n if($saved)\n return response()->json(['success' => true, 'message' => 'Usuario registrado exitosamente.'], 200);\n }" ]
[ "0.80134046", "0.77105695", "0.7323218", "0.72966486", "0.7271085", "0.72659063", "0.7225781", "0.7073488", "0.7047331", "0.70044523", "0.7000046", "0.6949038", "0.69157743", "0.6902856", "0.6882533", "0.68072134", "0.67898613", "0.6778791", "0.6774272", "0.67622215", "0.6761506", "0.67517966", "0.6751588", "0.6732255", "0.6731558", "0.6724507", "0.6715596", "0.6715526", "0.6714247", "0.67090005", "0.67085", "0.6701751", "0.6700525", "0.6677836", "0.66737014", "0.6669347", "0.66635156", "0.6656454", "0.6655001", "0.6654226", "0.664269", "0.6640462", "0.6640299", "0.663587", "0.66336894", "0.6627334", "0.6621429", "0.661964", "0.6603752", "0.65926266", "0.6581523", "0.6572393", "0.65714777", "0.6561508", "0.65576273", "0.65575486", "0.6557194", "0.65561134", "0.6553687", "0.65527105", "0.65385115", "0.6532994", "0.6530331", "0.6529268", "0.6523909", "0.65173477", "0.6514313", "0.6508506", "0.6507348", "0.65060043", "0.6503455", "0.65032643", "0.6497642", "0.64931685", "0.6487273", "0.6483536", "0.6482962", "0.64819753", "0.6479952", "0.6474904", "0.646829", "0.64655256", "0.6459339", "0.64550394", "0.64547944", "0.6448232", "0.6443321", "0.6442767", "0.6437432", "0.6425082", "0.64234024", "0.64227706", "0.64191717", "0.6418286", "0.64162207", "0.64078295", "0.6404056", "0.6401173", "0.6400523", "0.6399149", "0.63985157" ]
0.0
-1
Send verification reminder email from admin
public function verificationRemind($crypt_id) { $user_id = Crypt::decrypt($crypt_id); if (!$this->userService->verificationRemind($user_id)) { return Redirect::back()->withErrors($this->userService->errors())->withInput(); } Alert::success('User verification email sent.')->flash(); return Redirect::route('dashboard.users.edit', $crypt_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendEmailVerificationNotification();", "public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('admin'));\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new AdminEmailVerificationNotification);\n }", "public function sendEmailVerificationNotification()\n { \n \n $this->notify(new ConfirmEmail); \n \n }", "public function sendEmailVerificationNotification(){\n $this->notify(new VerifyEmail);\n }", "public function sendVerificationMail()\n {\n\n $this->notify(new VerifyEmail($this));\n\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify( new VerifyEmail() ); # 새로 만든 VerifyEmail Notification 발송\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail); // my notification\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify( new VerifyEmailNotification );\n }", "function emailRegistrationAdmin() {\n require_once ('com/tcshl/mail/Mail.php');\n $ManageRegLink = DOMAIN_NAME . '/manageregistrations.php';\n $emailBody = $this->get_fName() . ' ' . $this->get_lName() . ' has just registered for TCSHL league membership. Click on the following link to approve registration: ';\n $emailBody.= $ManageRegLink;\n //$sender,$recipients,$subject,$body\n $Mail = new Mail(REG_EMAIL, REG_EMAIL, REG_EMAIL_SUBJECT, $emailBody);\n $Mail->sendMail();\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmailNotification);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmailNotification);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('networking_agent'));\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new CustomVerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail());\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail());\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail());\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new AffiliateVerifyEmail);\n }", "public static function sendActivationReminders(){\n self::$UserService->sendEmailActivationReminders();\n }", "public function sendEmailVerificationNotification(): void\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n if (request()->is('api/*')) {\n $this->notify(new VerifyEmailNotification);\n } else {\n parent::sendEmailVerificationNotification();\n }\n }", "public function sendEmailVerificationNotification()\n {\n if (!allowSendEmail()) {\n $this->markEmailAsVerified();\n return;\n }\n\n $this->notify(new VerifyEmailNotification);\n }", "public function sendVerificationEmail()\n {\n $user = Auth::user();\n\n event(new UserResendVerification($user));\n\n return redirect('/');\n }", "public function confirmationEmail()\n {\n $email = new Email;\n $email->sendEmail('submitted', 'applicant', Auth::user()->email);\n }", "public function requestVerificationEmail()\n {\n if (!$this->request->is('post')) {\n $this->_respondWithMethodNotAllowed();\n return;\n }\n\n $user = $this->Guardian->user();\n if (!$user->verified) {\n $this->Users->Tokens->expireTokens($user->id, TokensTable::TYPE_VERIFY_EMAIL);\n $token = $this->Users->Tokens->create($user, TokensTable::TYPE_VERIFY_EMAIL, 'P2D');\n try {\n $this->getMailer('User')->send('verify', [$user, $token->token]);\n $this->set('message', __('Please check your inbox.'));\n } catch (\\Exception $e) {\n $this->_respondWithBadRequest();\n $this->set('message', 'Mailer not configured.');\n }\n } else {\n $this->set('message', __('Your email address is already verified.'));\n }\n\n $this->set('_serialize', ['message']);\n }", "public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Confirm your account on JustRegMe\";\n\t\t$bodyPath = ROOT . '/template/email/confirmation.php';\n\t\t$body = include($bodyPath); //loads HTML-body from template\n\t\t\n\t\techo User::sendEmail($userId, $subject, $body);\n\n\t}", "public function sendEmailVerification(EmailVerifications $ev) {\n\n Mail::send('email.verification', ['ev' => $ev], function ($message) use ($ev) {\n $message->from(\"[email protected]\");\n $message->to($ev->email)->subject(\"Brukerregistrering - Austegardstoppen\");\n });\n\n }", "public function resendEmail()\n {\n $query = users::where('email', session('notice'))->first();\n // Sending Welcome Email\n Mail::to(session('notice')['email'])->send(new welcome($query->token));\n return view('auth.emailVerification');\n }", "public function testVerification()\n {\n Notification::fake();\n\n $this->user->email_verified_at = null;\n\n $this->user->save();\n\n $this->user->notify(new VerifyEmail);\n\n // $request = $this->post('/email/resend');\n //\n // $request->assertSuccessful();\n\n Notification::assertTimesSent(1, VerifyEmail::class);\n\n Notification::assertSentTo($this->user,VerifyEmail::class);\n }", "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "public function sendRestoreEmail();", "public function send_confirm_mail($userDetails = '') {\n //Send email to user\n }", "function emailconfirmation(){\n\t\t\trequire( dirname(__FILE__) . '/email-confirmation.php' );\n\t\t}", "protected function email(Request $request) {\n $verificationToken = $request->route('email_token');\n $userCount = DB::table('users')->where([['verification_token', $verificationToken], ['verified', 'false']])->count();\n if($userCount > 0) {\n\n /* Querying the user table by passing Email verification token */\n $user = DB::table('users')->where([['verification_token', $verificationToken], ['verified', 'false']])->first();\n\n /* Updating Status of Verification */\n DB::table('users')->where('verification_token', $verificationToken)->update(['verified'=> true]);\n\n /**\n * Sending welcome email to the user\n * @author Tittu Varghese ([email protected])\n *\n * @param array | $user\n */\n\n $emailVariables_UserName = $user->first_name;\n $emailVariables_SubTitle = \"Welcome to Bytacoin!\";\n $emailVariables_MainTitle = \"Get Started with Bytacoin\";\n $emailVariables_EmailText = \"Thank you for completing registration with us. We are happy to serve for you and click below button to login to your dashboard and checkout our awesome offerings.\";\n $emailVariables_ButtonLink = \"https://bytacoin.telrpay.com/\";\n $emailVariables_ButtonText = \"GET STARTED\";\n\n $emailTemplate = new EmailTemplates($emailVariables_UserName,$emailVariables_SubTitle,$emailVariables_MainTitle,$emailVariables_EmailText,$emailVariables_ButtonLink,$emailVariables_ButtonText);\n\n $emailContent = $emailTemplate->GenerateEmailTemplate();\n $mail = new Email(true,$emailContent);\n $mail->addAddress($user->email,$user->first_name);\n $mail->Subject = 'Welcome to Bytacoin!';\n $mail->send();\n\n return redirect('login')->with('success', 'Your account has been activated. Please login to access dashboard.');\n\n } else {\n\n return redirect('login')->with('error', 'Looks like the verification link is expired or not valid.');\n\n }\n }", "function notify() {\n if ($this->active_invoice->isLoaded()) {\n if ($this->active_invoice->canResendEmail($this->logged_user)) {\n $company = $this->active_invoice->getCompany();\n if(!($company instanceof Company)) {\n $this->response->operationFailed();\n } // if\n \n $issue_data = $this->request->post('issue', array(\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_to_id' => $this->active_invoice->getIssuedToId()\n ));\n \n $this->response->assign('issue_data', $issue_data);\n \n if ($this->request->isSubmitted()) {\n try {\n if($this->active_invoice->isIssued()) {\n $this->active_invoice->setDueOn($issue_data['due_on']);\n } // if\n \n $resend_to = isset($issue_data['user_id']) && $issue_data['user_id'] ? Users::findById($issue_data['user_id']) : null;\n \n if($issue_data['send_emails'] && $resend_to instanceof IUser) {\n $this->active_invoice->setIssuedTo($resend_to);\n \n $recipients = array($resend_to);\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_reminder', $this->active_invoice)\n ->sendToUsers($recipients, true);\n } // if\n \n $this->active_invoice->save();\n \n $this->response->respondWithData($this->active_invoice, array(\n 'detailed' => true, \n \t'as' => 'invoice'\n ));\n \t} catch (Exception $e) {\n \t DB::rollback('Failed to resend email @ ' . __CLASS__);\n \t $this->response->exception($e);\n \t} // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function resendConfirmationMailAction()\n {\n // @todo find a better way to fetch the data\n $result = GeneralUtility::_GP('tx_femanager_pi1');\n if (is_array($result)) {\n if (GeneralUtility::validEmail($result['user']['email'])) {\n $user = $this->userRepository->findFirstByEmail($result['user']['email']);\n if (is_a($user, User::class)) {\n $this->sendCreateUserConfirmationMail($user);\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailSend'),\n '',\n AbstractMessage::INFO\n );\n $this->redirect('resendConfirmationDialogue');\n }\n }\n }\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailFail'),\n LocalizationUtility::translate('validationError'),\n AbstractMessage::ERROR\n );\n $this->redirect('resendConfirmationDialogue');\n }", "public function trainingVideoReminderMail() \n {\n $data = $this->BusinessOwner->find('all',array(\n 'conditions'=>array('BusinessOwner.group_role' => array('leader', 'co-leader'),'BusinessOwner.is_unlocked'=> 0),\n 'fields' => array('BusinessOwner.email','BusinessOwner.fname','BusinessOwner.lname','BusinessOwner.group_role')\n ));\n if(!empty($data)) {\n foreach($data as $row) { \n $emailLib = new Email();\n $subject = \"FoxHopr: Watch Training Video\";\n $template = \"training_video_reminder\";\n $format = \"both\";\n $to=$row['BusinessOwner']['email'];\n $emailLib->sendEmail($to,$subject,array('username'=>$row['BusinessOwner']['fname'].' '.$row['BusinessOwner']['lname']),$template,$format);\n }\n }\n }", "public function sendPhoneVerificationNotification();", "function new_user_email_admin_notice()\n {\n }", "public function markEmailAsVerified();", "public static function send_admin_expiring_notice() {\n\t\tself::maybe_init();\n\n\t\t$email_key = WP_Job_Manager_Email_Admin_Expiring_Job::get_key();\n\t\tif ( ! self::is_email_notification_enabled( $email_key ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$settings = self::get_email_settings( $email_key );\n\t\t$days_notice = WP_Job_Manager_Email_Admin_Expiring_Job::get_notice_period( $settings );\n\t\tself::send_expiring_notice( $email_key, $days_notice );\n\t}", "public function notifyRSVPRegistered( $data )\n {\n $subject = \"Event Manager - RSVP Registered\";\n\n $msg = '\n <img src=\"http://' . $_SERVER['HTTP_HOST'] . '/images/event.png\" width=\"200\" height=\"200\" alt=\"Event Manager Banner\"/>\n\n <br><br>\n Hello ' . $data['Eid'] . ',\n\n <br><br>\n We have received your RSVP on ' . date(\"m/d/Y\") . ' through the event management platform.\n\n <br><br>\n\n <hr>\n\n <br>\n\n <table>\n <tr>\n <td colspan=\"2\">\n Reservation Information\n </td>\n </tr>\n <tr>\n <td colspan=\"2\">\n ---------------------------------------------------------\n </td>\n </tr>\n <tr>\n <td width=\"50%\">\n Your EID:\n </td>\n <td width=\"50%\">' .\n $data['Eid'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Name:\n </td>\n <td>' .\n $data['Name'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Date:\n </td>\n <td>' .\n $data['Date'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Location:\n </td>\n <td>' .\n $data['Location'] . '\n </td>\n </tr>\n </table>\n\n <br><br>\n\n An iCal has been attached for your convenience, please use it to add a reminder to your calendar.\n\n <br><br>\n\n Thank you,\n <br>\n Event Manager<br><br>';\n\n return $this->sendEmail( array( \"subject\"=>$subject, \"msg\"=>$msg, \"email\"=>$data['Email'], \"name\"=>$data['Eid'], \"iCal\"=>$data['iCal'] ) );\n }", "private function sendNotifyEmail(){\n $uS = Session::getInstance();\n $to = filter_var(trim($uS->referralFormEmail), FILTER_SANITIZE_EMAIL);\n\n try{\n if ($to !== FALSE && $to != '') {\n// $userData = $this->getUserData();\n $content = \"Hello,<br>\" . PHP_EOL . \"A new \" . $this->formTemplate->getTitle() . \" was submitted to \" . $uS->siteName . \". <br><br><a href='\" . $uS->resourceURL . \"house/register.php' target='_blank'>Click here to log into HHK and take action.</a><br>\" . PHP_EOL;\n\n $mail = prepareEmail();\n\n $mail->From = ($uS->NoReplyAddr ? $uS->NoReplyAddr : \"[email protected]\");\n $mail->FromName = htmlspecialchars_decode($uS->siteName, ENT_QUOTES);\n $mail->addAddress($to);\n\n $mail->isHTML(true);\n\n $mail->Subject = \"New \" . Labels::getString(\"Register\", \"onlineReferralTitle\", \"Referral\") . \" submitted\";\n $mail->msgHTML($content);\n\n if ($mail->send() === FALSE) {\n return false;\n }else{\n return true;\n }\n }\n }catch(\\Exception $e){\n return false;\n }\n return false;\n }", "private function sendConfirmationMail() {\n\t\t\t\t$subject = 'Confirmation Mail';\n\t\t\t\t$from = '[email protected]';\n\t\t\t\t$replyTo = '[email protected]';\n\t\t\t\t\n\t\t\t\t//include some fancy stuff here, token is md5 of email\n\t\t\t\t$message = \"<a href='http://www.momeen.com/eCommerce/register/confirmUser.php?token=$this->token'> Confirm</a>\";\n\n\t\t\t\t$headers = \"From: \".\"$from\".\"\\r\\n\";\n\t\t\t\t$headers .= \"Reply-To: \".\"$replyTo\".\"\\r\\n\";\n\t\t\t\t$headers .= \"MIME-Version:1.0\\r\\n\";\n\t\t\t\t$headers .= \"Content-Type:text/html; charset=ISO-8859-1\\r\\n\";\n\t\t\t\tif(!mail($this->email, $subject, $message, $headers)) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Confirmation mail did not sent. Contact admin';\n\t\t\t\t}\n\t\t\t}", "public function sendEmail()\n {\n $user = User::findOne([\n 'store_id' => Yii::$app->storeSystem->getId(),\n 'email' => $this->email,\n 'status' => User::STATUS_INACTIVE\n ]);\n\n if ($user === null) {\n return false;\n }\n\n $content = CommonHelper::render(Yii::getAlias('@common/mail/emailVerify-html.php'), [\n 'user' => $user,\n ], $this, Yii::getAlias('@common/mail/layouts/html.php'));\n\n Yii::$app->mailSystem->send($this->email, Yii::t('app', 'Resend verification email'), $content);\n return true;\n }", "public function resendActivationEmail()\n {\n $breadCrumb = $this->userEngine\n ->breadcrumbGenerate('resend-activation-email');\n\n return $this->loadPublicView('user.resend-activation-email', $breadCrumb['data']);\n }", "public function sendRegistrationEmail()\n {\n $loginToken=$this->extractTokenFromCache('login');\n\n $url = url('register/token',$loginToken);\n Mail::to($this)->queue(new RegistrationConfirmationEmail($url));\n }", "private function sendSubmissionConfirmationEmail() {\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/ResearcherNotification.php');\r\n\r\n $subject = sprintf('[TID-%s] Tracking form submitted successfully', $this->trackingFormId);\r\n $emailBody = sprintf('Your tracking form was submitted successfully. It has been assigned a Tracking ID of %s.\r\n\r\nApprovals may still be required from your Dean, Ethics, and the Office of Research Services depending on the details provided. To see details of these approvals, you can login to the MRU research website and go to My Tracking Forms.\r\n\r\nIf you have any question, then please contact MRU\\'s Grants Facilitator, Jerri-Lynne Cameron at 403-440-5081 or [email protected].\r\n\r\nRegards,\r\nOffice of Research Services\r\n\r\n', $this->trackingFormId);\r\n\r\n $confirmationEmail = new ResearcherNotification($subject, $emailBody, $this->submitter);\r\n try {\r\n $confirmationEmail->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send confirmation notification to researcher : '. $e);\r\n }\r\n }", "public function confirmEmail()\n {\n $this->mail_confirmed = Carbon::now();\n $this->mail_token = null;\n $this->save();\n }", "public function Action_Reminder()\n {\n $this->Chunk_Init();\n\n if ( $_REQUEST['Users']['Keystring'] != Zero_App::$Users->Keystring )\n {\n $this->SetMessage(-1, ['Контрольная строка не верна']);\n $this->Chunk_View();\n return $this->View;\n }\n\n $this->Model->Load_Email($_REQUEST['Users']['Email']);\n if ( 0 == $this->Model->ID )\n {\n $this->SetMessage(-1, ['Пользователь не найден']);\n $this->Chunk_View();\n return $this->View;\n }\n\n $password = substr(md5(uniqid(mt_rand())), 0, 10);\n $this->Model->Password = md5($password);\n $this->Model->Save();\n\n $subject = \"Reminder access details \" . HTTP;\n $View = new Zero_View('Zero_Users_ReminderMail');\n $View->Assign('Users', $this->Model);\n $View->Assign('password', $password);\n $message = $View->Fetch();\n\n $email = [\n 'Reply' => ['Name' => Zero_App::$Config->Site_Name, 'Email' => Zero_App::$Config->Site_Email],\n 'From' => ['Name' => Zero_App::$Config->Site_Name, 'Email' => Zero_App::$Config->Site_Email],\n 'To' => [\n $this->Model->Email => $this->Model->Name,\n ],\n 'Subject' => \"Reminder access details \" . HTTP,\n 'Message' => $message,\n 'Attach' => [],\n ];\n $cnt = Helper_Mail::SendMessage($email);\n if ( 0 < $cnt )\n $this->SetMessageError(-1, [\"Реквизиты не отправлены на почту\"]);\n else\n $this->SetMessage(0, [\"Реквизиты отправлены на почту\"]);\n $this->Chunk_View();\n return $this->View;\n }", "function sendUpdateEmail($email, $registrant)\n{\n $name = $_SESSION['ctst_name'];\n $subject = $name . \" registration information updated.\";\n $mailContent = $registrant['givenName'] . ' ' . $registrant['familyName'];\n $mailContent .= \":\\n\\n\";\n $mailContent .= \"Your information for the \" . $name . \" has been updated.\\n\";\n $mailContent .= \"\\nIf you did not edit your registration information, \" .\n \"please write to the administrator:\\n\";\n $mailContent .= \"mailto:\" . ADMIN_EMAIL . \"?subject=account%20compromised\\n\";\n $mailContent .= \"\\nright away, or simply reply to this note.\\n\";\n $mailContent .= automatedMessage($name);\n $headers = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n do_email($email, $subject, $mailContent, $headers);\n}", "public function send_expiry_notification() {\n $expired_posts = $this->get_expired_posts();\n\n $subject = 'Posts that need your attention';\n $recipient = \\get_bloginfo('admin_email');\n $content = $this->_generate_expiry_notification_content( $expired_posts );\n\n // Set post to draft\n // bb_log( $content, 'Sending an email to ' . $recipient );\n // Helper\\Email::send_email( $recipient, $subject, $content );\n }", "function paid_sendEmail_admin($details) {\n\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\t$additionaNotes = $details->additionaNotes;\t\t\t\t\n\t\t\t\t$sendto = $this->adminemail;\n\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingpaidadmin\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidadmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name,$additionaNotes);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingpaidadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function emailBasedAction()\n {\n $signoffEmail = $this->em->getRepository('Fisdap\\Entity\\SignoffEmail')->findOneBy(array('email_key' => $this->_getParam('key')));\n \n // Determine what the message should be...\n // We have 4 or so states.\n // State 1 - No signoffEmail was found.\n if ($signoffEmail == null) {\n $message = \"I'm sorry, we could not find a matching shift for the provided code. Please contact customer support.\";\n // State 2 - Email has expired\n } elseif ($signoffEmail->expire_time != null && $signoffEmail->expire_time->format('U') <= time()) {\n $message = \"I'm sorry, the deadline to fill out the form for this shift has passed.\";\n // State 3 - Shift has already been signed off on\n } elseif ($signoffEmail->has_signed_off) {\n $message = \"We're sorry. It looks like someone already signed off on this shift on \" . $signoffEmail->signoff_time->format('F jS, Y \\a\\t Hi') . \".\";\n } else {\n $signoffEmail->has_signed_off = true;\n $signoffEmail->signoff_time = new \\DateTime();\n $signoffEmail->save();\n \n $message = \"Thank you, you have successfully signed off on this shift.\";\n }\n \n $this->view->message = $message;\n }", "public function notifyPasswordUpdate($data){\r\n\t$this->sendTemplateEmail($data['email'], $this->app_config['password_reset_notification_subject'], $this->app_config['password_reset_notification_body'], $data);\r\n}", "private function sendDailyAdminEmail()\n {\n // Message\n $message = (new AdministratorDaily())->onQueue('platform-processing');\n // User Setting\n $settingProvider = (new PlatformSettingProvider());\n Mail::to($settingProvider->setting('admin_notification_email'),$settingProvider->setting('admin_notification_name'))\n ->send($message);\n Log::info(\"Sent Admin Email\");\n }", "public function sendResetPasswordEmail()\n {\n $passwordReset = $this->generateResetPasswordToken();\n\n SendEmailJob::dispatch($this, 'forgot-password', 'Reset Your Password', ['props' => $passwordReset])->onQueue('account-notifications');\n }", "function confirm_email() {\n \n\n $confirm_url = $this->traffic_model->GetAbsoluteURLFolder().'/confirm_register/' . $this->traffic_model->MakeConfirmationMd5();\n \n\n $this->email->from('[email protected]');\n\n $this->email->to($this->input->post('email'));\n $this->email->set_mailtype(\"html\");\n $this->email->subject('Confirm registration');\n $message = \"Hello \" . $this->input->post('username'). \"<br/>\" .\n \"Thanks for your registration with www.satrafficupdates.co.za <br/>\" .\n \"Please click the link below to confirm your registration.<br/>\" .\n \"$confirm_url<br/>\" .\n \"<br/>\" .\n \"Regards,<br/>\" .\n \"Webmaster <br/>\n www.satrafficupdates.co.za\n \";\n $this->email->message($message);\n if ($this->email->send()) {\n echo 'Message was sent';\n //return TRUE;\n } else {\n echo $this->email->print_debugger();\n //return FALSE;\n }\n\n\n\n\n }", "public function Email_verification($user_master_id)\n\t{\n\t\t$sql = \"SELECT * FROM login_users WHERE id ='\".$user_master_id.\"' AND user_type = '5' AND status='Active'\";\n\t\t$user_result = $this->db->query($sql);\n\t\t$ress = $user_result->result();\n\n\t\tif($user_result->num_rows()>0)\n\t\t{\n\t\t\tforeach ($user_result->result() as $rows)\n\t\t\t{\n\t\t\t\t $email_id = $rows->email;\n\t\t\t}\n\t\t}\n\t\t$enc_user_master_id = base64_encode($user_master_id);\n\n\t\t$subject = \"TNULM - Verification Email\";\n\t\t$email_message = 'Please Click the Verification link. <a href=\"'. base_url().'home/email_verfication/'.$enc_user_master_id.'\" target=\"_blank\" style=\"background-color: #478ECC; font-size:15px; font-weight: bold; padding: 10px; text-decoration: none; color: #fff; border-radius: 5px;\">Verify Your Email</a><br><br><br>';\n\t\t$this->sendMail($email_id,$subject,$email_message);\n\n\n\t\t$response = array(\"status\" => \"success\", \"msg\" => \"Email Verification Sent\");\n\t\treturn $response;\n\t}", "public static function sendEmailReminder()\n {\n /*'text'->Notification.notification_message\n subject-> notification_subject \n\n sender can be from .env or email of currently logged user ....\n to... list from vic, vol, emp\n */\n /*Mail::raw(Input::get('notification_message'), function($message) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to('[email protected]', 'Chanda')->subject(Input::get('notification_subject'));\n });\n */\n\n $activities= Input::get('activity_id');\n //if volunteer = 'Y'\n if (Input::get('to_all_volunteers')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('volunteer_id'); \n $volunteers = Volunteer::where('id', $activitydetails)->get(); \n foreach ($volunteers as $volunteer) {\n Mail::raw(Input::get('notification_message'), function($message) use ($volunteer) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($volunteer->email, $volunteer->last_name.\", \".$volunteer->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n\n //if victim = 'Y'\n if (Input::get('to_all_victims')=='Y') {\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('victim_id'); \n $victims = Victim::where('id', $activitydetails)->get(); \n foreach ($victims as $victim) {\n Mail::raw(Input::get('notification_message'), function($message) use ($victim) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($victim->email, $victim->last_name.\", \".$victim->first_name)->subject(Input::get('notification_subject'));\n });\n }\n }\n\n //if employee = 'Y'\n if (Input::get('to_all_employees')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('employee_id'); \n $employees = Employee::where('id', $activitydetails)->get(); \n foreach ($employees as $employee) {\n Mail::raw(Input::get('notification_message'), function($message) use ($employee) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($employee->email, $employee->last_name.\", \".$employee->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n }", "public function mail()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n import('SurveyMailer');\n\n $mailer = new SurveyMailer();\n $mailer->send();\n //$mailer->sendForParticipant(with(new SurveyMatcher())->getParticipantById(1));\n }", "public function sendActivationEmail(){\n\t\t// generate the url\n\t\t$url = 'http://'.$_SERVER['HTTP_HOST'].'/signup/activate/'.$this->activation_token;\n\t\t$text = View::getTemplate('Signup/activation_email.txt', ['url' => $url]);\n\t\t$html = View::getTemplate('Signup/activation_email.html', ['url' => $url]);\n\t\t\n\t\tMail::send($this->email, 'Account_activation', $text, $html);\n\t}", "public function sendWelcomeEmail()\n {\n SendEmailJob::dispatch($this, 'confirm-email', 'Confirm Your Email', [])->onQueue('account-notifications');\n }", "public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }", "function send_verification_email($user_email, $verification_code)\n{\n\n $to = $user_email;\n $subject = 'Verification Email';\n\n $message = '\n Thanks for subscribing!\n Your veirfication code is:\n ' . $verification_code;\n\n return mail($to, $subject, $message);\n}", "public function actionNotifyToJoin(){\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->subject = \"We are happy to see you soon on Cofinder\"; // 11.6. title change\n $message->from = Yii::app()->params['noreplyEmail'];\n \n // send newsletter to all in waiting list\n $invites = Invite::model()->findAll(\"NOT ISNULL(`key`)\");\n $c = 0;\n foreach ($invites as $user){\n \n $create_at = strtotime($user->time_invited);\n if ($create_at < strtotime('-8 week') || $create_at >= strtotime('-1 day')) continue; \n if (!\n (($create_at >= strtotime('-1 week')) || \n (($create_at >= strtotime('-4 week')) && ($create_at < strtotime('-3 week'))) || \n (($create_at >= strtotime('-8 week')) && ($create_at < strtotime('-7 week'))) )\n ) continue; \n \n //set mail tracking\n $mailTracking = mailTrackingCode($user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'invitation-reminder';\n $ml->user_to_id = $user->id;\n $ml->save();\n \n //$activation_url = '<a href=\"'.absoluteURL().\"/user/registration?id=\".$user->key.'\">Register here</a>';\n $activation_url = mailButton(\"Register here\", absoluteURL().\"/user/registration?id=\".$user->key,'success',$mailTracking,'register-button');\n $content = \"This is just a friendly reminder to activate your account on Cofinder.\n <br /><br />\n Cofinder is a web platform through which you can share your ideas with the like minded entrepreneurs, search for people to join your project or join an interesting project yourself.\n <br /><br />If we got your attention you can \".$activation_url.\"!\";\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$user->email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($user->email);\n Yii::app()->mail->send($message);\n $c++;\n }\n Slack::message(\"CRON >> Invite to join reminders: \".$c);\n return 0;\n }", "public function call_job_expiration_date()\n {\n $Email->from(array('[email protected]' => 'Harvest'));\n $Email->to('[email protected]');\n $Email->subject('Teste');\n $Email->send('Teste');\n $this->render('/pages/index');\n\n }", "public function trigger_email_verification($userid) {\n\t\t$adminModel = $this->loadModel('admin');\n\t\t$adminModel->verifyUserEmail($userid);\n\t\theader('location: '.URL.'admin/users');\n\t}", "public function indexAction() {\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitecrowdfunding_admin_main', array(), 'sitecrowdfunding_admin_main_reminder_mails');\n $site_title = $_SERVER['HTTP_HOST'];\n $this->view->form = $form = new Sitecrowdfunding_Form_Admin_Email();\n\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n $values = $form->getValues();\n\n if ($values['sitecrowdfunding_reminder_demo'] != 1)\n $values['sitecrowdfunding_admin_mail'] = '';\n\n include APPLICATION_PATH . '/application/modules/Sitecrowdfunding/controllers/license/license2.php';\n if (empty($tempMailsend)) {\n return;\n }\n foreach ($values as $key => $value) {\n if (Engine_Api::_()->getApi('settings', 'core')->hasSetting($key)) {\n Engine_Api::_()->getApi('settings', 'core')->removeSetting($key);\n }\n if (is_null($value)) {\n $value = \"\";\n }\n Engine_Api::_()->getApi('settings', 'core')->setSetting($key, $value);\n }\n $form->addNotice($this->view->translate('Your changes have been saved successfully.'));\n\n if ($values['sitecrowdfunding_reminder_demo'] == 1 && !empty($values['sitecrowdfunding_admin_mail'])) {\n $mailId = $values['sitecrowdfunding_admin_mail'];\n $user = Engine_Api::_()->getItemTable('user')->fetchRow(array(\n 'email = ?' => $mailId\n ));\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($user, \"SITECROWDFUNDING_REMINDER_TEST\", array(\n 'member_name' => $user->getTitle()\n ));\n $form->addNotice('Test email has been sent to the email id provided by you.');\n }\n }", "private static function send_reminder_digest( $domains ) {\n $reminder_recipient = self::get_reminder_recipient();\n $tdata = array(\n 'site_name' => get_bloginfo( 'name' ),\n 'domains' => $domains\n );\n $admin_email = get_bloginfo( 'admin_email' );\n $addl_headers = array(\n 'Reply-To' => $admin_email,\n 'From' => sprintf( __( 'Stashbox - %s <%s>', 'th' ), $tdata['site_name'], $admin_email )\n );\n $message = Template::make( 'domain/email-expiration_reminder', $tdata, false );\n add_filter( 'wp_mail_content_type', array( __CLASS__, 'send_html_mail' ) );\n $sent = wp_mail( $reminder_recipient, __( 'Stashbox Expiring Domain Reminder', 'th' ), $message, $addl_headers );\n if( !$sent ) {\n remove_filter( 'wp_mail_content_type', array( __CLASS__, 'send_html_mail' ) );\n error_log( 'Failed to send message. Result: '.serialize( $sent ) );\n return false;\n } else {\n remove_filter( 'wp_mail_content_type', array( __CLASS__, 'send_html_mail' ) );\n return true;\n }\n }", "public function getReminderEmail()\n {\n // TODO: Implement getReminderEmail() method.\n }", "public function email_approver()\n {\n \n $this->db->select('EMAIL');\n $this->db->from('APPROVERS');\n $this->db->where('UNIT',$_SESSION['div']);\n $query = $this->db->get();\n $out = $query->result_array();\n\n if ($out) {\n\n \n foreach ($out as $recipient){\n \n //mail to approver\n $this->load->library('email');\n $htmlContent = '<h1>Title change requested in FREE System.</h1>';\n $htmlContent .= '<p>Please review the <a href=\"' . base_url() . '/admin\">Approval Control Panel</a> to review the request.</p>';\n \n $this->email->clear();\n\n $config['mailtype'] = 'html';\n $this->email->initialize($config);\n $this->email->to($recipient);\n $this->email->from('[email protected]', 'FREE System');\n $this->email->subject('Title Change Requested');\n $this->email->message($htmlContent);\n $this->email->send();\n }\n }\n }", "function send_expired_email($member, $details)\n{\n $body = \"Dear %s,\n \nYour PLUG membership expired on %s.\n\nIf you wish to renew your PLUG membership, you have several options:\n\n\".PAYMENT_OPTIONS.\"\n \nMembership fees are \\$%s per year, or \\$%s per year for holders of a\ncurrent student or concession card.\n\nYou may choose not to renew your membership, in which case your PLUG\nshell account will expire 5 days after your membership lapsed. However,\nthe mailing list is still freely accessible to non-members.\n\nIf you have any queries, please do not hesitate to contact the PLUG\ncommittee via email at \".COMMITTEE_EMAIL.\".\n\nRegards,\n\nPLUG Membership Scripts\";\n\n $body = sprintf($body,\n $details['displayName'],\n $details['formattedexpiry'],\n FULL_AMOUNT / 100,\n CONCESSION_AMOUNT / 100\n );\n \n $subject = \"Your PLUG Membership has Expired\";\n \n if($member->send_user_email($body, $subject))\n {\n foreach($member->get_messages() as $message) echo \"$message\\n\";\n }else{\n foreach($member->get_errors() as $message) echo \"$message\\n\"; \n }\n}", "function notify_request_client($email) {\n\t$link = SITE_URL.'requests.php';\n\n\t$text = \"Hello,\\n\";\n\t$text .= \"\\nYou requested an appointment. You can manage your appointment below:\\n\";\n\t$text .= \"\\n<a href='$link'>Manage</a>\\n\";\n\t$text .= \"\\nThanks,\\n\";\n\t$text .= \"The Ma-Maria team\";\n\n\tif(MAIL_ENABLED) {\n\t\tmail($email, 'Ma-Maria - Request', $text);\n\t}\n}", "public static function email_password_renew() {\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n if ($u->emailPasswordRenew())\n flash('Email com as instruções para Renovação de senha enviado para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "public function sendReminder(){\n $sid = getenv('ACCOUNT_SID');\n $token = getenv('TWILIO_TOKEN');\n $sandbox_number=getenv('WHATSAPP_SANDBOX_NUMBER');\n $subscriber_number = \"your phone number\";\n $message = $this->todaysScripture(true);\n\n $twilio = new Client($sid, $token);\n $message = $twilio->messages\n ->create(\"whatsapp:\".$subscriber_number,\n array(\n \"from\" => \"whatsapp:\".$sandbox_number,\n \"body\" => $message\n )\n );\n }", "public function sendEmail()\n {\n $user = User::findOne([\n 'email' => $this->email,\n 'status' => User::STATUS_INACTIVE\n ]);\n\n if ($user === null) {\n return false;\n }\n\n $verifyLink = Yii::$app->urlManager->createAbsoluteUrl(['site/verify-email', 'token' => $user->verification_token]);\n\n // Получатель\n $sendTo = $this->email;\n\n // Формирование заголовка письма\n $subject = 'Подтверждение регистрации на ' . Yii::$app->name;\n\n // Формирование тела письма\n $msg = \"<html><body style='font-family:Arial,sans-serif;'>\";\n $msg .= \"<h2 style='font-weight:bold;border-bottom:1px dotted #ccc;'>\" . $subject . \"</h2>\\r\\n\";\n $msg .= \"<p>Приветствуем, \" . Html::encode($user->username) . \",</p>\\r\\n\";\n $msg .= \"<p>Перейдите по ссылке ниже, чтобы подтвердить свою электронную почту:</p>\\r\\n\";\n $msg .= \"<p>\" . Html::a(Html::encode($verifyLink), $verifyLink) . \"</p>\\r\\n\";\n $msg .= \"</body></html>\";\n\n // Отправитель\n $headers = \"From: \". Yii::$app->params['supportEmail'] . \"\\r\\n\";\n $headers .= \"MIME-Version: 1.0\\r\\n\";\n $headers .= \"Content-Type: text/html;charset=utf-8 \\r\\n\";\n\n // отправка сообщения\n if(@mail($sendTo, $subject, $msg, $headers)) {\n return true;\n } else {\n return false;\n }\n /*\n return Yii::$app\n ->mailer\n ->compose(\n ['html' => 'emailVerify-html', 'text' => 'emailVerify-text'],\n ['user' => $user]\n )\n ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name . ' robot'])\n ->setTo($this->email)\n ->setSubject('Подтверждение регистрации на ' . Yii::$app->name)\n ->send();\n */\n }", "public function getReminderEmail()\n {\n return $this->email;\n }", "public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}", "public function sendUserUpdateNotification(): void\n {\n $this->notify(new VerifyAccountNotification());\n }", "public function emailAction() {\n\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_email');\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_Email();\n\n //check if comments should be displayed or not\n $show_comments = Engine_Api::_()->sitestore()->displayCommentInsights();\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n $taskstable = Engine_Api::_()->getDbtable('tasks', 'core');\n $rtasksName = $taskstable->info('name');\n $taskstable_result = $taskstable->select()\n ->from($rtasksName, array('processes', 'timeout'))\n ->where('title = ?', 'Sitestore Insight Mail')\n ->where('plugin = ?', 'Sitestore_Plugin_Task_InsightNotification')\n ->limit(1);\n $prefields = $taskstable->fetchRow($taskstable_result);\n\n //populate form\n// $form->populate(array(\n// 'sitestore_insightemail' => $prefields->processes,\n// ));\n\n if ($this->getRequest()->isPost() && $form->isValid($this->_getAllParams())) {\n $values = $form->getValues();\n Engine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_insightemail', $values['sitestore_insightemail']);\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n if(empty($sitemailtemplates)) {\n\t\t\t\tEngine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_bg_color', $values['sitestore_bg_color']);\n }\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n if ($values['sitestore_demo'] == 1 && $values['sitestore_insightemail'] == 1) {\n\n $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null;\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n $site_title = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.site.title', Engine_Api::_()->getApi('settings', 'core')->getSetting('core.general.site.title', 1));\n\n $insights_string = '';\n\t\t\t\t$template_header = \"\";\n\t\t\t\t$template_footer = \"\";\n if(!$sitemailtemplates) {\n\t\t\t\t\t$site_title_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.title.color', \"#ffffff\");\n\t\t\t\t\t$site_header_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.header.color', \"#79b4d4\");\n\n\t\t\t\t\t//GET SITE \"Email Body Outer Background\" COLOR\n\t\t\t\t\t$site_bg_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.bg.color', \"#f7f7f7\");\n\t\t\t\t\t$insights_string.= \"<table cellpadding='2'><tr><td><table cellpadding='2'><tr><td><span style='font-size: 14px; font-weight: bold;'>\" . $view->translate(\"Sample Store\") . \"</span></td></tr>\";\n\n\t\t\t\t\t$template_header.= \"<table width='98%' cellspacing='0' border='0'><tr><td width='100%' bgcolor='$site_bg_color' style='font-family:arial,tahoma,verdana,sans-serif;padding:40px;'><table width='620' cellspacing='0' cellpadding='0' border='0'>\";\n\t\t\t\t\t$template_header.= \"<tr><td style='background:\" . $site_header_color . \"; color:$site_title_color;font-weight:bold;font-family:arial,tahoma,verdana,sans-serif; padding: 4px 8px;vertical-align:middle;font-size:16px;text-align: left;' nowrap='nowrap'>\" . $site_title . \"</td></tr><tr><td valign='top' style='background-color:#fff; border-bottom: 1px solid #ccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-family:arial,tahoma,verdana,sans-serif; padding: 15px;padding-top:0;' colspan='2'><table width='100%'><tr><td colspan='2'>\";\n\n $template_footer.= \"</td></tr></table></td></tr></td></table></td></tr></table>\";\n }\n\n if ($values['sitestore_insightmail_options'] == 1) {\n $vals['days_string'] = $view->translate('week');\n } elseif ($values['sitestore_insightmail_options'] == 2) {\n $vals['days_string'] = $view->translate('month');\n }\n $path = 'http://' . $_SERVER['HTTP_HOST'] . $view->baseUrl();\n $insight_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Visit your Insights Store') . \"</a>\";\n $update_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Send an update to people who like this') . \"</a>\";\n\n //check if Communityad Plugin is enabled\n $sitestorecommunityadEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('communityad');\n $adversion = null;\n if ($sitestorecommunityadEnabled) {\n $communityadmodulemodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('communityad');\n $adversion = $communityadmodulemodule->version;\n if ($adversion >= '4.1.5') {\n $promote_Ad_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Promote with %s Ads', $site_title) . \"</a>\";\n }\n }\n\n $insights_string.= \"<table><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $vals['days_string'] . $view->translate(array('ly active user', 'ly active users', 2), 2) . \"</span></td></tr><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('person likes this', 'people like this', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n if (!empty($show_comments)) {\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('comment', 'comments', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n }\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '10' . \"</span>\\t <span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('visit', 'visits', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '5' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr></table><table><tr><td>\" . \"<ul style=' padding-left: 5px;'><li>\" . $insight_link . \"</li><li>\" . $update_link;\n\n //check if Communityad Plugin is enabled\n if ($sitestorecommunityadEnabled && $adversion >= '4.1.5') {\n $insights_string.= \"</li><li>\" . $promote_Ad_link;\n }\n $insights_string.= \"</li></ul></td></tr></table>\";\n $days_string = ucfirst($vals['days_string']);\n $owner_name = Engine_Api::_()->user()->getViewer()->getTitle();\n $email = Engine_Api::_()->getApi('settings', 'core')->core_mail_from;\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($values['sitestore_admin'], 'SITESTORE_INSIGHTS_EMAIL_NOTIFICATION', array(\n 'recipient_title' => $owner_name,\n 'template_header' => $template_header,\n 'message' => $insights_string,\n 'template_footer' => $template_footer,\n 'site_title' => $site_title,\n 'days' => $days_string,\n 'email' => $email,\n 'queue' => true));\n }\n }\n }", "private function emailAtLogin() {}", "public function resendmailAction() {\n \n $modelPlugin = $this->modelplugin();\n $mailplugin = $this->mailplugin();\n $phpprenevt = $this->phpinjectionpreventplugin(); \n $jsonArray = $modelPlugin->jsondynamic();\n $userid = $this->sessionid;\n $dynamicPath = $protocol . $jsonArray['domain']['domain_name'];\n $from = $jsonArray['sendgridaccount']['addfrom'];\n\n $encryptedPassword = base64_encode(\"#$#\" . base64_encode(base64_encode($userid . rand(10, 100)) . \"###\" . base64_encode($userid) . \"###\" . base64_encode($userid . rand(10, 100)) . \"###\" . base64_encode(base64_encode($userid . rand(10, 100)))) . \"#$#\");\n $buttonclick = $dynamicPath . \"/Gallery/galleryview/\" . $encryptedPassword;\n $mail_link = \"<a href='\" . $buttonclick . \"' style='background-color: #04ad6a; border: medium none; border-radius: 19px; padding: 12px; color: #fff; text-align: center; text-decoration: none; text-transform: uppercase;'>Click here</a>\";\n\n if (empty($userid)) {\n $userid = $phpprenevt->stringReplace($_POST['loginId']);\n }\n $publisheridarray = array('publisherId' => $userid);\n $selectid = $modelPlugin->getpublisherTable()->selectEmail($publisheridarray);\n $mail = $selectid[0]['email'];\n $keyArray = array('mailCatagory' => 'R_MAIL');\n $getMailStructure = $modelPlugin->getconfirmMailTable()->fetchall($keyArray);\n $getmailbodyFromTable = $getMailStructure[0]['mailTemplate'];\n\n $activationLinkreplace = str_replace(\"|ACTIVATIONLINK|\", $mail_link, $getmailbodyFromTable);\n $mailBody = str_replace(\"|DYNAMICPATH|\", $dynamicPath, $activationLinkreplace);\n $subject = \"Confirm your email address\";\n $mailfunction = $mailplugin->confirmationmail($mail, $from, $subject, $mailBody);\n $res['response'] = 1;\n echo json_encode($res);\n exit;\n }", "public function sendResetEmail()\n {\n $resetToken=$this->extractTokenFromCache('reset')['reset_token'];\n\n $url = url('/'.$this->id.'/resetPassword',$resetToken);\n Mail::to($this)->queue(new ResetPasswordEmail($url));\n }", "public function getReminderEmail()\n {\n return $this->email;\n }", "protected function sendTestMail() {}", "public function resendActivationEmailSuccess()\n {\n return $this->loadPublicView('user.resend-activation-email-success');\n }", "public function sendConfirmation( ){\n\t\t$data = Request::only(['email']);\n\t\t$email = $data['email'];\n\t\t$token = str_random(30);\n\t\t$domain = substr(strrchr($email, \"@\"), 1);\n\n\t\tif( in_array( $domain, explode( ',', env('ACCEPTABLE_EMAIL_DOMAINS') ) ) ){\n\t\t\ttry {\n\t\t\t\t// Check if student exists already\n\t\t\t\tUser::where('email', $email)->firstOrFail();\n\n\t\t\t} catch (ModelNotFoundException $e) {\n\t\t\t\t// Send email verification if they are\n\t\t\t\tMail::send('emails.verification_code', ['email' => $email, 'confirmation_code' => $token], function ($m) use($email) {\n\t\t $m->from('admin@'.env('USER_DOMAIN'), env('SITE_TITLE') );\n\n\t\t $m->to($email)->subject('Verify Your Email For '.env('SITE_TITLE'));\n\t\t });\n\n\t\t VerificationCode::create([\n\t\t \t'email' => $email,\n\t\t \t'confirmation_code' => $token\n\t\t ]);\n\n\t\t return View::make('emails.thank_you');\n\t\t\t}\n\t\t} else{\n\t\t\treturn Redirect::back()->withErrors(['That email is not on our approved list of student emails']);\n\t\t}\n\t}", "public function testCustomerInvoicesV2SendPaymentReminderEmail()\n {\n }", "public function verify()\n {\n $this->update(['email_verified_at' => Carbon::now()]);\n }", "public function getReminderEmail() {\r\n return $this -> email;\r\n }", "function sendReminders($appointmentList)\n\t{\t\t\n\t\t// get appointment details and email address\n\t\tJLoader::register('SalonBookModelAppointments', JPATH_COMPONENT_SITE.DS.'models'.DS.'appointments.php');\n\t\t$appointmentModel = new SalonBookModelAppointments();\n\t\t\n\t\tforeach ($appointmentList as $appointment)\n\t\t{\n\t\t\t$mailingInfo = $appointmentModel->detailsForMail($appointment['id']);\n\t\t\n\t\t\t// clear any old recipients\n\t\t\t$this->email = NULL;\n\t\t\t\n\t\t\t$this->setSuccessMessage($mailingInfo);\n\t\t\n\t\t\t// $this->mailer->addBCC(\"[email protected]\");\n\t\t\t\n\t\t\t$this->sendMail();\n\t\t}\n\t}", "public function getReminderEmail() {\n return $this->email;\n }", "public static function email_confirm_account() {\n\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n # definindo conta como não confirmada.\n $u->hash_confirm_account = $u->hash_confirm_account ?: \\Security::random(32);\n\n if ($u->emailConfirmAccount())\n flash('Email com as instruções para Confirmação de conta para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }" ]
[ "0.8138465", "0.8132959", "0.8015849", "0.7805833", "0.7620241", "0.7559346", "0.75518477", "0.75306356", "0.7486266", "0.7443049", "0.7394344", "0.7394344", "0.7391106", "0.7391106", "0.7391106", "0.7391106", "0.7391106", "0.7391106", "0.7391106", "0.73737", "0.73642063", "0.7363397", "0.7363397", "0.7363397", "0.7363305", "0.73475945", "0.7308048", "0.7145774", "0.698576", "0.6966451", "0.69327813", "0.6906322", "0.6860527", "0.6860455", "0.67050326", "0.66974115", "0.66250217", "0.6610096", "0.659691", "0.65829337", "0.657493", "0.65738964", "0.6571939", "0.6558928", "0.6541759", "0.65330887", "0.6526434", "0.65224904", "0.65206444", "0.65029365", "0.64943874", "0.6476516", "0.6473799", "0.6468402", "0.64607203", "0.64541984", "0.64401853", "0.6437649", "0.6425616", "0.6420488", "0.6407856", "0.6407315", "0.639209", "0.6383452", "0.63828176", "0.63743675", "0.6358789", "0.6353129", "0.6347856", "0.6347392", "0.63470197", "0.6346024", "0.6341735", "0.6336275", "0.6336118", "0.6330276", "0.63258946", "0.632258", "0.63214517", "0.6317967", "0.63167673", "0.6311612", "0.6307302", "0.6292553", "0.6290114", "0.62894225", "0.62792546", "0.6259448", "0.6250609", "0.62398654", "0.623943", "0.6239085", "0.6234492", "0.6232503", "0.62260383", "0.62174714", "0.6213398", "0.62129056", "0.62098396", "0.620939", "0.62069726" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('Building')->insert(array( ['BuildingID' => 1, 'IsAvailable' => 1, 'YearOfResidenceID' => 1, 'BuildingDescription' => 'Centennial'], ['BuildingID' => 2, 'IsAvailable' => 1, 'YearOfResidenceID' => 1, 'BuildingDescription' => 'Davis'], ['BuildingID' => 3, 'IsAvailable' => 1, 'YearOfResidenceID' => 1, 'BuildingDescription' => 'Jenks East'], ['BuildingID' => 4, 'IsAvailable' => 1, 'YearOfResidenceID' => 1, 'BuildingDescription' => 'Jenks West'], ['BuildingID' => 5, 'IsAvailable' => 1, 'YearOfResidenceID' => 1, 'BuildingDescription' => 'Memorial'], ['BuildingID' => 6, 'IsAvailable' => 1, 'YearOfResidenceID' => 1, 'BuildingDescription' => 'Watkins East'], ['BuildingID' => 7, 'IsAvailable' => 1, 'YearOfResidenceID' => 1, 'BuildingDescription' => 'Watkins West'], ['BuildingID' => 8, 'IsAvailable' => 1, 'YearOfResidenceID' => 1, 'BuildingDescription' => 'Wilkinson'] ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
array for validating the fields if they are false or blank then the field isn't valid
function validateFields($fields){ $valid = [ 'isValid' => true, 'invalidField' => '' ]; if(!isset($fields['articleName']) || empty($fields['articleName'])){ $valid['isValid'] = false; $valid['invalidField'] = 'articleName'; } if(!isset($fields['articleAuthor']) || empty($fields['articleAuthor'])){ $valid['isValid'] = false; $valid['invalidField'] = 'articleAuthor'; } if(!isset($fields['articleDate']) || empty($fields['articleDate'])){ $valid['isValid'] = false; $valid['invalidField'] = 'articleDate'; } if(!isset($fields['articleCategory']) || empty($fields['articleCategory'])){ $valid['isValid'] = false; $valid['invalidField'] = 'articleCategory'; } if(!isset($fields['articleContent']) || empty($fields['articleContent'])){ $valid['isValid'] = false; $valid['invalidField'] = 'articleContent'; } return $valid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateFields()\n {\n $invalidFields = [];\n if (empty($_POST[\"activity\"])) {\n array_push($invalidFields, \"activity\");\n }\n if (empty($_POST[\"country\"])) {\n array_push($invalidFields, \"country\");\n }\n if (empty($_POST[\"done\"]) && empty($_POST[\"not done\"])) {\n array_push($invalidFields, \"done\");\n }\n return $invalidFields;\n }", "private function checkFields()\r\n {\r\n $vars = array('user', 'pass', 'numbers', 'message', 'date', 'ids', 'data_start', 'data_end',\r\n 'lido', 'status', 'entregue', 'data_confirmacao', 'return_format'\r\n );\r\n\r\n $final = array();\r\n foreach ($vars as $key => $value) {\r\n if ($this->$value !== '') {\r\n $final[$value] = $this->$value;\r\n }\r\n }\r\n return $final;\r\n }", "function validate_fields( $array ) {\n\t\t$this->validate_list = $array;\n\t\t}", "function validateBizEditFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['catID'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "function check_required_fields($required_array) {\r\n $field_errors = array();\r\n foreach($required_array as $fieldname) {\r\n if (isset($_POST[$fieldname]) && empty($_POST[$fieldname])) { \r\n $field_errors[] = ucfirst($fieldname). \" is required\"; \r\n }\r\n }\r\n return $field_errors;\r\n}", "public function hasBlankFields($array) : bool\n { \n return (in_array('', $array, true) || in_array(null, $array, true)) ? true && $this->setError(true) : false;\n }", "public function fieldValidationArray()\n {\n return [\n 'name' => 'required|codename|min:2|max:255',\n 'label' => 'string',\n 'description' => 'string',\n 'required' => 'boolean',\n 'mode' => 'string|in:prefer_local,prefer_external,only_local,only_external',\n 'script' => 'string'\n ];\n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "function validate_fields($var){\n global $errors;\n foreach ($var as $field) {\n $val = remove_junk($_POST[$field]);\n if(isset($val) && $val==''){\n $errors = $field .\" No puede estar en blanco.\";\n return $errors;\n }\n }\n}", "function not_empty(array $fields) { // création tableau\r\n\t\r\n\r\n\t\tif (count($fields)!=0)\t{ // verif.si il y a des elements dans le tableau\r\n\t\t\r\n\r\n\t\t\tforeach ($fields as $field) {\r\n\r\n\t\t\t\tif (empty($_POST[$field]) || trim($_POST[$field])==\"\") {\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\treturn false; // verif.que tous les champs soient remplis, sinon \"false\"\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\t\r\n\r\n\r\n\t\t}", "function validateBizAddFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['businessCategory'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "function not_empty($fields = [])\r\n{\r\n if (count($fields) !=0) {\r\n foreach ($fields as $field) {\r\n if (empty($_POST [$field]) || trim($_POST[$field]) == \"\") { //trim escape all spaces. If empty : false\r\n return false;\r\n }\r\n }\r\n return true ; //fields filled\r\n }\r\n}", "public function validateFieldData($postArray) \n{\n //for each field - check maxLenth if set, and check required just in case. Required should already be set - but just in case it should be checked again before filing.\n $errorArray=array();\n \n foreach ($this->tableStructure as $index=>$fieldArray) {\n $columnName=$fieldArray['columnName'];\n $val= isset($postArray[$columnName]) ? $postArray[$columnName] : '';\n $maxLength=isset($fieldArray['maxLength']) ? $fieldArray['maxLength'] : '';\n \n if (($val != '') && ($maxLength != '')) {\n if (strlen($val) > $maxLength) {\n $errorArray[$columnName]=\"Exceeds maximum length of \".$maxLength.\".\";\n }\n }\n \n if ($val == '') {\n if (isset($fieldArray['required']) && $fieldArray['required'] == 1) {\n $errorArray[$columnName]=\"Required field.\";\n } \n }\n } \n \n return $errorArray; \n}", "function formErrorCheck( $fields ) {\n\t\n\t$array = get_option( 'resume_input_fields' );\n\n\tforeach ( $array as $item => $key) {\n\t\t\n\t\tswitch($item){\n\t\t\tcase 'fname':\n\t\t\t\t\t\tif ( !$fields['fname'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'lname':\n\t\t\t\t\t\tif ( !$fields['lname'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'address':\n\t\t\t\t\t\tif ( !$fields['address'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'address2':\n\t\t\t\t\t\tif ( !$fields['address2'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'city':\n\t\t\t\t\t\tif ( !$fields['city'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'state':\n\t\t\t\t\t\tif ( !$fields['state'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'zip':\n\t\t\t\t\t\tif ( !$fields['zip'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'pnumber':\n\t\t\t\t\t\tif ( ( !$fields['pnumber'] || !$fields['pnumbertype'] ) && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'snumber':\n\t\t\t\t\t\tif ( ( !$fields['snumber'] || !$fields['snumbertype'] ) && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\t\t\tif ( !$fields['email'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'attachment':\n\t\t\t\t\t\tif ( !$fields['attachment'][0]['name'][0] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'cover':\n\t\t\t\t\t\tif ( !$fields['cover'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'resume':\n\t\t\t\t\t\tif ( !$fields['resume'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n\t\n\treturn $error;\t\n}", "function validate_fields() {\n\t\treturn true;\n\t}", "public function validate_fields() {\n \n\t\t//...\n \n }", "function validateBizSearchFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['catID'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\t$f5 = $fields['postcode'];\r\r\n\t\t\t\t$f6 = $fields['phoneAreacode'];\r\r\n\t\t\t\t$f7 = $fields['phoneNumber'];\r\r\n\t\t\t\t$f8 = $fields['cellPhoneNumber'];\r\r\n\t\t\t\t$f9 = $fields['faxNumber'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '') && ($f5 == '') && ($f6 == '') && ($f7 == '') && ($f8 == '') && ($f9 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Atleast one field required for a search');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "function validate_fields($var){\n global $errors;\n foreach ($var as $field) {\n $val = remove_junk($_POST[$field]);\n if(isset($val) && $val==''){\n $errors = $field .\" can't be blank.\";\n return $errors;\n }\n }\n}", "public function check_fields($fields) {\n\t \n\t if ($fields == \"*\") {\n\t\treturn array('error' => false, 'param' =>'');\n\t }\n\t \n $fields_arr = explode(',',$fields);\n\t \n\t foreach ($fields_arr as $element) {\n\t\tif (!isset($this->paramsStr[$element])) {\n\t\t return array('error' => true , 'param' => $element);\n\t\t}\n\t }\n\t return array('error' => false, 'param' =>'');\n\t}", "function validateAll(){\n foreach($this->fields as $field){\n $val = $_POST[$field['id']];\n if($field['validate']){\n switch($field['type']){\n case \"email\":\n if(!filter_var($val, FILTER_VALIDATE_EMAIL)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n break;\n case \"number\":\n if(!is_numeric($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n if($this->fields[$field['id']]['min'] > $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n if($this->fields[$field['id']]['max'] < $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"password\":\n if($this->fields[$field['id']]['compare']){\n $compareWith = $this->fields[$field['id']]['compare'];\n if($val != $_POST[$compareWith]){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }else if(!$this->validatePassword($val) || !$this->validatePassword($_POST[$compareWith])){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }else{\n if(!$this->validatePassword($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n break;\n case \"date\":\n if(!$this->validateDate($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n $min = $this->fields[$field['id']]['min'];\n if($this->compareDates($min, $val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n $max = $this->fields[$field['id']]['max'];\n if($this->compareDates($val, $max)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"radio\":\n if(!$val){\n $this->fields[$field['id']]['error'] .= \" error\";\n }\n break;\n default:\n if(!$val){\n $this->fields[$field['id']]['class'] .= \" error\";\n }\n }\n }\n }\n return ($this->has_errors ? false : true);\n }", "public function validate ()\n {\n $errorCount = 0;\n foreach ($this->arrayFieldDefinition as $fieldName => $arrField) {\n if ( $arrField['required'] === true )\n {\n $accessor = $this->arrayFieldDefinition[$fieldName]['accessor'];\n if ( trim ($this->$accessor ()) == \"\" )\n {\n $this->validationFailures[] = $fieldName . \" Is empty. It is a required field\";\n $errorCount++;\n }\n }\n }\n if ( $errorCount > 0 )\n {\n return false;\n }\n return true;\n }", "function validate()\n\t\t{\n\t\t\tif(count($this->validateFields)==0 || !is_array($this->validateFields)){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t$error\t=\t0;\n\t\t\t\t$fieldPos=1;\n\t\t\t\t//First Validate For Empty on all fields //\n\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\n\t\t\t\t\tif(in_array(\"EMPTY\",$valids) && $checkedError==0){\n\t\t\t\t\t\tif($this->validateEmpty($key)){\n\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t$this->setError(\"Enter Mandatory Fields \");\n\t\t\t\t\t\t\t$checkedError\t=\t1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$fieldPos++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif($error==0){\n\t\t\t\t\t$fieldPos=1;\n\t\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"EMAIL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateEmail($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid email id in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"NUMBER\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateNumeric($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Enter Numeric in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(in_array(\"FILTER\",$valids)){\n\t\t\t\t\t\t\tif($this->validateSpecial($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Special chars not allowed in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"URL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateUrl($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid website address in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$fieldPos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\tif($error==0){\n\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function is_field_empty(array $fields) {\n foreach ($fields as $key => $value) {\n $fields[$key] = isset($value) ? trim($value) : '';\n }\n /* If there is nothing a field then valid empty index is false */\n if (in_array(\"\", $fields, true)) {\n return false;\n }\n /* return array */\n return $fields;\n}", "public function validateFields($par)\n {\n $i=0;\n foreach ($par as $key => $value){\n if(empty($value)){\n $i++;\n }\n }\n if($i==0){\n return true;\n }else{\n $this->setErro(\"Preencha todos os dados!\");\n return false;\n }\n }", "private function validateFields()\n {\n $errors = array();\n for ($x=0; $x < count($this->_fields); $x++)\n {\n $field = $this->_fields[$x];\n if ($field['type'] == WFT_CC_EXPIRATION)\n {\n // one or both fields left blank\n if (strlen(trim($this->getPostValue($field['id'] . 'Month'))) == 0 ||\n strlen(trim($this->getPostValue($field['id'] . 'Year'))) == 0)\n {\n if ($field['required'])\n $errors[] = 'You must select an card expiration month and year';\n $monthValue = $yearValue = -1;\n $value = '';\n }\n else\n {\n $monthValue = intval($this->getPostValue($field['id'] . 'Month'));\n $yearValue = intval($this->getPostValue($field['id'] . 'Year'));\n $curYear = intval(date('Y'));\n if ($yearValue < $curYear)\n $errors[] = 'The expiration year is in the past';\n if ($monthValue < 1 || $monthValue > 12)\n $errors[] = 'The expiration month is not valid';\n }\n }\n else if($field['required'] && !strlen(trim($this->getPostValue($field['id']))))\n {\n if (strlen($field['caption']) > 0)\n $errors[] = $field['caption'] . ' is a required field';\n else\n $errors[] = 'This field is required';\n $value = '';\n }\n else if($field['type'] == WFT_CURRENCY)\n {\n $value = trim($this->getPostValue($field['id']));\n $value = str_replace('$', '', $value);\n $cur = floatval($value);\n $value = strval($cur);\n }\n else if($field['type'] == WFT_ANTI_SPAM_IMAGE)\n {\n $antiSpamInput = $this->getPostValue($field['id']);\n $wordVerifyID = $this->getPostValue('wordVerifyID');\n $graphs = new Graphs();\n $wordVerifyText = $graphs->getVerificationImageText($wordVerifyID);\n if (strtoupper($antiSpamInput) != $wordVerifyText || $antiSpamInput == '')\n {\n $errors[] = 'The text you entered did not correspond with the text in the security image';\n $value = 0;\n }\n else\n {\n $value = 1;\n }\n $graphs->clearVerificationImageText($wordVerifyID);\n }\n else if($field['type'] == WFT_SELECT || $field['type'] == WFT_CC_TYPE || $field['type'] == WFT_BOOLEAN)\n {\n $value = $this->getPostValue($field['id']);\n if (!strcmp($value, 'noset'))\n {\n $errors[] = $field['caption'] . ': You must select an option';\n }\n }\n else if($field['type'] == WFT_CC_NUMBER)\n {\n $value = '';\n // Clean credit card number input\n $cardNumber = preg_replace('/[^0-9]/', '', $this->getPostValue($field['id']));\n\n if ($field['required'] == false && !strlen($cardNumber))\n {\n $value = '';\n }\n else\n {\n // Guess the card type by using a pregex pattern matching algorithm\n $cardType = $this->getCreditCardTypeByNumber($cardNumber);\n if ($cardType == -1)\n $errors[] = 'The credit card number you entered is not a recognized Visa, MasterCard, American Express '\n . 'or Discover card.';\n else if (!$this->isCardNumberValid($cardType, $cardNumber))\n $errors[] = 'The credit card number you entered has not been recognized and may be invalid.';\n else\n {\n // Valid card number, now change all card type fields to match\n // the autodetected card type (visa, mastercard, etc.)\n $value = $cardNumber;\n $cardTypeName = $this->getCreditCardName($cardType);\n\n for ($y=0; $y < count($this->_fields); $y++)\n {\n if ($this->_fields[$y]['type'] == WFT_CC_TYPE)\n {\n $this->_fields[$y]['validatedDataOverride'] = $cardTypeName;\n $this->_fields[$y]['validatedData'] = $cardTypeName;\n }\n }\n }\n }\n }\n else\n {\n $value = trim($this->getPostValue($field['id']));\n\n if (!($field['required'] == false && !strlen($value)))\n {\n if (strlen($field['regex_test']) > 0)\n {\n if (!preg_match($field['regex_test'], $value))\n {\n $errors[] = $field['regex_fail'];\n }\n }\n if (strlen($value) < $field['length'][0] || strlen($value) > $field['length'][1])\n {\n if ($field['length'][0] == $field['length'][1])\n {\n if (strlen(trim($field['caption'])) > 0)\n $errors[] = sprintf(\"%s must be %d characters in length\",\n $field['caption'], $field['length'][0]);\n else\n $errors[] = sprintf(\"This field must be %d characters in length\",\n $field['length'][0]);\n }\n else\n $errors[] = sprintf(\"%s must be between %s characters in length\",\n $field['caption'], implode(' and ', $field['length']));\n }\n }\n $value = str_replace(array(\"\\r\",\"\\n\",\"\\t\",\"\\f\"), '', strip_tags($value));\n }\n\n // Set the validated (form returned) data\n switch($field['type'])\n {\n case WFT_CC_EXPIRATION:\n if ($monthValue != -1 && $yearValue != -1)\n $this->_fields[$x]['validatedData'] = sprintf('%d/%d', $monthValue, $yearValue);\n else\n $this->_fields[$x]['validatedData'] = '';\n break;\n default:\n if (isset($this->_fields[$x]['validatedDataOverride']) && strlen($this->_fields[$x]['validatedDataOverride']))\n $this->_fields[$x]['validatedData'] = $this->_fields[$x]['validatedDataOverride'];\n else\n $this->_fields[$x]['validatedData'] = $value;\n break;\n }\n }\n return $errors;\n }", "private function validate_required_fields()\n\t{\n\t\t$errors = array();\n\t\t\n\t\tforeach (array_keys($this->_required_fields) as $field)\n\t\t{\n\t\t\t$value = $this->get_field_value($field);\n\t\t\t\n\t\t\tif (!validate::required($value))\n\t\t\t{\n\t\t\t\t$errors[$field] = 'Required';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $errors;\n\t}", "public static function validationArray():array {\n $validation = array (\n \"likedDate\" => 'required',\n );\n\n return $validation;\n }", "protected function getAllFieldsAreEmpty() {}", "public static function validationArray():array {\n $validation = array (\n \"likedDate\" => 'required',\n\n );\n\n return $validation;\n }", "function validate_presences($required_fields, $warning_me=false) {\n global $errors;\n global $warnings;\n\n $msg_presence=array();\n\n foreach($required_fields as $field) {\n $value = trim($_POST[$field]);\n \tif (!has_presence($value)) {\n if ($warning_me) {\n $warnings[$field] = fieldname_as_text($field) . \" can't be blank\";\n // $msg_presence[$field]=get_warning_error($warnings[$field],$warning_me);\n $msg_presence[$field]=$warnings[$field];\n\n }else{\n \t\t $errors[$field] = fieldname_as_text($field) . \" can't be blank\";\n // $msg_presence[$field]=get_warning_error($errors[$field],$warning_me);;\n $msg_presence[$field]=$errors[$field];\n\n\n }\n\n }\n }\n\n return $msg_presence;\n\n}", "function checkEmptyFields($custInfo) { \n $errorMessageIfEmpty = array(\n \"CustFirstName\" => \"First name is empty\",\n \"CustLastName\" => \"Last name is empty\",\n \"CustAddress\" => \"Address is required\",\n \"CustCity\" => \"City field is empty\",\n \"CustProv\" => \"Province field is empty\",\n \"CustPostal\" => \"Postal Code is empty\",\n \"CustCountry\" => \"Country field is empty\",\n \"CustHomePhone\" => \"Home phone number is required\",\n \"CustBusPhone\" => \"Bus/Cell phone number is required\",\n \"CustEmail\" => \"Please enter your email\",\n \"username\" => \"Username field is empty\",\n \"password\" => \"Password field is empty\"\n );\n \n $actualErrors = array();\n \n foreach($custInfo as $key => $value) {\n if(array_key_exists($key, $errorMessageIfEmpty)) {\n if(trim($value) == \"\") {\n $actualErrors[$key] = $errorMessageIfEmpty[$key];\n } \n }\n } \n return $actualErrors;\n }", "function validateallFields(){\r\n\t$response = array();\r\n\t$valid = FALSE;\r\n\t//validate first name\r\n\t//first name should not be numeric\r\n\tif(is_numeric($_POST['fname'])){\r\n\t\t$response['message'] = \"First name should not be a number\";\r\n\t\t$response['valid'] = false;\r\n\t\treturn $response;\r\n\t}elseif(is_numeric($_POST['lname'])){\r\n\t\t$response['message'] = \"Last name should not be a number\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t}elseif(is_numeric($_POST['username'])){\r\n\t\t$response['message'] = \"Your username should not be numeric\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t}elseif(is_numeric($_POST['address'])){\r\n\t\t$response['message'] = \"address should be alphanumeric\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t}elseif(!is_numeric($_POST['contact'])){\r\n\t\t$response['message'] = \"Your contact should be numeric\";\r\n\t\t$response['valid'] = FALSE;\r\n\t\treturn $response;\r\n\t\r\n\t}else{\r\n\t\t$response['valid'] = TRUE;\r\n\t\treturn $response;\r\n\t}\r\n\r\n}", "function validate($data)\n\t{\n\t\t\n\t\t$res[] = [\n\t\t\t'validity' => false,\n\t\t\t'type' => 'all',\n\t\t\t'message' => ''\n\t\t];\n\t\t//required check\n\t\tif(isset($data['required'])){\n\t\t\t$dataForCheck = $data['required'];\n\t\t\tforeach ($dataForCheck as $key => $value) {\n\t\t\t\tif($value != null && $value != '' && !empty($value) && !is_null($value))\n\t\t\t\t{\n\t\t\t\t\t$res[] = [\n\t\t\t\t\t\t'validity' => true,\n\t\t\t\t\t\t'type' => 'required',\n\t\t\t\t\t\t'message' => 'Success'\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$res[] = [\n\t\t\t\t\t\t'validity' => false,\n\t\t\t\t\t\t'type' => 'required',\n\t\t\t\t\t\t'message' => 'Some required fields are missing'\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $res;\n\t}", "public function isRequired($field_array) {\n\t\tforeach($field_array as $field) {\n\t\t\tif ($_POST[''.$field.''] == '') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}", "function checkEmptyField($requiredField){\n\n $formErrors = array();\n\n foreach($requiredField as $nameofField){\n\n if (!isset($_POST[$nameofField]) || $_POST[$nameofField] == NULL){\n \n $formErrors[] = $nameofField . \" is a required field.\" ;\n \n }\n }\n return $formErrors;\n }", "function validate(){\r\n\t\t$missing_fields = Array ();\r\n\t\tforeach ( $this->required_fields as $field ) {\r\n\t\t\t$true_field = $this->fields[$field]['name'];\r\n\t\t\tif ( $this->$true_field == \"\") {\r\n\t\t\t\t$missing_fields[] = $field;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( count($missing_fields) > 0){\r\n\t\t\t// TODO Create friendly equivelant names for missing fields notice in validation \r\n\t\t\t$this->errors[] = __ ( 'Missing fields: ' ) . implode ( \", \", $missing_fields ) . \". \";\r\n\t\t}\r\n\t\treturn apply_filters('em_event_validate', count($this->errors) == 0, $this );\r\n\t}", "public function validateFields($fieldRules)\n {\n global $errorFeedback;\n $errors = [];\n foreach($fieldRules as $field => $rules){\n $fieldErrors = [];\n $value = $_REQUEST[$field];\n\n $d = new Disinfect();\n $d->disinfect($value);\n\n foreach($rules as $rule){\n\n if($rule == 'required'){\n if(! isset($value) || trim($value) == '' ){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'its required'\n }\n }\n\n if($rule == 'number'){\n if($value != '' && ! preg_match('/^(\\d+)$/', $value)){\n $fieldErrors[] = $errorFeedback[$rule]; // 'its a number'\n }\n }\n\n if($rule == 'freeNickname'){\n $u = new UserModel();\n $nickexist = $u->getUsersByNickname($value);\n if (!$nickexist == false) {\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'nickname not free'\n }\n }\n\n if($rule == 'max15chars'){\n if($value != '' && strlen($value) > 15){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'max chars 15'\n }\n }\n\n if($rule == 'max35chars'){\n if($value != '' && strlen($value) > 35){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'max chars 35'\n }\n }\n\n if($rule == 'min5chars'){\n if($value != '' && strlen($value) < 5){\n $fieldErrors[] = $this->errorFeedback[$rule]; // 'min chars 5'\n }\n }\n\n if($rule == 'password'){ // not in use jet!\n\n if($value != '' && ! preg_match('/^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8,}$/', $value)){\n $fieldErrors[] = $this->errorFeedback[$rule];\n //'its a password with = 8 characters length oe more, 2 letters in Upper Case, 1 Special Character, 2 numerals, 3 letters in Lower Case'\n // TODO use the Password validation if you want you passwords really save (and annoy the users)\n }\n }\n }\n // Are there some errors?\n if(count($fieldErrors) != 0){\n $errors[$field] = $fieldErrors;\n }\n }\n return $errors;\n }", "public static function validationStoreArray():array {\n $validation = array (\n 'creativeTitle' => 'required|string|max:255|unique:profiles,creative_title,NULL,id,user_id,'.Auth::user()->id,\n );\n\n return $validation;\n }", "function check_fields() {\r\n \r\n $fail = false;\r\n\t\t$empty = true;\r\n\t\t\r\n // if first name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputFirstName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputFirstName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['firstNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n // if last name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputLastName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputLastName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['lastNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n \r\n // if phone number contains any non-digit or - characters, exit\r\n\t\tif($_POST[\"InputPhone\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputPhone\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[0-9-]*$/\")))) {\r\n\t\t\t\t$GLOBALS['phoneNumberNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n if(!$fail && !$empty) {\r\n change_info();\r\n }\r\n }", "function filled_out($form_vars)\r\n{\r\n foreach ($form_vars as $key => $value)\r\n {\r\n if (!isset($key) || ($value == \"\"))\r\n return true;\r\n }\r\n return true;\r\n}", "function validate_all($required,$data){\n\n\t$result = array();\n\t$result['code'] = 1;\n\t$result['error'] = \"All OK!\";\n\n\tif(count(array_intersect_key($required, $data)) != count($required)){\n\t\t$result['code'] = 0;\n\t\t$result['error'] = \"Fields Mismatch!\";\n\t\treturn $result;\n\t}\n\n\t$field_count \t= count($required);\n\n\tforeach ($required as $field => $rules) {\n\t\t$value = $data[$field];\n\n\t\t$code = 0;\n\t\t$error = \"\";\n\n\t\tswitch ($rules['type']) {\n\t\t\tcase 'numeric':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!is_numeric($value)){\n\t\t\t\t\t$error = $field.\" is not numeric.\";\n\t\t\t\t}else if(isset($rules['min'])){\n\t\t\t\t\tif($value < $rules['min']){\n\t\t\t\t\t\t$error = $field.\" min error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else if(isset($rules['max'])){\n\t\t\t\t\tif($value > $rules['max']){\n\t\t\t\t\t\t$error = $field.\" max error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'alpha':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!preg_match($rules['pattern'], $value)){\n\t\t\t\t\t$error = $field.\" is invalid.\";\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$result['fields'][$field] = array('code' => $code, 'error' => $error, 'value'=>$value, 'field'=>$field );\n\t}\n\n\tforeach ($result['fields'] as $row) {\n\t\tif($row[\"code\"] == 0){\n\t\t\t$result['code'] = 0;\n\t\t\t$result['error'] = \"Invalid Fields!\";\n\t\t\tbreak;\n\t\t}\t\t\n\t}\n\n\treturn $result;\n\n}", "public function validate()\n {\n $errors = [];\n\n if (!\\Zend_Validate::is($this->getNickname(), 'NotEmpty')) {\n $errors[] = __('Please enter a nickname.');\n }\n\n if (!\\Zend_Validate::is($this->getDetail(), 'NotEmpty')) {\n $errors[] = __('Please enter a review.');\n }\n\n if (empty($errors)) {\n return true;\n }\n return $errors;\n }", "function validate_ref_no($formdata,$required_fields = array(),$correctformat=array())\n{\n\tprint_r($correctformat); exit();\n \t\n\t/*$empty_fields = array();\n\t$bool_result = TRUE;\n\tforeach($required_fields AS $required)\n\t{\n\t\t//compare fordata;\n\t\t//if($formdata)\n\n\t\t#array_push($empty_fields, $field_str[0]);\n\t} */\n}", "protected function validate()\n {\n if ($this->adoption_date == '') {\n $this->errors[] = 'Application Date is required';\n }\n if ($this->adoption_fee == '') {\n $this->errors[] = 'Adoption Fee is required';\n }\n\n\n return empty($this->errors);\n }", "function validate_all($required, $data)\n{\n $result = array();\n $result['code'] = 1;\n $result['error'] = \"All OK!\";\n if (count(array_intersect_key($required, $data)) != count($required)) {\n $result['code'] = 0;\n $result['error'] = \"Fields Mismatch!\";\n return $result;\n }\n foreach ($required as $field => $rules) {\n $value = trim($data[$field]);\n $code = 0;\n $error = \"\";\n switch ($rules['type']) {\n case 'numeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!is_numeric($value)) {\n $error = $field . \" is not numeric.\";\n } else if (isset($rules['min'])) {\n if ($value < $rules['min']) {\n $error = $field . \" min error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else if (isset($rules['max'])) {\n if ($value > $rules['max']) {\n $error = $field . \" max error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9 ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'email':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'pattern':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'any':\n # code...\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n }\n $result['fields'][$field] = array('code' => $code, 'error' => $error, 'value' => $value, 'field' => $field);\n }\n foreach ($result['fields'] as $row) {\n if ($row[\"code\"] == 0) {\n $result['code'] = 0;\n $result['error'] = $row['error'];\n break;\n }\n }\n return $result;\n}", "function filled_out($form_vars) {\n foreach ($form_vars as $key => $value) {\n if ((!isset($key)) || ($value == '')) {\n return false;\n }\n }\n return true;\n}", "public function validate() {\n\t\t$message = array();\n\t\tforeach ( $this->fields as $key => $field ) {\n\t\t\t\n\t\t\tif ( !$field->validate() ) {\n\t\t\t\t$this->fields[ $key ]->classes[] = 'missing';\n\t\t\t\t$message[] = $field->label. ' is required.';\n\t\t\t}\n\t\t}\n\t\tif ( count($message) > 0 ) {\n\t\t\treturn $message;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "protected function validate( $data )\n {\n foreach( $data as $field => $value ) {\n //Because 0 is evaluating as empty for some stupid reason\n if( empty( $value ) && ( $value == '' || is_null( $value ) ) ) {\n return false;\n }\n }\n return true;\n }", "protected function validate()\n {\n if ($this->primary_first_name == '') {\n $this->errors[] = 'First name is required';\n }\n if ($this->primary_last_name == '') {\n $this->errors[] = 'Last Name is required';\n }\n\n if ($this->email == '') {\n $this->errors[] = 'Email is required';\n }\n\n if ($this->phone_number == '') {\n $this->errors[] = 'Phone Number is required';\n }\n\n if ($this->city == '') {\n $this->errors[] = 'City is required';\n }\n\n if ($this->state == '') {\n $this->errors[] = 'State is required';\n }\n\n if ($this->zip_code == '') {\n $this->errors[] = 'Zip Code is required';\n }\n\n if ($this->application_date == '') {\n $this->errors[] = 'Application Date is required';\n }\n\n return empty($this->errors);\n}", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "protected function getValidFieldValues()\n {\n return [\n 'id' => [\n '1',\n '100'\n ]\n ];\n }", "private function _validate()\n {\n $data = array();\n $data['error_string'] = array();\n $data['inputerror'] = array();\n $data['status'] = TRUE;\n\n //merubah form yang di post menjadi array asosiatif\n $jumlahField = array(\n 'nomor_part' => $this->input->post('nomor_part'),\n 'nama_part' => $this->input->post('nama_part'),\n 'qty' => $this->input->post('qty'),\n 'harga_jual' => $this->input->post('harga_jual'),\n 'harga_beli' => $this->input->post('harga_beli'),\n );\n\n //menguraikan array jumlahField\n foreach ($jumlahField as $key => $value):\n if ($value == \"\")://kondisi untuk mengecek jika value atau inputan ada yang kosong\n $data['inputerror'][] = $key;\n $data['error_string'][] = str_replace(\"_\", \" \", $key).' tidak boleh kosong';\n $data['status'] = FALSE;\n endif;\n endforeach;\n\n if($data['status'] === FALSE):\n echo json_encode($data);\n exit();\n endif;\n }", "function filled_out($form_vars) {\n\t\t// test that if each variable has a value\n\t\tforeach ($form_vars as $key => $value) {\n\t\t\tif ((!isset($key)) || ($value == '')) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public abstract function validateFormInput($FORM_array);", "public function validate() {\n \n $errors = [];\n $names = explode(' ', $this->data->name, 2);\n\n if(count($names) < 2) {\n $errors['name'] = array('first and last names are required');\n }\n\n if(!filter_var($this->data->email, FILTER_VALIDATE_EMAIL)) {\n $errors['email'] = array($this->data->email.' is not a valid email address');\n }\n\n if(strlen($this->data->password) < 8) {\n $errors['password'] = array('password must be at least 8 characters');\n }\n\n return $errors;\n }", "protected function validate()\n {\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n if ($this->sex == '') {\n $this->errors[] = 'Sex selection is required';\n }\n\n if ($this->description == '') {\n $this->errors[] = 'Description is required';\n }\n\n if ($this->surrender_date == '') {\n $this->errors[] = 'Surrender Date is required';\n }\n\n if ($this->surrender_reason == '') {\n $this->errors[] = 'Surrender Reason is required';\n }\n\n return empty($this->errors);\n }", "public function validate()\n {\n $errors = array();\n \n // trimming\n \n if($this->trim)\n {\n $this->value = trim($this->value);\n }\n \n // required\n \n if($this->required && empty($this->value))\n {\n $errors[] = 'Pole \"' . $this->label . '\" jest wymagane';\n \n return array(false, $errors);\n }\n \n // max length\n \n if(isset($this->maxLength) && strlen($this->value) > $this->maxLength)\n {\n $errors[] = 'Pole \"' . $this->label . '\" może mieć maksymalnie ' . $this->maxLength . ' znaków';\n }\n \n //--\n \n return array(true, $errors);\n }", "private function arrayValidator()\n {\n\n\n\n $rules = [\n 'name' => ['required', 'string'],\n 'email' => ['required', 'string', 'unique:users'],\n 'ConfigPassword' => ['required', 'string', 'min:8'],\n 'password' => ['required_with:ConfigPassword', 'same:ConfigPassword', 'min:8'],\n 'phone' => ['required'],\n 'nickname' => ['required'],\n \"gender\" => ['required'],\n \"profile_picture\" => ['required', 'mimes:jpeg,bmp,png,jpg'],\n \"birthday\" => ['required'],\n \"position\" => ['required'],\n \"weight\" => ['required'],\n \"height\" => ['required'],\n \"footPlay\" => ['required'],\n \"living_location\" => ['required'],\n \"previous_clubs\" => ['required'],\n \"strength_point\" => ['required'],\n \"scientificl_level\" => ['required'],\n \"level\" => ['required'],\n\n\n ];\n\n return $rules;\n }", "abstract public function validate(array $data, array $fields);", "function validate_form($formtype, $formdata, $required_fields=array())\n{\n\n\t$empty_fields = array();\n\t$bool_result = TRUE;\n\t\t\t\n\tforeach($required_fields AS $required)\n\t{\n\t\tif(strpos($required, '*') !== FALSE){\n\t\t\t#This is a checkbox group\n\t\t\tif(strpos($required, 'CHECKBOXES') !== FALSE)\n\t\t\t{\n\t\t\t\t$field_str = explode('*', $required);\n\t\t\t\tif(empty($formdata[$field_str[0]])){\n\t\t\t\t\tarray_push($empty_fields, $field_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is a combobox\n\t\t\tif(strpos($required, 'COMBOBOX') !== FALSE)\n\t\t\t{\n\t\t\t\t$field_str = explode('*', $required);\n\t\t\t\tif(count($formdata[$field_str[0]]) == 1){\n\t\t\t\t\tif(empty($formdata[$field_str[0]][0])){\n\t\t\t\t\t\tarray_push($empty_fields, $field_str[0]);\n\t\t\t\t\t}\n\t\t\t\t}elseif(empty($formdata[$field_str[0]])){\n\t\t\t\t\tarray_push($empty_fields, $field_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is a required row\n\t\t\telse if(strpos($required, 'ROW') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t$field_array = explode('<>', $row_str[1]);\n\t\t\t\t$decision = FALSE;\n\t\t\t\t\t\t\n\t\t\t\t$rowcounter = 0;\n\t\t\t\t#Take one row field and use that to check the rest\n\t\t\t\tforeach($formdata[$field_array[0]] AS $col_field)\n\t\t\t\t{\n\t\t\t\t\t$row_decision = TRUE;\n\t\t\t\t\tforeach($field_array AS $row_field){\n\t\t\t\t\t\tif(empty($formdata[$row_field][$rowcounter])){\n\t\t\t\t\t\t\t$row_decision = FALSE;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\tif($row_decision && !empty($col_field)){\n\t\t\t\t\t\t$decision = TRUE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t$rowcounter++;\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tif(!$decision){\n\t\t\t\t\tarray_push($empty_fields, $field_array);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is a required radio with other options\n\t\t\telse if(strpos($required, 'RADIO') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t\t\t\n\t\t\t\t#The radio is not checked\n\t\t\t\tif(empty($formdata[$row_str[0]])){\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t\t#if the radio is checked, check the other required fields\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($formdata[$row_str[0]] == 'Y'){\n\t\t\t\t\t\t$field_array = explode('<>', $row_str[1]);\n\t\t\t\t\t\t#Remove first RADIO field item which is not needed\n\t\t\t\t\t\tarray_shift($field_array);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($field_array AS $radio_field)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(empty($formdata[$radio_field])){\n\t\t\t\t\t\t\t\tarray_push($empty_fields, $radio_field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is ensuring that the fields specified are the same\n\t\t\telse if(strpos($required, 'SAME') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t$field_array = explode('<>', $row_str[1]);\n\t\t\t\t\n\t\t\t\tif($formdata[$row_str[0]] != $formdata[$field_array[1]]){\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is ensuring that the email is the correct format\n\t\t\telse if(strpos($required, 'EMAILFORMAT') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t\n\t\t\t\tif(!is_valid_email($formdata[$row_str[0]]))\n\t\t\t\t{\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t#This is ensuring that the number is the correct format\n\t\t\telse if(strpos($required, 'NUMBER') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t\n\t\t\t\tif(!is_numeric($formdata[$row_str[0]]))\n\t\t\t\t{\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t#This is ensuring that the first field is less than the next field\n\t\t\telse if(strpos($required, 'LESSTHAN') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t$field_array = explode('<>', $row_str[1]);\n\t\t\t\t\n\t\t\t\tif(!($formdata[$row_str[0]] < $formdata[$field_array[1]] || $formdata[$row_str[0]] == '' || $formdata[$field_array[1]] == '')){\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This field should validate code of the financial year :: \n\t\t}\n\t\t\t\t\n\t\t#Is a plain text field or other value field\n\t\telse\n\t\t{\n\t\t\tif(!(!empty($formdata[$required]) || $formdata[$required] == '0')){\n\t\t\t\tarray_push($empty_fields, $required);\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\t\n\t\n\tif(empty($empty_fields)){\n\t\t$bool_result = TRUE;\n\t}else{\n\t\t$bool_result = FALSE;\n\t}\n\t\n\treturn array('bool'=>$bool_result, 'requiredfields'=>$empty_fields);\n\t\t\n}", "function validate($data = false) {\n\t\tif ($data === false) {\n\t\t\tfix_POST_slashes();\n\t\t\t$data = $_POST;\n\t\t}\n\t\t$this->valid = true;\n\t\tforeach ($this->fields as $field) {\n\t\t\t# make sure the field is not missing\n\t\t\tif ($field->is_required() and (!isset($data[$field->get_var_name()]) or $data[$field->get_var_name()] === \"\")) {\n\t\t\t\t# field is missing\n\t\t\t\t$field->add_status(FH_Statuses::MISSING);\n\t\t\t\t$this->add_message(\"Missing field \" . $field->get_label(), $field);\n\t\t\t\t$this->valid = false;\n\t\t\t} else {\n\t\t\t\t$value = $data[$field->get_var_name()];\n\t\t\t\t# lets make sure the value is correct\n\t\t\t\t# some filters taken from\n\t\t\t\t# http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/\n\t\t\t\t\n\t\t\t\t# If this is a multiple value field then we need to test each value\n\t\t\t\tif ($field->get_multiple_values() and gettype($value) == \"array\") {\n\t\t\t\t\t# need to loop through the values\n\t\t\t\t\tfor ($i = 0; $i < sizeof($value); $i++) {\n\t\t\t\t\t\t$subvalue = $value[$i];\n\t\t\t\t\t\tif ($field->is_required() and $subvalue === \"\") {\n\t\t\t\t\t\t\t# field is missing\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::MISSING, $i);\n\t\t\t\t\t\t\t$this->add_message(\"Missing field \" . $field->get_label(), $field, $i);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($field->get_format() == FH_Formats::DATE) {\n\t\t\t\t\t\t\tif (preg_match(\"/^(\\d{1,2})[\\/\\.\\-](\\d{1,2})[\\/\\.\\-](\\d{2,4})$/\", $subvalue, $matches)) {\n\t\t\t\t\t\t\t\t$subvalue = $matches[1] . \"/\" . $matches[2] . \"/\" . $matches[3];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" needs to be in format m/d/yyyy\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::PRICE) {\n\t\t\t\t\t\t\t$subvalue = floatval(preg_replace(\"/[^\\-\\d\\.]/\",\"\", $subvalue));\n\t\t\t\t\t\t\t#$subvalue = number_format($subvalue, 2);\n\t\t\t\t\t\t\t# Having a value of 0 or less is not necessarily an invalid number, this should be checked by min max\n\t\t\t\t\t\t\tif (false and $value <= 0) {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then 0\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::CURRENCY) {\n\t\t\t\t\t\t\t$subvalue = floatval(preg_replace(\"/[^\\-\\d\\.]/\",\"\", $subvalue));\n\t\t\t\t\t\t\t$subvalue = money_format($subvalue,2);\n\t\t\t\t\t\t\t# Having a value of 0 or less is not necessarily an invalid number, this should be checked by min max\n\t\t\t\t\t\t\tif (false and $value <= 0) {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then 0\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::STATE) {\n\t\t\t\t\t\t\tif (preg_match(\"/^\\w\\w$/\", $subvalue, $matches)) {\n\t\t\t\t\t\t\t\t$subvalue = strtoupper($subvalue);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" 2 letters\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::ZIP) {\n\t\t\t\t\t\t\tif (preg_match(\"/^(\\d\\d\\d\\d\\d)/\", $subvalue, $matches)) {\n\t\t\t\t\t\t\t\t$subvalue = $matches[1];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" 5 digit zip code\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::EMAIL) {\n\t\t\t\t\t\t\t#if (eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $subvalue) {\n\t\t\t\t\t\t\tif (filter_var($subvalue, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t\t\t\t$subvalue = strtolower($subvalue);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$subvalue = strtolower(preg_replace(\"/[\\s]/\", \"\", $subvalue));\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a valid email\", $field, $i);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($field->get_format() == FH_Formats::PHONE) {\n\t\t\t\t\t\t\t# OLD match string, need to have a better phone format function\n\t\t\t\t\t\t\t#if (preg_match('/\\(?\\d{3}\\)?[-\\s.]?\\d{3}[-\\s.]\\d{4}/x', $subvalue)) {\n\t\t\t\t\t\t\tif (preg_match('/\\d{3}-\\d{3}-\\d{4}/', $subvalue)) {\n\t\t\t\t\t\t\t\t$subvalue = strtolower($subvalue);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$tmpValue = strtolower(preg_replace(\"/[\\s\\D]/\", \"\", $subvalue));\n\t\t\t\t\t\t\t\tif (preg_match('/^(\\d{3})(\\d{3})(\\d{4})$/', $tmpValue, $match)) {\n\t\t\t\t\t\t\t\t\t$subvalue = $match[1] . \"-\" . $match[2] . \"-\" . $match[3];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a phone number in the form 999-999-9999\", $field, $i);\n\t\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($field->is_numeric()) {\n\t\t\t\t\t\t\t# we need to make sure that this is a number\n\t\t\t\t\t\t\tif (!is_numeric($subvalue)) {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a number\", $field, $i);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!is_null($field->get_min()) and $field->get_min() != '') { \n\t\t\t\t\t\t\t\tif ($field->get_value() < $field->get_min()) {\n\t\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then or equal to \" . $field->get_min(), $field, $i);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!is_null($field->get_max()) and $field->get_min() != '') { \n\t\t\t\t\t\t\t\tif ($field->get_value() > $field->get_max() and $field->get_max() != '') {\n\t\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR, $i);\n\t\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be less then or equal to \" . $field->get_max(), $field, $i);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$value[$i] = $subvalue;\n\t\t\t\t\t}\n\t\t\t\t\t$field->set_value($value);\n\t\t\t\t} else {\n\t\t\t\t\tif ($field->get_format() == FH_Formats::DATE) {\n\t\t\t\t\t\tif (preg_match(\"/^(\\d{1,2})[\\/\\.\\-](\\d{1,2})[\\/\\.\\-](\\d{2,4})$/\", $value, $matches)) {\n\t\t\t\t\t\t\t$value = $matches[1] . \"/\" . $matches[2] . \"/\" . $matches[3];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" needs to be in format m/d/yyyy\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::PRICE) {\n\t\t\t\t\t\t$value = floatval(preg_replace(\"/[^\\-\\d\\.]/\",\"\", $value));\n\t\t\t\t\t\t#$value = number_format($value, 2);\n\t\t\t\t\t\t# Having a value of 0 or less is not necessarily an invalid number, this should be checked by min max\n\t\t\t\t\t\tif (false and $value <= 0) {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then 0\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::CURRENCY) {\n\t\t\t\t\t\t$value = floatval(preg_replace(\"/[^\\-\\d\\.]/\",\"\", $value));\n\t\t\t\t\t\t$value = money_format($value,2);\n\t\t\t\t\t\tif (false and $value <= 0) {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then 0\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::STATE) {\n\t\t\t\t\t\tif (preg_match(\"/^\\w\\w$/\", $value, $matches)) {\n\t\t\t\t\t\t\t$value = strtoupper($value);\n\t\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" 2 letters\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::ZIP) {\n\t\t\t\t\t\tif (preg_match(\"/^(\\d\\d\\d\\d\\d)/\", $value, $matches)) {\n\t\t\t\t\t\t\t$value = $matches[1];\n\t\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" 5 digit zip code\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::EMAIL) {\n\t\t\t\t\t\t#if (eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $value) {\n\t\t\t\t\t\tif (filter_var($value, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t\t\t$value = strtolower($value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$value = strtolower(preg_replace(\"/[\\s]/\", \"\", $value));\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a valid email\", $field);\n\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t} else if ($field->get_format() == FH_Formats::PHONE) {\n\t\t\t\t\t\t# OLD match string, need to have a better phone format function\n\t\t\t\t\t\t#if (preg_match('/\\(?\\d{3}\\)?[-\\s.]?\\d{3}[-\\s.]\\d{4}/x', $value)) {\n\t\t\t\t\t\tif (preg_match('/\\d{3}-\\d{3}-\\d{4}/', $value)) {\n\t\t\t\t\t\t\t$value = strtolower($value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$tmpValue = strtolower(preg_replace(\"/[\\s\\D]/\", \"\", $value));\n\t\t\t\t\t\t\tif (preg_match('/^(\\d{3})(\\d{3})(\\d{4})$/', $tmpValue, $match)) {\n\t\t\t\t\t\t\t\t$value = $match[1] . \"-\" . $match[2] . \"-\" . $match[3];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a phone number in the form 999-999-9999\", $field);\n\t\t\t\t\t\t\t\t$this->valid = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$field->set_value($value);\n\t\t\t\t\t}\n\t\t\t\t\tif ($field->is_numeric()) {\n\t\t\t\t\t\t# we need to make sure that this is a number\n\t\t\t\t\t\tif (!is_numeric($value)) {\n\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be a number\", $field);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_null($field->get_min()) and $field->get_min() != '') { \n\t\t\t\t\t\t\tif ($field->get_value() < $field->get_min()) {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be greater then or equal to \" . $field->get_min(), $field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_null($field->get_max()) and $field->get_min() != '') { \n\t\t\t\t\t\t\tif ($field->get_value() > $field->get_max() and $field->get_max() != '') {\n\t\t\t\t\t\t\t\t$field->add_status(FH_Statuses::ERROR);\n\t\t\t\t\t\t\t\t$this->add_message(\"ERROR field \" . $field->get_label() . \" must be less then or equal to \" . $field->get_max(), $field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function checkInput($fields = '')\n {\n if($fields == '*') return false;\n $this->describeTable();\n\n //$fields = explode(', ', $fields);\n $fields = preg_split('/ ?[,|] ?/', $fields);\n\n $arr = [];\n foreach($fields as $f)\n {\n if(!in_array($f, $this->tableFields))\n {\n continue;//just remove unsafe fields\n }\n else\n {\n $arr[] = $f;\n }\n }\n return (!empty($arr)) ? implode(',' , $arr) : false;\n }", "private function validatePaymentFields(){\n }", "function ValidateData()\n\t\t{\n\t\t\t$theValidator = new CValidator();\n\t\t\tif(!$this->arrValidator || !is_array($this->arrValidator) )\n\t\t\t{\n\t\t\t\t$this->arrValidator = array();\n\t\t\t}\n\t\t\tforeach($this->arrValidator as $key=>$value)\n\t\t\t{\n\t\t\t\tif($this->$key == '')\n\t\t\t\t{\n\t\t\t\t\t// Kiem tra xem co phai bat buoc khong?\n\t\t\t\t\tif(isset($this->arrRequired[$key]) && ($this->arrRequired[$key] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$theValidator->CheckPatt($value, $this->$key))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "public function validation() {\r\n return array(\r\n array(\r\n 'jenis_pelanggaran,sanksi_pelanggaran,poin_pelanggaran', 'required',\r\n \r\n ),\r\n \r\n \r\n array(\r\n 'poin_pelanggaran','numeric',\r\n ),\r\n );\r\n }", "function fieldsEmpty() {\n if(empty($_POST['title']) || empty($_POST['date']) || empty($_POST['location'])) {\n return true;\n } else {\n return false;\n }\n}", "public function test_array_returns_false_when_not_optional_and_input_null() {\n\t\t$optional = false;\n\n\t\t$result = self::$validator->validate( null, $optional );\n\t\t$this->assertFalse( $result );\n\t}", "function ywccp_get_array_validation_field(){\r\n\t\treturn apply_filters( 'ywccp_validation_field_options_array', array(\r\n\t\t\t'' => __( 'No validation', 'yith-woocommerce-checkout-manager' ),\r\n\t\t\t'postcode' => __( 'PostCode', 'yith-woocommerce-checkout-manager' ),\r\n\t\t\t'phone' => __( 'Phone', 'yith-woocommerce-checkout-manager' ),\r\n\t\t\t'email' => __( 'Email', 'yith-woocommerce-checkout-manager' ),\r\n\t\t\t'state' => __( 'State', 'yith-woocommerce-checkout-manager' ),\r\n\t\t\t'vat' => __( 'VAT', 'yith-woocommerce-checkout-manager' )\r\n\t\t));\r\n\t}", "public function validateForm(){\n foreach(self::$fields as $field){\n if(!array_key_exists($field, $this->data)){\n trigger_error(\"$field is not presented in data\");\n return;\n } \n }\n $this->validateUsername();\n $this->validatePassword();\n $this->validateEmail();\n $this->validateFullname();\n return $this->errors;\n }", "public function validateField()\n\t{\n\t\t$error = [];\n\t\t$error_flag = false;\n\n\t\tif ($this->commons->validateText($this->url->post('contact')['company'])) {\n\t\t\t$error_flag = true;\n\t\t\t$error['author'] = 'Item Rate!';\n\t\t}\n\n\t\tif ($error_flag) {\n\t\t\treturn $error;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function tower_form_errors($data, $fields=[]) {\n $form_errors = [];\n foreach ($fields as $field) {\n $rules = explode('|', $field['rules']);\n $field_is_valid = true;\n $field_name = $field['name'];\n $value = trim(sanitize_text_field($data->get_param($field_name)));\n\n foreach ($rules as $rule) {\n if (! $field_is_valid) break;\n\n switch ($rule) {\n case 'email':\n if (! filter_var($value, FILTER_VALIDATE_EMAIL)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'Enter a valid email address';\n }\n break;\n\n case 'number':\n if (! is_numeric($value)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field needs to be numeric';\n }\n break;\n\n case 'required':\n if ($value == '') {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field is required';\n }\n break;\n\n case 'unique':\n // check DB for meta-value duplicate entry\n global $wpdb;\n $row_count = $wpdb->get_var(\"\n SELECT COUNT(`meta_id`)\n FROM {$wpdb->postmeta} \n WHERE `meta_key` = '{$field_name}' \n AND `meta_value` = '{$value}'\n \");\n if ($row_count > 0) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This value already exists. Please select another';\n }\n break;\n }\n }\n }\n return $form_errors;\n}", "static function valid_config_fields($array)\n {\n return isset($array['host']) && isset($array['db'])\n && isset($array['dbuser']) && isset($array['dbpass'])\n && isset($array['site-name']) && isset($array['copyright'])\n && isset($array['google']) && (count($array) === 7);\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t'gm_id' => array(\n\t\t\t\tarray('not_empty')\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\tarray('not_empty')\n\t\t\t)\n\t\t);\n\t}", "public function getValidation()\r\n {\r\n return [\r\n 'file' => 'required',\r\n 'slider_id' => 'required',\r\n ];\r\n }", "function validateColums($POST) {\n if (isset( $POST['sName'] ) )\n return true;\n\n if ( (!isset($POST['label'])) &&\n (!isset($POST['asset_no'])) &&\n (!isset($POST['has_problems'])) &&\n (!isset($POST['comment'])) &&\n (!isset($POST['runs8021Q'])) &&\n (!isset($POST['location'])) &&\n (!isset($POST['MACs'])) &&\n (!isset($POST['label'])) &&\n (!isset($POST['attributeIDs'])) ) {\n return true;\n }\n\n}", "public function test_array_returns_true_when_optional_and_input_empty() {\n\t\t$optional = true;\n\n\t\t$result = self::$validator->validate( null, $optional );\n\t\t$this->assertTrue( $result );\n\t}", "public function validate ()\n {\n $errorCount = 0;\n\n foreach ($this->arrFieldMapping as $fieldName => $arrField) {\n if ( $arrField['required'] === 'true' )\n {\n $accessor = $this->arrFieldMapping[$fieldName]['accessor'];\n\n if ( trim ($this->$accessor ()) == \"\" )\n {\n $this->validationFailures[] = $fieldName . \" Is empty. It is a required field\";\n $errorCount++;\n }\n }\n }\n\n if ( $errorCount > 0 )\n {\n return false;\n }\n\n return true;\n }", "public function validate(){\n $valid = true;\n foreach($this->fields as $field){\n if(!$field->validate()) $valid = false;\n }\n $this->setIsValid($valid);\n return $valid;\n }", "public static function checkData($data) {\n $errors=[];\n\n // Liste de champs obligatoires\n $mandatoryFields=[\n 'title' => \"Veuillez saisir un titre pour le nouveau quiz\",\n 'description' => \"Veuillez décrire le nouveau quiz\",\n ];\n\n foreach ($mandatoryFields as $fieldName => $msg) {\n\n // on vérifie les champs obligatoires\n if (empty($data[$fieldName])) {\n\n //erreur, le champ est vide!\n $errors[]=$msg;\n }\n\n return $errors;\n }\n\n }", "static function checkForEmptyFields($fieldnames = array()) {\n\n $failure = false;\n foreach ($fieldnames as $fieldname) {\n $test = getInput($fieldname);\n if (!$test) {\n $failure = true;\n new SystemMessage($fieldname . \" can't be left empty\");\n }\n }\n if ($failure) {\n forward();\n }\n }", "function filled_out($forms){\n\t\tforeach ($forms as $key => $value) {\n\t\t\tif( (!isset($key)) || ($value == '') ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function hasRequiredFields()\n {\n // If any of our fields are empty, reject stuff\n $all_fields_found = true;\n $field_list = array(\n 'email',\n 'password',\n 'password2',\n 'first_name',\n 'last_name',\n 'speaker_info'\n );\n\n foreach ($field_list as $field) {\n if (!isset($this->_data[$field])) {\n $all_fields_found = false;\n break;\n }\n }\n\n return $all_fields_found;\n }", "private function ignoreBlankValueFields($data){\n $arrData = array();\n if(!is_array($data)) return false;\n foreach($data as $valData => $value){\n if($value){\n foreach($value as $valSubKey => $val){\n if(trim($val) != \"\") $arrData[$valData][$valSubKey] = $val;\n }\n }\n }\n return $arrData;\n }", "public function valid()\n {\n\n if (strlen($this->container['company_name']) > 254) {\n return false;\n }\n if (strlen($this->container['company_name']) < 0) {\n return false;\n }\n if ($this->container['firstname'] === null) {\n return false;\n }\n if (strlen($this->container['firstname']) > 255) {\n return false;\n }\n if (strlen($this->container['firstname']) < 0) {\n return false;\n }\n if ($this->container['lastname'] === null) {\n return false;\n }\n if (strlen($this->container['lastname']) > 255) {\n return false;\n }\n if (strlen($this->container['lastname']) < 0) {\n return false;\n }\n if ($this->container['street'] === null) {\n return false;\n }\n if (strlen($this->container['street']) > 254) {\n return false;\n }\n if (strlen($this->container['street']) < 3) {\n return false;\n }\n if ($this->container['post_code'] === null) {\n return false;\n }\n if (strlen($this->container['post_code']) > 40) {\n return false;\n }\n if (strlen($this->container['post_code']) < 2) {\n return false;\n }\n if ($this->container['city'] === null) {\n return false;\n }\n if (strlen($this->container['city']) > 99) {\n return false;\n }\n if (strlen($this->container['city']) < 2) {\n return false;\n }\n if ($this->container['country_code'] === null) {\n return false;\n }\n if (strlen($this->container['country_code']) > 2) {\n return false;\n }\n if (strlen($this->container['country_code']) < 0) {\n return false;\n }\n if (strlen($this->container['telephone']) > 99) {\n return false;\n }\n if (strlen($this->container['telephone']) < 0) {\n return false;\n }\n return true;\n }", "function validateArrayValue($val) {\n\t\tif(!is_array($val)) return false;\n\t\t\n\t\t// Validate against Zend_Date,\n\t\t// but check for empty array keys (they're included in standard form submissions)\n\t\treturn (\n\t\t\tarray_key_exists('year', $val) \n\t\t\t&& (!$val['year'] || Zend_Date::isDate($val['year'], 'yyyy', $this->locale))\n\t\t\t&& array_key_exists('month', $val)\n\t\t\t&& (!$val['month'] || Zend_Date::isDate($val['month'], 'MM', $this->locale))\n\t\t\t&& array_key_exists('day', $val)\n\t\t\t&& (!$val['day'] || Zend_Date::isDate($val['day'], 'dd', $this->locale))\n\t\t);\n\t}", "public function validate(): array {\n $errors = [];\n if (!Validation::str_longer_than($this->get_title(), 2)) {\n $errors[] = \"Title must be at least 3 characters long\";\n }\n if(!$this->title_is_unique()){\n $errors[] = \"Title already exists in this board\";\n }\n if(is_null($this->get_column()) ){\n $errors[] = \"This column does not exist\";\n }\n return $errors;\n }", "function form_check() {\n\tglobal $cert_amt_tbl;\n\t\n\t// required fields array\n\t$required_fields = array('Discount Amount'=> $cert_amt_tbl->discount_amount);\n\t\t\n\t// check error values and write error array\t\t\t\t\t\n\tforeach($required_fields as $field_name => $output) {\n\t if (empty($output)) {\n\t\t$errors_array[] = $field_name;\n\t }\n\t}\n\t\n\tif (!empty($errors_array)) {\n\t $error_message = 'You did not supply a value for these fields: ' . implode(', ',$errors_array);\n\t}\n\t\n return $error_message;\n }", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "public function validate($fields)\n {\n foreach ($fields as $key => $value) {\n foreach (explode('|', $this->rules[$key]) as $rule) {\n switch ($rule) {\n case 'email':\n if (!empty($value) and !filter_var($value,\n FILTER_VALIDATE_EMAIL)\n ) {\n $_SESSION['error_msg'][]\n = 'Insira um E-mail válido ([email protected])';\n }\n break;\n case 'not_empty':\n if (empty($value)) {\n if ($key == \"name\") {\n $_SESSION['error_msg'][] = 'Insira um Nome';\n } else {\n if ($key == 'password') {\n $_SESSION['error_msg'][]\n = 'Insira uma Senha';\n } else {\n if ($key == \"password2\") {\n $_SESSION['error_msg'][]\n = 'Re-insira a Senha escolhida';\n } else {\n if ($key == 'email') {\n $_SESSION['error_msg'][]\n = 'Insira um E-mail válido';\n }\n }\n }\n }\n\n }\n break;\n }\n }\n }\n if (isset ($_SESSION['error_msg'])) {\n return false;\n }\n return true;\n }", "function filter_field() {\n $data['email'] = addslashes(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL));\n $data['username'] = addslashes(filter_var($_POST['username'], FILTER_SANITIZE_STRING));\n $data['password'] = addslashes(strip_tags($_POST['password']));\n $data['name'] = addslashes(filter_var($_POST['name'], FILTER_SANITIZE_STRING));\n $data['surname'] = addslashes(filter_var($_POST['surname'], FILTER_SANITIZE_STRING));\n \n if(isset($_POST['bio']))\n $data['bio'] = addslashes(filter_var($_POST['bio'], FILTER_SANITIZE_STRING));\n else\n $data['bio'] = null;\n\n foreach ($data as $key => $value) {\n if($value != null && $value === false)\n launch_error(\"Problem with your data, try changing them.\");\n }\n\n return $data;\n}", "function checkFields($fillable)\n {\n $fillable = array_merge(array('created_at','updated_at'),$fillable); //always include\n if(count($fillable)>0) {\n foreach ($this->posted as $key => $value) {\n if (!in_array($key, $fillable)) {\n $this->setError(\"$key is not allowed to be in the database. Please adjust the database accordingly.\");\n }\n }\n if (count($this->errors) > 0) {\n return false;\n }\n }\n return true;\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t//array('email,username', 'required'),\n\t\t\tarray('email', 'checkEmail'),\n array('username', 'check_username'),\n\t\t\tarray('username', 'checkEmptyValue'),\n\t\t);\n\t}", "function validate_form_fields($array = NULL, $update = false) {\n $fields = $this->load_required_fields($array, $update);\n\n if ($array == NULL)\n $array = $_POST;\n\n if (is_array($_FILES))\n $array = array_merge($array, $_FILES);\n\n //Mergin Array\n $group_fields = array_merge($fields, $this->load_other_fields());\n\n validate_cb_form($group_fields, $array);\n }", "public function rules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('tgl_awal,tgl_akhir', 'required'),\r\n\t\t);\r\n\t}", "function validatePos(){\n for ($i=0; $i<9; $i++){\n if( isset($_POST['year'.$i]) && isset($_POST['desc'.$i]) ) {\n if ( strlen ($_POST['year'.$i])<1 || strlen($_POST['desc'.$i])<1 ){\n $_SESSION['error']='All fields are required';\n return false;\n }\n else if( ! is_numeric($_POST['year'.$i])) {\n $_SESSION['error']=\"Year must be numeric\";\n return false;\n }\n }\n }\n return true;\n }", "static function all_Empty()\r\n {\r\n echo PageBuilder::printError(\"Please enter valid data in all the fields, nothing can not be empty.\");\r\n }", "public function validationCreate()\n\t{\n\t\t$validationCreate=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\tif($row['Extra']!=='auto_increment')\n\t\t\t{\n\t\t\t\t$validationCreate[]=array(\n\t\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t\t'maxlength'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t\t'required'=>$row['Null']=='NO' ? '\\'required\\'=>true,' : false,\n\t\t\t\t\t'email'=>preg_match('/email/',$row['Field']) ? '\\'email\\'=>true,' : false,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $validationCreate;\n\t}", "function validatePassengers($pas)\n{\n\tif (!is_array($pas) or empty($pas)) {\n\t\treturn false;\n\t}\n\tforeach ($pas as $p) {\n\t\tif (!is_array($p) or empty($p)) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach (array('first_name', 'last_name', 'seat') as $field) {\n\t\t\tif (!isset($p[$field])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "public function validationRules() {\n\t\treturn [\t \n\t\t\t'nom'=>'required',\n\t\t\t'enonce'=>'required',\n\t\t\t'sur'=>'required'\n\t];\t\n\t}" ]
[ "0.78867775", "0.72666657", "0.71082145", "0.7097243", "0.70896673", "0.7054567", "0.70306283", "0.7020883", "0.7005198", "0.70008737", "0.6985354", "0.69491005", "0.69177496", "0.6901748", "0.689425", "0.6859922", "0.6806142", "0.6797367", "0.6793119", "0.6784624", "0.6743106", "0.6738115", "0.6710613", "0.67031735", "0.6621493", "0.6612786", "0.6588505", "0.6582555", "0.6580929", "0.6575423", "0.65640944", "0.65615666", "0.6560127", "0.65482706", "0.6526002", "0.65134007", "0.6509574", "0.64799535", "0.6467432", "0.64534515", "0.64414763", "0.64297616", "0.6419281", "0.63974136", "0.63951826", "0.6369485", "0.63671327", "0.63650805", "0.63647485", "0.63490206", "0.6343509", "0.6343153", "0.6326616", "0.62904805", "0.6285971", "0.62854284", "0.627954", "0.62749165", "0.6273434", "0.6271665", "0.6263332", "0.62598336", "0.62551534", "0.6251017", "0.62497145", "0.62466615", "0.6242524", "0.6237629", "0.6229716", "0.62188596", "0.6215292", "0.6204142", "0.61986405", "0.6195789", "0.6190442", "0.6189812", "0.617854", "0.6176959", "0.6168331", "0.6167168", "0.6166682", "0.61451143", "0.61417764", "0.61416346", "0.61367196", "0.61320513", "0.6129964", "0.6128618", "0.61237466", "0.61220473", "0.61218476", "0.61206836", "0.6117955", "0.61124974", "0.61079854", "0.61039156", "0.6102237", "0.6099416", "0.6094626", "0.60924023" ]
0.68848586
15
echo 'Forget me not';
public function index($log_date = NULL){ // print_r(log_message('info','se ingresa dato al log')); //var_dump($this->session->userdata('NameUser')); $log_date = "2019-02-15"; $this->load->library('log_library'); if ($log_date == NULL) { // default: today $log_date = date('Y-m-d'); } $data['cols'] = $this->log_library->get_file('log-'. $log_date . '.php'); $data['log_date'] = $log_date; $this->load->view('log_view', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function howtoEat()\n {\n return \"Chicken could be fried!<br>\";\n }", "public function text()\n\t{\n\t\techo \"Hello there! I'm just an <code>echo</code> statement in a method...\";\n\t}", "public function swim(): void\r\n {\r\n echo \"\\nSwimming normally, as a human would do...\";\r\n }", "public function doNothing()\n\t{\n\t\treturn '';\n\t}", "protected function say($message = '')\n {\n $this->output->writeln($message);\n }", "public function say() {\r\n echo 'say something';\r\n }", "public function say()\n {\n echo \"I'am cat ...<br>\";\n }", "function echoit($string)\n{\n\techo $string;\n}", "function say_hello_loudly() {\n\techo \"HELLO PROGRAMMING WORLD!<br />\";\n}", "public static function message($string) \n {\n echo $string;\n\t\texit;\n }", "public function say()\n {\n echo \"I'am Dog <br>\";\n }", "function writeMessage() {\n echo \"You are really a nice person, Have a nice time!\"; \n}", "function greeting(){\n\t\t\techo \"Idol ni Noli si Pong\";\n\t\t}", "public function doNothing(): string\n {\n return '';\n }", "function WrightText() {\n echo \"Hello world!\".\"<br>\";\n}", "function hello (){\n echo 'hello, I am Jakodera'.'<br>';\n}", "function hello_world() {\n\techo '<div class=\"notice notice-info\"><p>Hello world</p></div>';\n}", "function xecho($text)\n\t{\n\t\tif($this->do_newlines)\n\t\t{\n\t\t\t$text .= \"\\n\";\n\t\t}\n\t\tif($this->do_queue)\n\t\t{\n\t\t\t$this->output_queue .= $text;\n\t\t}\n\t\tif($this->do_echo)\n\t\t{\n\t\t\techo $text;\n\t\t}\n\t\tif($this->do_return)\n\t\t{\n\t\t\treturn $text;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "function pied()\n\t{\n\t\techo \"\\t\".'</body>'.\"\\n\".'</html>';\n\t}", "public function cry()\n {\n echo \"Cat cry\";\n }", "public static function nop()\n {\n return \"NOP\\n\";\n }", "function reply($message) {\n echo $message;\n exit();\n }", "final function whatIsGood() {\n echo \"Running is good <br>\";\n }", "function echoMsg() {\n $a = \"primeira frase\";\n $b = \" depois de lavar a louça\";\n $c = \" e depois de amar<br>\";\n echo $a . $b . $c . PHP_EOL;\n}", "function upgrade_echo($message)\n{\n echo $message;\n // Flush the message, so that there's some progress information\n // output to the browser even when the upgrade is taking a while\n if (ob_get_length() !== FALSE)\n {\n ob_flush();\n }\n flush();\n}", "function printHelloMessage(){\n echo 'Hello! Welcome again!';\n}", "public function sing() {\n\t\techo $this->name . \" sings 'Bow wow, wooow, woooooooow' </br>\";\n\t}", "public function bye(){\n return \"Bye... $this->dialogue\";\n }", "protected function prompt($continue = false) {\n\t\tif($continue)\n\t\t\treturn '... ';\n\t\treturn 'echo$ ';\n\t}", "function output(string $string = null): void\n{\n echo $string . (PHP_SAPI === 'cli' ? \"\\r\\n\" : '<br/>');\n}", "function e($string, $return = false)\r\n\t{\r\n\t\tif($return)\r\n\t\t\treturn $string;\r\n\t\telse\r\n\t\t\techo($string);\r\n\t}", "final function what_is_good() {\n\t\t\techo \"Running is Good </br>\";\n\t\t}", "function put_success(string $message)\n{\n echo \"<aside class=\\\"notice success\\\">${message}</aside>\";\n}", "function errorMsgForClient()\n{\n // TELLS THE CUSTOMER ONLY WHAT HE NEEDS TO KNOW. NOT MORE. ( BOTH FOR SAFETY & ABSTRACTION)\n\n echo (\"The website is facing difficulty due to some technical issues. Our Engineers are working on it. Please come back later\");\n\n}", "function myText(){\n\t\n\n\techo '<h1>before subForums</h1>';\n\t\n\n}", "function say(){\n return \"hello world\";\n}", "protected function output($string) {\r\n if ($this->automaticRun) { \r\n $this->textReportContents .= $string;\r\n } else {\r\n echo $string;\r\n } \r\n}", "function sagHallo() {\n\t\treturn 'Hallo Welt!';\n\t}", "function output($str) {\r\n\techo \"$str \\n\";\r\n}", "function aboutMe(){\n return \"Hi my name is Ruby, I am a chatbot, nice to meet you\";\n}", "function aboutMe(){\n return \"Hi my name is Ruby, I am a chatbot, nice to meet you\";\n}", "public function honk() {\n return (\"\");\n }", "function test($message = null){\n\treturn \"Hello there, Welcome to the terminal test function. Everything seems to work fine. You passed the message \\\"$message\\\".\";\n}", "function echo2($str = '')\n{\n\techo $str . PHP_EOL;\n}", "public function onEcho()\n {\n return \"\";\n }", "public function show()\n {\n //\n return 'Rosie can i have a dance';\n }", "public function imATeapot()\n {\n return \"I'm a teapot.\";\n }", "function clranger_admin_notice ($message = false,$state = '') {\n if(!$message){return;}\n $html = <<<EOD\n <div class=\"$state dismiss\"><p>$message</p></div>\nEOD;\n echo $html;\n }", "function say_hello() {\n return \"Hello World\";\n }", "function echo_back($user_input){\n\n return \"This is soap server: you typed <b>\".$user_input.\"</b>.\";\n}", "function negrita($text){\r\n return \"<strong>$text</strong>\";\r\n }", "function success($msg) {\n if ($msg) {\n echo \" <div class=\\\"success\\\">\" . $msg . \"</div>\\n\";\n } else {\n echo \" <div class=\\\"success\\\">\" . _('Something has been successfully performed. What exactly, however, will remain a mystery.') . \"</div>\\n\";\n }\n}", "private function hello(){\n \techo str_replace(\"this\",\"that\",\"HELLO WORLD!!\");\n \t\t}", "public function dress()\n {\n echo 'dresses suit'.PHP_EOL;\n }", "public function output_text( $text = '' ){\n\t\t echo $text;\n\t }", "public function turnOff(){\n\t\treturn \"Turn Off executed\";\n\t}", "function e($text) {\n\t\techo $text;\n\t}", "function redeem() {\n echo \"Hello, PHP!\";\n }", "function myfunction()\n{\n\techo 'hello world' . '<br/>';\n}", "public function output($text)\n {\n echo $text;\n }", "public function display()\n {\n return 'I am a mallard duck';\n }", "function println($string) {\n\techo $string . \"\\n\";\n}", "public function show()\n {\n echo 1;die;\n }", "function say_hello($name){\n\techo \"<p>Hello $name!</p>\";\n\techo '<hr>';\n}", "public function locomover()\n {\n echo \"<p>Voando</p>\";\n }", "function showMessage($text) {\n\t\techo '<script language=javascript>\n\t\t\t\t\t\talert(\\''.$text.'\\')\n\t\t\t\t\t</script>';\n\t}", "function ob_echo($echo, $silent = false){ if (!$silent){ echo($echo.PHP_EOL); } ob_flush(); }", "function output($str)\n{\n echo \"* $str\\n\";\n}", "function output($str)\n{\n echo \"* $str\\n\";\n}", "function echo_($s) {\n if ($s === \"err\") {\n throw new BarristerRpcException(99, \"Error!\");\n }\n else {\n return $s;\n }\n }", "static function sendout($output){\n\t\tif(Config::$x['inScript']){\n\t\t\techo $output;\n\t\t}else{\n\t\t\techo '<pre>'.$output.'</pre>';\n\t\t}\n\t}", "function printSaying() {\n\n //show the view\n echo Template::instance()->render('views/saying.php');\n }", "final public function sayHello(){\r\n echo \"Hello from Foo\";\r\n }", "protected function enjoyVacation()\n {\n echo \"Coding, eating, sleeping\";\n // TODO: Implement enjoyVacation() method.\n }", "function sayHello($name)\n{\n\techo \"Hello \". $name. \" ,How are you? <br>\";\n}", "function chuiNiu()\n{\n\techo '谁喜欢吹牛,爱谁谁<br>';\n}", "function hamtinhtong(){\n echo \"neu thay dong nay la ok r\";\n $a = 'hello';\n $b = ' Nguyen Hong Son';\n echo \"<br>\" . $a . $b;\n}", "function print_learner_cta(){\r\n\techo '<div class=\"cta-learner\"><p>Have a student account?</p>\r\n\t\t<div><a class=\"btn btn-lg\" href=\"http://speakagent.github.io\">Play Now! <i class=\"fa fa-caret-right\"></i></a></div></div>';\r\n}", "public function sayHello(){\n return \"Hello World!\"; // baru mengembalikan nilai\n }", "public function sit()\n {\n echo 'Dog sit.';\n }", "function EchoDOMSuccess($innerTEXT)\n{\n echo (\"<div class=\\\"alert alert-success\\\">$innerTEXT</div>\");\n}", "function noEventsMsg() {\r\n\techo <<<noevents\r\n\t<div class='wrapper wide topmargin'>\r\n\t\t<h1 class='center'>It seems like you don't have any events added!</h1><br />\r\n\t\t<h1 class='center'>Return to Menu to create an event.</h1><br />\r\n\t\t<div class='center'>\r\n\t\t\t<a href='menu.php' class='btn btn-large btn-primary'>Back to Menu</a>\r\n\t\t</div>\r\n\t\t\r\n\t</div>\r\nnoevents;\r\n\tdie();\r\n}", "function print_msg($msg) {\n if ( php_sapi_name() == 'cli' ) {\n $msg = preg_replace('#<br\\s*/>#i', \"\\n\", $msg);\n $msg = preg_replace('#<h1>#i', '== ', $msg);\n $msg = preg_replace('#</h1>#i', ' ==', $msg);\n $msg = preg_replace('#<h2>#i', '=== ', $msg);\n $msg = preg_replace('#</h2>#i', ' ===', $msg);\n $msg = strip_tags($msg) . \"\\n\";\n }\n print $msg;\n}", "function phpfmg_auto_response_message(){\r\n ob_start();\r\n?>\r\n\r\n<?php\r\n $msg = ob_get_contents() ;\r\n ob_end_clean();\r\n return trim($msg);\r\n}", "function mvcshell_print($content)\n{\n die(\"Midgard MVC shell\\n\\n{$content}\\n\");\n}", "public function Locomover()\n {\n echo \"<br>Saltando\";\n }", "function print_msg($msg) {\n if (php_sapi_name() == 'cli') {\n $msg = preg_replace('#<br\\s*>#i', \"\\n\", $msg);\n $msg = preg_replace('#<h1>#i', '== ', $msg);\n $msg = preg_replace('#</h1>#i', ' ==', $msg);\n $msg = preg_replace('#<h2>#i', '=== ', $msg);\n $msg = preg_replace('#</h2>#i', ' ===', $msg);\n $msg = strip_tags($msg) . \"\\n\";\n }\n print $msg;\n}", "public static function ping()\n {\n return \"PING\\n\";\n }", "function unknown_action(){\n echo \"Something terrible happened!\";\n nl2br (\"\\n\");\n echo \"<a href=\\\"./game.php?action=logout\\\">\";\n echo \"Logout?\";\n echo \"</a>\";\n}", "function simpleFunction(){\r\n echo 'Hello World'.'<br>';\r\n }", "public function print(){\n \t\techo 'hello';\n }", "function secho($code)\n{\n\techo \"<p>$code</p>\";\n}", "final function screen(){\n echo \"This is a final keyword display\";\n }", "protected function _doEcho($new = true)\n\t{\n\t\tif (!$this->_silent) {\n\n\t\t\t$nukeString = '';\n\t\t\tif ($this->_nuked !== false) {\n\t\t\t\tswitch((int)$this->_curPre['nuked']) {\n\t\t\t\t\tcase \\PreDb::PRE_NUKED:\n\t\t\t\t\t\t$nukeString = '[ NUKED ] ';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \\PreDb::PRE_UNNUKED:\n\t\t\t\t\t\t$nukeString = '[UNNUKED] ';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \\PreDb::PRE_MODNUKE:\n\t\t\t\t\t\t$nukeString = '[MODNUKE] ';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \\PreDb::PRE_OLDNUKE:\n\t\t\t\t\t\t$nukeString = '[OLDNUKE] ';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \\PreDb::PRE_RENUKED:\n\t\t\t\t\t\t$nukeString = '[RENUKED] ';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$nukeString .= '[' . $this->_curPre['reason'] . '] ';\n\t\t\t}\n\n\t\t\techo\n\t\t\t\t'[' .\n\t\t\t\tdate('r') .\n\t\t\t\t($new ? '] [ Added Pre ] [' : '] [Updated Pre] [') .\n\t\t\t\t$this->_curPre['source'] .\n\t\t\t\t'] ' .\n\t\t\t\t $nukeString .\n\t\t\t\t'[' .\n\t\t\t\t$this->_curPre['title'] .\n\t\t\t\t']' .\n\t\t\t\t(!empty($this->_curPre['category'])\n\t\t\t\t\t? ' [' . $this->_curPre['category'] . ']'\n\t\t\t\t\t: (!empty($this->_oldPre['category'])\n\t\t\t\t\t\t? ' [' . $this->_oldPre['category'] . ']'\n\t\t\t\t\t\t: ''\n\t\t\t\t\t)\n\t\t\t\t) .\n\t\t\t\t(!empty($this->_curPre['size']) ? ' [' . $this->_curPre['size'] . ']' : '') .\n\t\t\t\tPHP_EOL;\n\t\t}\n\t}", "function my_menu_output(){\n\techo '<h1>The Hello Yoda Plugin by Alan</h1>\n\t<p>\"Pass on what you have learned.\" --Yoda </p>';\n}", "function METHOD_hello()\n {\n $this->sendTerminal('This is a Hello World :)');\n\n }", "function refus($msg) {\n echo \"<b><font color=red>$msg</font></b><br>\";\n echo \"Action non commenc�e; rectifier les conditions initiales avant de reprendre<br>\";\n}", "public function thankyou_page() {\r\n if ( $this->instructions )\r\n echo wpautop( wptexturize( $this->instructions ) );\r\n }", "function alert($text) {\n\t\t\techo '<script type=\"text/javascript\">alert(\"' . $text . '\");</script>';\n\t\t}", "function messageTask($fullName, $id, $language, $validEmail){\n echo \"Hello World, this is $fullName with HNGi7 ID $id and email $validEmail using $language for stage 2 task\" ;\n\n //echoing the text\n\n //Hello World, this is Elisha Simeon Ukpong Udoh with HNGi7 ID HNG-01827 and email [email protected] using python for stage 2 task\n\n }", "function different_user()\n{\n echo <<<_END\n </br>OOPS !!!!!!\n </br>Error occured \n </br>Please try again\n </br>\n _END;\n echo \"Please <a href='midtermadmin.php'>click here to log in again </a> to log in.\";\n}" ]
[ "0.65085953", "0.6457918", "0.6338499", "0.6200309", "0.6177734", "0.61689496", "0.61443996", "0.6141387", "0.6087079", "0.6067416", "0.60364753", "0.6033251", "0.59969", "0.59690326", "0.5954086", "0.5920986", "0.5911295", "0.58960485", "0.5880785", "0.5876265", "0.5853118", "0.5850726", "0.58468294", "0.5836667", "0.5833015", "0.58325374", "0.58215207", "0.57994014", "0.57953024", "0.5794225", "0.5792992", "0.5791046", "0.5790522", "0.57731223", "0.57685846", "0.5740533", "0.57295424", "0.57209134", "0.5691768", "0.5674963", "0.5674963", "0.5674879", "0.567416", "0.56735253", "0.5672644", "0.5667362", "0.56650025", "0.56593955", "0.5659355", "0.5649581", "0.56206864", "0.5616541", "0.5609457", "0.56058466", "0.5603149", "0.559982", "0.55946267", "0.55912477", "0.55901736", "0.5587192", "0.55870986", "0.5585843", "0.5585532", "0.55805117", "0.55672747", "0.5558903", "0.55560726", "0.5544877", "0.5544877", "0.5532356", "0.5521484", "0.551021", "0.5497093", "0.5495444", "0.54945946", "0.5490505", "0.5478358", "0.5467808", "0.54649615", "0.5445359", "0.5444097", "0.544117", "0.5429195", "0.5428419", "0.5427593", "0.54267204", "0.54189056", "0.54184294", "0.54162514", "0.5408519", "0.54049474", "0.5403829", "0.5401458", "0.53957903", "0.53921163", "0.5381056", "0.5373559", "0.53693044", "0.53650767", "0.5362106", "0.5361777" ]
0.0
-1
Run the database seeds.
public function run() { $levels = collect([ 'Dalam proses' => 1, 'C' => 2, 'B' => 3, 'A' => 4, 'Follow Up' => 5, 'Proses Ulang' => 6, ]); $levels->each(function ($item, $key) { \App\SchoolLevel::where('name', $key)->update(['order' => $item]); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Read all category endpoints to extract products endpoints.
public function read(\Traversable $categoryEndpoints) :array { $this->productsEndpoints = []; foreach($categoryEndpoints as $endpoint){ /** @var Endpoint $endpoint */ $this->firstPage = $this->currentPage = $this->lastPage = 1; $this->style->text(vsprintf('Reading <info>products endpoints</info> from <info>%s</info>', [$endpoint->getEndpoint()])); do { // Call client endpoint $rawData = $this->client->get($endpoint->getEndpoint(), ['page' => $this->currentPage]); $endpoint->setIsChecked(true); $endpoint->setLastCheck(time()); $this->entityManager->persist($endpoint); $this->extractPagination($rawData); $this->extractProductsEndpoints($rawData); if ($this->firstPage == $this->currentPage) $this->style->progressStart($this->lastPage); $this->style->progressAdvance(); $this->currentPage++; if ( $this->currentPage > $this->currentPage ) $this->style->progressFinish(); } while ($this->currentPage <= $this->lastPage); $this->entityManager->flush(); $this->style->text('<info>Ok</info>'); } $this->entityManager->flush(); $this->entityManager->clear(); return $this->productsEndpoints; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getEndpoints();", "public static function route_products_and_categories()\n\t{\n\t\tforeach(ORM::factory('product')->find_all() as $object)\n\t\t{\n\t\t\tKohana::config_set('routes.' . $object->show_path(false), inflector::plural($object->object_name) . '/show/' . $object);\n\t\t}\n\t\t\n\t\tforeach(ORM::factory('category')->find_all() as $object)\n\t\t{\n\t\t\tKohana::config_set('routes.' . $object->show_path(false), inflector::plural($object->object_name) . '/show/' . $object);\n\t\t}\n\t}", "private function loadEndpoints() {\n $this->endpoints = array(\n '2020-08-06' => array(\n 'base_api_endpoint' => 'https://cloudapi.inflowinventory.com/',\n 'categories' => $this->companyID . '/categories/'\n )\n );\n }", "public function index()\n {\n return ProductResource::collection(Product::with('categories')->get());\n }", "public function index()\n {\n return ProductCategoryResource::collection(ProductCategory::all());\n }", "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "public function getAllProducts( $params = [] )\n {\n if(!config(\"constant.getDataFromApis\")){\n return $this->starrtecUnifiedPosHandler->getCategoryProducts( $params );\n }else{\n return $this->starrtecPosApiHandler->getCategoryProducts( $params );\n }//..... end if-else() .....//\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "public function all(){\n \t\t$response = $this->curl->get( $this->api_url, [ \n\t\t\t'access_token' => $this->token\n\t\t]);\n\n \t\tif( $response->success ){\n \t\t\t$products = [];\n\t\t\tforeach ($response->products as $product) {\n\t \t\t\t$tmp = new Product( $this );\n\t \t\t\t$tmp->fetch($product);\n\t \t\t\t$products[] = $tmp;\n\n\t \t\t\treturn $products;\n\t \t\t}//foreach\n \t\t}//if\n \t\telse{\n \t\t\t// Throw error according to status\n \t\t}//else\n\n \t}", "public function index()\n {\n $request = app()->make('request');\n return response()->json([\n 'products' => $this->catProduct->paginate(\n $this->catProduct->where('id', $request->catId)\n ->relTable()\n ->first()\n ->products\n )\n ]);\n }", "public function index()\n {\n $product_category = ProductCategory::orderBy('id', 'DESC')->get();\n return ProductCategoryResource::collection($product_category);\n }", "public function index(ProductIndexRequest $request)\n {\n\n $per_page = $request->get('per_page');\n $category_ones_id = $request->input('category_ones_id');\n $category_twos_id = $request->input('category_twos_id');\n $category_threes_id = $request->input('category_threes_id');\n $products = Product::where('is_deleted', false)\n ->where(function ($query) use ($category_ones_id, $category_twos_id, $category_threes_id) {\n if ($category_ones_id != null) $query->where('category_ones_id', $category_ones_id);\n if ($category_twos_id != null) $query->where('category_twos_id', $category_twos_id);\n if ($category_threes_id != null) $query->where('category_threes_id', $category_threes_id);\n })\n ->orderBy('id', 'desc');\n if ($per_page == \"all\") {\n $products = $products->get();\n } else {\n $products = $products->paginate(env('PAGE_COUNT'));\n }\n return (new ProductCollection($products))->additional([\n 'errors' => null,\n ])->response()->setStatusCode(200);\n }", "protected function getProducts()\r\n {\r\n $category = new Category((int)Configuration::get('FIELD_FEATUREDPSL_CAT'), (int)Context::getContext()->language->id);\r\n\r\n $searchProvider = new CategoryProductSearchProvider(\r\n $this->context->getTranslator(),\r\n $category\r\n );\r\n\r\n $context = new ProductSearchContext($this->context);\r\n\r\n $query = new ProductSearchQuery();\r\n\r\n $nProducts = (int)Configuration::get('FIELD_FEATUREDPSL_NBR');\r\n if ($nProducts < 0) {\r\n $nProducts = 12;\r\n }\r\n\r\n $query\r\n ->setResultsPerPage($nProducts)\r\n ->setPage(1)\r\n ;\r\n $query->setSortOrder(new SortOrder('product', 'position', 'asc'));\r\n $result = $searchProvider->runQuery(\r\n $context,\r\n $query\r\n );\r\n\r\n $assembler = new ProductAssembler($this->context);\r\n\r\n $presenterFactory = new ProductPresenterFactory($this->context);\r\n $presentationSettings = $presenterFactory->getPresentationSettings();\r\n $presenter = new ProductListingPresenter(\r\n new ImageRetriever(\r\n $this->context->link\r\n ),\r\n $this->context->link,\r\n new PriceFormatter(),\r\n new ProductColorsRetriever(),\r\n $this->context->getTranslator()\r\n );\r\n\r\n $products_for_template = [];\r\n\t\t$products_features=$result->getProducts();\r\n\t\tif(is_array($products_features)){\r\n\t\t\tforeach ($products_features as $rawProduct) {\r\n\t\t\t\t$products_for_template[] = $presenter->present(\r\n\t\t\t\t\t$presentationSettings,\r\n\t\t\t\t\t$assembler->assembleProduct($rawProduct),\r\n\t\t\t\t\t$this->context->language\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n return $products_for_template;\r\n }", "public function get_all_product_information () {\n $this->json_source_file = file_get_contents(\"products.json\");\n $this->json_source_array = json_decode($this->json_source_file,true);\n\n }", "function getProducts() {\n\techo \"Getting Products </br>\";\n\t$response = getRequest('/api/product');\n\tprintInfo($response);\n}", "public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }", "public function readProducts() {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n $traderId = $this->getTraderID($auth);\r\n $sql = \"SELECT * FROM product WHERE traderid = '{$traderId}'\";\r\n $products = Product::find_by_sql($sql);\r\n if ($products) {\r\n return $products;\r\n } else {\r\n throw new RestEception(400, \"no products found\");\r\n }\r\n }", "public function getCategoryDataFront()\n {\n // Get Categorys\n $categories = CategoryWiseSpecification::orderBy('updated_at', 'desc')->Where('deactivate', 0)->take(4)->get();\n\n foreach($categories as $categoryWiseResource)\n {\n $files = explode(\",\", $categoryWiseResource['file']);\n $categoryWiseResource['attachments'] = Attachment::WhereIn('id', $files)->get();\n }\n \n // Return collection of Categorys as a resource\n return CategoryWiseSpecificationResouerce::collection($categories);\n }", "public function init_rest_endpoints( $namespace ) {\n\n\t\t$endpoints = [\n\t\t\t'/collections/' . $this->category . '/' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_list',\n\t\t\t],\n\t\t\t'/collection/' . $this->category . '/' => [\n\t\t\t\t\\WP_REST_Server::READABLE => 'rest_single',\n\t\t\t],\n\t\t\t// Importing a template to library.\n\t\t\t'/import/' . $this->category . '/process' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_process_import',\n\t\t\t],\n\t\t\t// Creating a new page\n\t\t\t'/create/' . $this->category . '/process' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_process_create',\n\t\t\t],\n\t\t\t// Inserting content onto a page.\n\t\t\t'/insert/' . $this->category . '/process' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_process_insert',\n\t\t\t],\n\t\t];\n\n\t\tforeach ( $endpoints as $endpoint => $details ) {\n\t\t\tforeach ( $details as $method => $callback ) {\n\t\t\t\tregister_rest_route(\n\t\t\t\t\t$namespace, $endpoint, [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'methods' => $method,\n\t\t\t\t\t\t\t'callback' => [ $this, $callback ],\n\t\t\t\t\t\t\t'permission_callback' => [ $this, 'rest_permission_check' ],\n\t\t\t\t\t\t\t'args' => [],\n\t\t\t\t\t\t],\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t}", "public function index()\n {\n $prodcucts = Product::with('category')->paginate(10);\n\n return new ProductCollection($prodcucts);\n }", "public function products($url = null)\n {\n $countCategory = Category::where(['url' => $url, 'status' => 1])->count();\n if($countCategory == 0) {\n abort(404);\n }\n // For sidebar\n $categories = Category::with('categories')->where(['parent_id' => 0])->get();\n\n // Get where URL\n $categoryDetails = Category::where(['url' => $url])->first();\n if($categoryDetails->parent_id == 0) {\n $subCategories = Category::where(['parent_id' => $categoryDetails->id])->get();\n // I think it's because the relationship that categories has that we are able to do this.\n foreach($subCategories as $subcategory){\n // Subcategory is all the children\n $cat_ids[] = $subcategory->id;\n }\n $products = Product::whereIn('products.category_id', $cat_ids)->where('products.status', 1)->orderBy('products.id', 'desc');\n } else {\n $products = Product::where(['products.category_id' => $categoryDetails->id])->orderBy('products.id', 'desc')->where('products.status', 1);\n }\n\n if(!empty($_GET['color'])){\n $colorArray = explode('-', $_GET['color']);\n $products = $products->whereIn('products.product_color', $colorArray);\n }\n\n if(!empty($_GET['sleeve'])){\n $sleeveArray = explode('-', $_GET['sleeve']);\n $products = $products->whereIn('products.sleeve', $sleeveArray);\n }\n\n if(!empty($_GET['pattern'])){\n $patternArray = explode('-', $_GET['pattern']);\n $products = $products->whereIn('products.pattern', $patternArray);\n }\n\n if(!empty($_GET['size'])){\n $sizeArray = explode('-', $_GET['size']);\n $products = $products->join('products_attributes','products_attributes.product_id', '=', 'products.id')\n ->select('products.*', 'products_attributes.product_id', 'products_attributes.size')\n ->groupBy('products_attributes.product_id')\n ->whereIn('products_attributes.size', $sizeArray);\n }\n\n $products = $products->paginate(6);\n\n //$colorArray = array('Black', 'Blue', 'Brown', 'Gold','Green','Orange','Pink','Purple','Red','Silver','White','Yellow');\n $colorArray = Product::select('product_color')->groupBy('product_color')->get();\n $colorArray = array_flatten(json_decode(json_encode($colorArray), true));\n\n $sleeveArray = Product::select('sleeve')->where('sleeve', '!=', '')->groupBy('sleeve')->get();\n $sleeveArray = array_flatten(json_decode(json_encode($sleeveArray), true));\n\n $patternArray = Product::select('pattern')->where('pattern', '!=', '')->groupBy('pattern')->get();\n $patternArray = array_flatten(json_decode(json_encode($patternArray), true));\n\n $sizeArray = ProductsAttribute::select('size')->groupBy('size')->get();\n $sizeArray = array_flatten(json_decode(json_encode($sizeArray), true));\n $meta_title = $categoryDetails->meta_title;\n $meta_description = $categoryDetails->meta_description;\n $meta_keywords = $categoryDetails->meta_keywords;\n\n return view('products.listing', compact('categories', 'categoryDetails', 'products', 'meta_title', 'meta_description', 'meta_keywords', 'url', 'colorArray', 'sleeveArray','patternArray', 'sizeArray'));\n }", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "public function products($url=null)\n {\n $countCategory = Category::where(['url' => $url, 'status' => 1])->count();\n // echo $countCategory; die;\n if ($countCategory == 0) {\n abort(404);\n }\n // Get all Categories and Sub Categories\n $categories = Category::with('categories')->where(['parent_id'=>0])->get();\n $categoryDetails = Category::where(['url' => $url])->first();\n if ($categoryDetails->parent_id == 0) {\n // if url is main category url\n $subCategories = Category::where(['parent_id' => $categoryDetails->id])->get();\n // $cat_ids = \"\";\n foreach ($subCategories as $subcat) {\n // if($key==1) $cat_ids .= \",\";\n // $cat_ids .= trim($subcat->id);\n\n $cat_ids [] = $subcat->id;\n }\n // print_r($cat_ids); die;\n // echo $cat_ids; die;\n $productsAll = Product::whereIn('category_id', $cat_ids)->where('status','1')->orderby('id','Desc')->paginate(6);\n // $productsAll = json_decode(json_encode($productsAll));\n // echo \"<pre>\"; print_r($productsAll); die;\n }else {\n // if url is sub category url\n $productsAll = Product::where(['category_id' => $categoryDetails->id])->where('status','1')->orderby('id','Desc')->paginate(6);\n }\n $meta_title = $categoryDetails->meta_title;\n $meta_description = $categoryDetails->meta_description;\n $meta_keywords = $categoryDetails->meta_keywords;\n return view('products.listing')->with(compact('categoryDetails','productsAll','categories','meta_title','meta_description','meta_keywords','url'));\n }", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "public function products($url = null)\n {\n // 404 if url or category status is null is incorrect\n $countCategory = Category::where(['url'=>$url, 'status'=>1])->count();\n // echo $countCategory;die;\n if($countCategory==0){\n abort(404);\n }\n // echo $url; die;\n //Get parent categories their sub categories\n $categories = Category::with('categories')->where(['parent_id'=>0])->get();\n\n $categoryList = Category::where(['url' => $url])->first();\n // $categoryList = json_decode(json_encode($categoryList));\n // echo \"<pre>\"; print_r($categoryList);die;\n\n if($categoryList->parent_id==0){\n // if the url is a main category\n $subCategories = Category::where(['parent_id'=>$categoryList->id])->get();\n\n foreach($subCategories as $key => $subcat){\n $cat_ids[] = $subcat->id;\n }\n // print_r ($cat_ids);die;\n\n $productsAll = Product::whereIn('category_id', $cat_ids)->get();\n // $productsAll = json_decode(json_encode($productsAll));\n // echo \"<pre>\"; print_r($productsAll);die;\n }\n else{\n // If the url is a sub category\n $productsAll = Product::where(['category_id' => $categoryList->id])->get();\n }\n // echo $category->id; die;\n \n Response::json(array('productsAll'=>$productsAll,'categories'=>$categories, 'categoryList'=>$categoryList));\n // return view('products.list')->with(compact('categories','categoryList', 'productsAll'));\n }", "public function getCollectionProducts()\n {\n\t\t$collection_Products = $this->ShopifyClient->call('GET','/admin/products.json?collection_id='.$this->config['collection_id']);\t\t\n\t\t$arra = array();\n\t\tif(!empty($collection_Products['products']))\n\t\t{\n\t\t\t$keyArr = array('id','title','body_html','created_at','vendor','product_type','tags','images',\n\t\t\t\t\t\t\t'image','options',array('variants'=>array('id','price','sku','compare_at_price','weight','weight_unit')));\n\t\t\t$shopifyKeyArr = array('id','title','body_html','created_at','vendor','product_type','tags','images','image','options',\n\t\t\t\t\t\t\t\t array('variants'=>array(0 =>array('id','price','sku','compare_at_price','weight','weight_unit'))));\n\t\t\t\n\t\t\tforeach($collection_Products as $key=>$var) {\n\t\t\t\tforeach($var as $k=>$val) {\n\t\t\t\t\t$arra['data'][] = $this->createProductArray($val,$shopifyKeyArr,$keyArr);\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$status_code = 200;\n\t\t\t$message = 'success';\t\n\t}else\n\t{\n\t\t$status_code = 404; \n\t\t$message = 'Collections products not found';\n\t\t$arra['data'] = array();\n\t\t$arra['data_count'] = 0;\n\t}\t\n\t\t$collection_Products = $this->getJsonDataFormat($arra,$status_code,$message);\n\t\treturn $collection_Products;\n }", "public function index()\n {\n $data = ProductCategory::all();\n\n return response()->json($data,200);\n }", "public function getProducts()\n {\n\n $categories = ProductCategory::all();\n\n $products = Product::paginate(10);\n return $products;\n }", "public function index(Request $request, string $categorySlug)\n {\n $query = $this->productQueryBuilder->build(\n $request->query('rootTaxons') && is_array($request->query('rootTaxons'))\n ? $request->query('rootTaxons')\n : [],\n $request->query('taxons') && is_array($request->query('taxons'))\n ? $request->query('taxons')\n : [],\n $categorySlug);\n\n $query->select('id', 'name', 'slug', 'sku');\n\n if ($request->query('onlyFittable')) {\n $query->fittable();\n }\n\n return ProductResourceCollection::make(\n $query\n ->with([\n 'taxons:id,parent_id,name,slug',\n 'taxons.parent:id,parent_id,name,slug',\n 'assets' => function ($q) use ($request) {\n if (! Auth::guard('auth0')->check() || ! $request->query('withImagesAndModels')) {\n return $q->images();\n }\n\n return $q->imagesAndModels()\n ->with(['materials']);\n },\n ])\n ->withCount('models')\n ->paginate(15)\n ->appends($request->query()));\n }", "function get_products() {\n\t\tApp::Import('model', 'Product');\n\t\t$this->Product = &new Product;\n\n\t\t$products = $this->Product->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t\"Product.short_description != ''\",\n\t\t\t\t'Availability.cart_allowed' => true,\n\t\t\t\t'Product.active' => true\n\t\t\t),\n\t\t\t'contain' => array(\n\t\t\t\t'TaxClass' => array(\n\t\t\t\t\t'fields' => array('id', 'value')\n\t\t\t\t),\n\t\t\t\t'Image' => array(\n\t\t\t\t\t'conditions' => array('Image.is_main' => '1'),\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'Manufacturer' => array(\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'CategoriesProduct' => array(\n\t\t\t\t\t'Category' => array(\n\t\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'Availability' => array(\n\t\t\t\t\t'fields' => array('id', 'cart_allowed')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'fields' => array(\n\t\t\t\t'Product.id',\n\t\t\t\t'Product.name',\n\t\t\t\t'Product.short_description',\n\t\t\t\t'Product.url',\n\t\t\t\t'Product.retail_price_with_dph',\n\t\t\t\t'Product.ean',\n\t\t\t\t'Product.zbozi_name',\n\t\t\t\t'Product.heureka_name',\n\t\t\t\t'Product.discount_common',\n\t\t\t\t'Product.zbozi_cpc',\n\t\t\t\t'Product.heureka_cpc'\n\t\t\t)\n\t\t));\n\t\t\n\t\t$products = array_filter($products, array('ExportsController', 'empty_category'));\n\t\t\n\t\tforeach ($products as $i => $product) {\n\t\t\t$products[$i]['Product']['retail_price_with_dph'] = $this->Product->assign_discount_price($products[$i]);\n\t\t\t$products[$i]['Product']['name'] = str_replace('&times;', 'x', $products[$i]['Product']['name']);\n\t\t\t$products[$i]['Product']['short_description'] = str_replace('&times;', 'x', $products[$i]['Product']['short_description']);\n\t\t}\n\n\t\treturn $products;\n\t}", "public function getApiEndpoints(): array;", "public function index()\n {\n return ProductCategory::orderBy('name')->get();\n }", "public function getProductUrls() {\n\t\t$urls = $this->crawler->filter( 'div.productInfo h3 a' )->each( function ( Crawler $node, $i ) {\n\t\t\treturn $node->attr( 'href' );\n\t\t} );\n\n\t\treturn $urls;\n\t}", "public function index()\n {\n $product = Product::all();\n\n return (new ProductResourceCollection($product))->response();\n }", "protected function _retrieveCollection() {\n $response = array ();\n $productArray = array ();\n // get website id from request\n $websiteId = ( int ) $this->getRequest ()->getParam ( static::WEBSITE_ID );\n if ($websiteId <= 0) {\n $websiteId = Mage::app ()->getWebsite ( 'base' )->getId ();\n }\n // get store id from request\n $storeId = ( int ) $this->getRequest ()->getParam ( static::STORE_ID );\n if ($storeId <= 0) {\n $storeId = Mage::app ()->getWebsite ( $websiteId )->getDefaultGroup ()->getDefaultStoreId ();\n }\n // get page from request\n $page = $this->getRequest ()->getParam ( 'page' );\n if ($page <= 0) {\n $page = 1;\n }\n // get page from request\n $limit = $this->getRequest ()->getParam ( 'limit' );\n if ($limit <= 0) {\n $limit = 10;\n }\n \n // get these type of products only\n $productType = array (\n \"simple\",\n \"configurable\" \n );\n \n // get city for filter products\n $city = ( int ) Mage::app ()->getRequest ()->getParam ( 'city' );\n \n /**\n *\n * @var $collection Mage_Catalog_Model_Resource_Product_Collection\n */\n $collection = Mage::getResourceModel ( 'catalog/product_collection' );\n $collection->addStoreFilter ( $storeId )->addPriceData ( $this->_getCustomerGroupId (), $websiteId )->addAttributeToSelect ( static::NAME, static::PRICE )->addAttributeToFilter ( static::VISIBILITY, array (\n 'neq' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE \n ) )->addAttributeToFilter ( static::STATUS, array (\n 'eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED \n ) )->addAttributeToFilter ( 'type_id', array (\n 'in' => $productType \n ) );\n // Filter products by city\n if ($city) {\n $collection->addFieldToFilter ( 'city', array (\n array (\n 'regexp' => $city \n ) \n ) );\n }\n \n $this->_applyCategoryFilter ( $collection );\n $this->_applyCollectionModifiers ( $collection );\n \n // sort and filetr product collection\n $collection = $this->_getProductByFilter ( $collection, $storeId );\n // get total products count\n $totalProducts = $collection->getSize ();\n $collection = $this->_getProductBySort ( $collection, $storeId );\n $products = $collection->load ();\n \n // get total pages with limit\n $last_page = ceil ( $totalProducts / $limit );\n if ($last_page < $page) {\n $productArray = array ();\n } else {\n $productArray = $this->getProductsList ( $products, $storeId );\n }\n $response ['success'] = 1;\n $response ['error'] = false;\n $response ['total_count'] = $totalProducts;\n $response ['result'] = $productArray;\n return json_encode ( $response );\n }", "public function index()\n {\n return ProductResource::collection(Product::paginate(15));\n }", "public function getCategory(Request $request)\n\t{\n\t\t$params = $request->all();\n\n\t\t$categories = new Categories;\n\n\t\tif(isset($params['category']) && $params['category']!=\"\"){\n\t\t\t$categories = $categories->where('slug', \"=\", $params['category']);\n\t\t}\n\n\t\t$categories = $categories->where('cat_status',1);\t\t\n\n\t\tif(isset($params['onlyParent']) && $params['onlyParent']){\n\t\t\t$categories = $categories->where('ancestors','exists',false);\n\t\t}\n\n\t\t$categories = $categories->get();\n\n\t\tif(empty($categories) || !is_object($categories) || empty($categories->toArray())){\n\t\t\treturn response([],404);\n\t\t}\n\n\t\tif(isset($params['withChild']) && $params['withChild']){\n\n\t\t\tforeach($categories as &$category){\t\t\t\t\n\t\t\t\t$category['children'] = array();\n\t\t\t\t$category['children'] = Categories::where('cat_status',1)->where('ancestors.0._id','=',$category['_id'])->get(array('_id','slug','cat_title','metaTitle','metaDescription','metaKeywords'));\n\t\t\t}\n\n\t\t}\t\n\t\t\n\t\t\n\t\tif(isset($params['withCount']) && $params['withCount']){\n\n\t\t\t// db.products.aggregate([{$group:{_id:\"$categories\",count:{$sum:1}}}])\n\n\t\t\t$products = DB::collection('products')->raw(function($collection){\n\n\t\t\t\treturn $collection->aggregate(array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$match' => array(\n\t\t\t\t\t\t\t'status' => 1\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$project' => array('categories' => 1)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$unwind' => array(\n\t\t\t\t\t\t\t'path' => '$categories',\n\t\t\t\t\t\t\t'preserveNullAndEmptyArrays' => true\t\n\t\t\t\t\t\t)\n\t\t\t\t\t),\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$group' => array(\n\t\t\t\t\t\t\t'_id'=>'$categories',\n\t\t\t\t\t\t\t'count' => array(\n\t\t\t\t\t\t\t\t'$sum' => 1\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t});\n\n\t\t\t$processedPro = [];\n\t\t\tforeach($products['result'] as $product){\n\n\t\t\t\t$cat = $product['_id'];\n\n\t\t\t\t$processedPro[$cat] = $product['count'];\n\n\t\t\t}\n\n\t\t\tforeach($categories as &$category){\n\n\t\t\t\t$category['productCount'] = isset($processedPro[$category['_id']])?$processedPro[$category['_id']]:0;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn response($categories);\n\t}", "public function getCategories()\n {\n $category = ProductsCategory::all();\n\n $data = $category->map(function($category){\n return [\n 'name' => $category->category,\n 'image' => $category->img,\n 'link' => $category->link,\n ];\n });\n\n return response()->json(['data' => $data]);\n }", "public function get(): void\n {\n $this->load->model('catalog/product');\n $this->load->model('tool/image');\n $result = [\n 'code' => 200,\n 'message' => \"success\",\n 'data' => [],\n ];\n $category_id = $this->request->get['categoryId'] ?? 0;\n $limit = $this->request->get['limit'] ?? 20;\n $offset = $this->request->get['offset'] ?? 0;\n\n $products = $this->model_catalog_product->getProducts(\n [\n 'filter_category_id' => $category_id,\n 'limit' => $limit,\n 'start' => $offset\n ]\n );\n\n foreach ($products as $product) {\n $special = false;\n\n if ($product['image']) {\n $image = $this->model_tool_image->resize($product['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height'));\n } else {\n $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height'));\n }\n\n if ((float)$product['special']) {\n $special = $this->currency->format($this->tax->calculate($product['special'], $product['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);\n }\n\n if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {\n $price = $this->currency->format(\n $this->tax->calculate($product['price'],\n $product['tax_class_id'],\n $this->config->get('config_tax')),\n $this->session->data['currency']\n );\n }\n\n $result['data'][] = [\n 'id' => $product['product_id'],\n 'name' => $product['name'],\n 'description' => $product['description'],\n 'price' => $price,\n 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']),\n 'thumb' => $image,\n 'special' => $special,\n 'minimum' => $product['minimum'] > 0 ? $product['minimum'] : 1,\n 'rating' => $product['rating'],\n ];\n }\n\n $this->response->addHeader('Content-Type: application/json');\n $this->response->setOutput(json_encode($result));\n }", "function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "public function index()\n {\n return $this->productService->getProducts();\n }", "public function GetAllProduct(){\r\n\t\r\n\t\t\t$m_product = new m_product();\r\n\t\t\t$CatFlowingPro = $m_product->GetAll();\r\n\t\t\r\n\t\t\r\n\t\t\t//view\r\n\t\t\tinclude(\"view/layout/header.php\");\r\n\t\t\tinclude(\"view/layout/menu.php\");\r\n\t\t\tinclude(\"view/category/cat_detail.php\");\r\n\t\t\tinclude(\"view/layout/footer.php\");\r\n\t\t}", "function getProductsByCategory()\n\t{\n\t\tglobal $con;\n\t\tif (isset($_GET['cat'])){\n\t\t\t$cat_id = $_GET['cat'];\n\t\t\t$get_products = \"select * from products where prod_cat='$cat_id'\";\n\t\t\t$run_products = mysqli_query($con, $get_products);\n\t\t\t$count = mysqli_num_rows($run_products);\n\t\t\t\n\t\t\tif ($count == 0)\n\t\t\t\techo \"<h2>No Products in this category</h2>\";\n\t\t\t\n\t\t\twhile($row = mysqli_fetch_array($run_products)) {\n\t\t\t\t$prod_id = $row['prod_id'];\n\t\t\t\t$prod_cat = $row['prod_cat'];\n\t\t\t\t$prod_brand = $row['prod_brand'];\n\t\t\t\t$prod_price = $row['prod_price'];\n\t\t\t\t$prod_image = $row['prod_img'];\n\n\t\t\techo \"\n\t\t\t\t<div class='single_product'>\n\t\t\t\t\t<h3>$prod_title</h3>\n\t\t\t\t\t<img src='admin_area/product_images/$prod_image'>\t\n\t\t\t\t\t<h2>$prod_price</h2>\n\t\t\t\t\t<a href='details.php?pro_id=$prod_id' style='float:left;'>Details</a>\n\t\t\t\t\t<a href='index.php?add_cart=$prod_id'><button>Add to Cart</button></a>\n\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t}\n\t}", "public function prod_list_by_category() {\n $url_cate = get_raw_app_uri();\n if (!empty($url_cate)) {\n $Product = new Product();\n $info = $Product->getProductByCategory($url_cate);\n $data['content'] = 'list_product'; \n $data['product'] = $info['product'];\n $data['paging'] = $info['paging'];\n $data['selected'] = $url_cate;\n \n //seo\n \n $Category = new ProductCategory();\n $list_cate = $Category->getCategoryByLink($url_cate);\n if ($list_cate->countRows() > 0){\n $list_cate->fetchNext();\n $data['title_page'] = $list_cate->get_prod_cate_name();\n $data['description'] = $list_cate->get_prod_cate_meta_description();\n $data['keywords'] = $list_cate->get_prod_cate_keywords();\n }else{\n $data['title_page'] = '';\n $data['description'] = '';\n $data['keywords'] = '';\n }\n \n $array_menus = array();\n $filter = array();\n $filter['parent_id'] = 0;\n Menu::getMenuTree($array_menus, $filter);\n $data['array_menus'] = $array_menus;\n \n $this->load->view('temp', $data);\n } else {\n redirect(Variable::getDefaultPageString());\n }\n }", "public function index(Request $request)\n {\n $procats = ProductCategory::paginate(12);\n\n return response()->json($procats, 200);\n }", "public function index()\n {\n $products = $this->products->get();\n\n return ProductResource::collection($products);\n }", "public function getProductsByCategory ($category_id) {\n\t\t\n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n \n\t\ttry {\n \n\t\t\t/*\n $query = \"SELECT ea_product.id, ea_product.upc, ea_product.brand, ea_product.product_name, ea_product.product_description, ea_product.avg_price, ea_image.file\n\t\t\tFROM ea_product LEFT JOIN ea_image\n ON ea_product.upc = ea_image.upc\n WHERE ea_product.category_id = '$category_id'\n\t\t\tORDER BY ea_product.avg_price\";\n */\n \n $query = \"SELECT ea_product.id, upc, brand, product_name, \n product_description, avg_price, ea_category.name\n\t\t\tFROM ea_product, ea_category\n WHERE ea_product.category_id = ea_category.id\n AND category_id = '$category_id'\n\t\t\tORDER BY avg_price\";\n //print(\"$query\");\n\t\t\tforeach($this->dbo->query($query) as $row) {\n\t\t\t\t$id = stripslashes($row[0]);\n\t\t\t\t$upc = strval(stripslashes($row[1]));\n\t\t\t\t$brand = $this->convertFancyQuotes(stripslashes($row[2]));\n\t\t\t\t$product_name = $this->convertFancyQuotes(stripslashes($row[3]));\n\t\t\t\t$product_description = $this->convertFancyQuotes(stripslashes($row[4]));\n\t\t\t\t$avg_price = stripslashes($row[5]);\n\t\t\t\t$category_name = $this->convertFancyQuotes(stripslashes($row[6]));\n \n $product[\"id\"] = $id;\n $product[\"upc\"] = $upc;\n $product[\"brand\"] = $brand;\n $product[\"product_name\"] = $product_name;\n $product[\"product_description\"] = $product_description;\n $product[\"avg_price\"] = $avg_price;\n $product[\"category_name\"] = $category_name;\n \n $product[\"image_path\"] = $this->getImagePath($upc);\n \n $products[] = $product;\n\t\t\t}\n\t\n\t\t} catch (PDOException $e) {\n\t\t\t$this->errorCode = 1;\n\t\t\t$errorCode = -1;\n\t\t\t$errorMessage = \"PDOException for getProductsByCategory.\";\n\t\t}\t\n \n\t\t$error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"search\"] = $category_name;\n $data[\"query\"] = $query;\n \n $data[\"products\"] = $products;\n\n $data = json_encode($data);\n \n\t\treturn $data;\n\t}", "public function sc_add_endpoints() {\n\n\t\t\tif ( $this->is_wc_gte_26() ) {\n\t\t\t\tadd_rewrite_endpoint( WC_SC_Display_Coupons::$endpoint, EP_ROOT | EP_PAGES );\n\t\t\t\t$this->sc_check_if_flushed_rules();\n\t\t\t}\n\n\t\t}", "function productList() {\n\t$categoryIds = array_merge ( [ \n\t\t\t$this->id \n\t], $this->subcategoryIds () );\n\tprint_r ( $categoryIds );\n\t// Find all products that match the retrieved category IDs\n\treturn Product::whereIn ( 'cate_id', $categoryIds )->get ();\n}", "public function get()\n {\n $products = $this->productRepository->all();\n foreach($products as $product) {\n\n $product->category = $this->categoryRepository->find($product->category_id)->title;\n $product->section_id = $this->categoryRepository->find($product->category_id)->section_id;\n $product->section = $this->sectionRepository->find($product->section_id)->title;\n }\n return $products;\n\n }", "public function getRemoteProducts()\n {\n if (!$this->client) {\n throw new \\Netcreators\\NcgovPdc\\Service\\Search\\SamenwerkendeCatalogi40\\Response\\Exception('No REST client provided.');\n }\n\n $this->client->initializeRequest();\n $this->client->performRequest();\n\n if ($this->client->hasErrors()) {\n throw new \\Netcreators\\NcgovPdc\\Service\\Search\\SamenwerkendeCatalogi40\\Request\\Exception(\n implode(',', $this->client->getErrors())\n );\n }\n\n /** @var ResponseParser $responseParser */\n $responseParser = $this->objectManager->get(ResponseParser::class);\n $responseParser->setData(\n $this->client->getResponse()\n );\n return $responseParser->getRemoteProducts();\n }", "public function index()\n {\n $products = Products::all();\n $categories = DB::table('categories')->get();\n //$categoriesRelationship = DB::table('categories_relationship')->get();\n $categoriesRelationship = DB::select(\"SELECT\n categories.category_filter_by AS 'catFilterBy',\n products.id AS 'productID',\n products.slug AS 'productSlug',\n categories.category_name AS 'categoryName'\n FROM\n categories, products, categories_relationship\n WHERE\n categories.category_id = categories_relationship.category_id\n AND\n products.id = categories_relationship.object_id\"\n );\n\n return response()->json([\n 'productsList' => $products,\n 'categories' => $categories,\n 'categoriesRelationship' => $categoriesRelationship,\n ]);\n }", "public function paramsAction() {\n\n$product_collection = Mage::getModel('catalog/category')->load(3)->getProductCollection();\n\n// Now let's loop through the product collection and print the ID of every product \nforeach($product_collection as $product) {\n // Get the product ID\n\n$product_id = $product->getId();\n\n // Load the full product model based on the product ID\n\n$full_product = Mage::getModel('catalog/product')->load($product_id);\n\n // Now that we loaded the full product model, let's access all of it's data\n\n // Let's get the Product Name\n\n $product_name = $full_product->getName();\n\n // Let's get the Product URL path\n\n $product_url = $full_product->getProductUrl();\n\n // Let's get the Product Image URL\n\n $product_image_url = $full_product->getImageUrl();\n\n // Let's print the product information we gathered and continue onto the next one\n\n echo $product_name;\n\n echo $product_image_url;\n}\n }", "public function index()\n {\n //return Product::with('productDetails', 'supercategory', 'brand', 'reviews')->get();\n return ProductResource::collection(Product::with('productDetails', 'supercategory', 'brand', 'reviews')->get());\n }", "function getProducts(Store $s)\n {\n $curl_url = $s->getApiPath() . \"v2/products\";\n $products = CurlHandler::GET($curl_url, $s->getAccessToken());\n return $products;\n }", "function getProducts() {\n\n try {\n $client = HttpClient::create();\n $response = $client->request('GET', shopifyApiurl . 'products.json');\n } catch (\\Exception $e) {\n var_dump($e);\n }\n\n return new JsonResponse($response->getContent());\n }", "public function evaluate()\n {\n $categoryId = $this->fusionValue('categoryId');\n\n if (!$categoryId) {\n return [];\n }\n\n $this->guzzle = new GuzzleClient([\n 'base_uri' => $this->shopwareSettings['api'],\n 'headers' => [\n 'Accept' => 'application/json',\n 'SW-Access-Key' => $this->shopwareSettings['key']\n ],\n 'query' => [\n 'filter[product.categoryTree]' => $categoryId\n ]\n ]);\n\n try {\n $response = $this->guzzle->request('GET', 'sales-channel-api/v3/product');\n } catch (GuzzleException $exception) {\n throw new \\RuntimeException(sprintf('Uri Getter: %s', $exception->getMessage()), 1560856269, $exception);\n }\n\n return $this->parseJsonResponse($response)['data'];\n }", "public function index(ProductIndexRequest $request)\n {\n $products = $request->input('category_id')\n ? $this->getProductsByCategoryId($request->input('category_id'))\n : Product::all();\n\n return ProductResource::collection($products);\n }", "public function getProducts($params, $request);", "public function getCategories()\n {\n return CategoryResource::collection(Category::with('products')->get())\n ->response()\n ->setStatusCode(200);\n }", "function getProducts($page)\n{\n // Update the API URL with the page number\n $api_url = API_URL . '?page=' . $page;\n\n // Initialize the cURL\n $curl = curl_init();\n\n // Configure the cURL\n curl_setopt($curl, CURLOPT_URL, $api_url);\n curl_setopt($curl, CURLOPT_HEADER, true);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_USERPWD, API_USERNAME . ':' . API_PASSWORD);\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\n // Execute the cURL\n $response = curl_exec($curl);\n\n // Extract the headers of the response\n $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);\n $header = substr($response, 0, $header_size);\n $header = getHeaders($header);\n\n // Get the total pages and total products from the headers\n $total_pages = $header['X-WP-TotalPages'];\n $total_products = $header['X-WP-Total'];\n\n // Extract body of the response\n $body = substr($response, $header_size);\n\n // Convert the body from string to array\n $body = json_decode($body);\n\n // Define an array to store the products\n $products = array();\n\n // Loop through the response\n foreach ($body as $item) {\n // Only if the catalog visibility is visible\n if ($item->catalog_visibility === 'visible') {\n // Instantiate an object of Product\n $product = new Product();\n\n // Assign the values\n $product->id = $item->id;\n $product->name = $item->name;\n $product->images = $item->images;\n\n // Push the object into the array\n array_push($products, $product);\n }\n }\n\n // Destroy the cURL instance\n curl_close($curl);\n\n // Encapsulate all the data in an array\n $data = array(\n \"total_pages\" => $total_pages,\n \"total_products\" => $total_products,\n \"products\" => $products\n );\n\n return $data;\n}", "public function GetProducts() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "private function loadAll() {\n\n return $this->search->getProducts();\n\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "public function index()\n {\n return ProductResource::collection(Product::orderBy('id', 'desc')->get());\n }", "public function index()\n\t{\n\t\t$products = QueryBuilder::for(Product::class)\n\t\t\t->allowedIncludes(['category'])\n\t\t\t->allowedFilters(['sku'])\n\t\t\t->orderBy('sku', 'asc')\n\t\t\t->get();\n\n\t\treturn new ProductCollection($products);\n\t}", "public function getAllProducts()\n {\n try {\n $products = Product::orderByDesc('id')->get();\n return $products;\n } catch (\\Throwable $th) {\n Log::error($th);\n return response()->json('Failed to load data, Try again later.',400);\n }\n }", "public function getCatalog() {}", "public function getProducts() {\n\t\t$baseUrl = 'https://'.$this->apiKey.':'.$this->password.'@'.$this->domain.'.myshopify.com';\n\t\t$request = '/admin/products.json';\n\t\t$method = 'GET';\n\n\t\t$result = $this->curl($baseUrl.$request, $method);\n\n\t\t$products = array();\n\t\tforeach($result->products as $shopify) {\n\t\t\tforeach($shopify->variants as $variant) {\n\t\t\t\t// need to make a class Product in this folder?\n\t\t\t\t$product = new stdClass;\n\t\t\t\t$product->id \t\t= $shopify->id;\n\t\t\t\t$product->sku \t\t= $variant->sku;\n\t\t\t\t$product->name \t\t= $shopify->title;\n\t\t\t\t$product->price \t= $variant->price;\n\t\t\t\t$product->quantity \t= $variant->inventory_quantity;\t\n\t\t\t\tarray_push($products, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n\t}", "function getProductByCategory(){\n $return = array(); \n $pids = array();\n \n $products = Mage::getResourceModel ( 'catalog/product_collection' );\n \n foreach ($products->getItems() as $key => $_product){\n $arr_categoryids[$key] = $_product->getCategoryIds();\n \n if($this->_config['catsid']){ \n if(stristr($this->_config['catsid'], ',') === FALSE) {\n $arr_catsid[$key] = array(0 => $this->_config['catsid']);\n }else{\n $arr_catsid[$key] = explode(\",\", $this->_config['catsid']);\n }\n \n $return[$key] = $this->inArray($arr_catsid[$key], $arr_categoryids[$key]);\n }\n }\n \n foreach ($return as $k => $v){ \n if($v==1) $pids[] = $k;\n } \n \n return $pids; \n }", "public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }", "public function index()\n {\n $categoryId = request('category_id');\n $categoryName = null;\n \n if($categoryId)\n {\n $category = Category::find($categoryId);\n $categoryName = $category->name;\n \n //$products = $category->products;\n $products = $category->allProducts();\n\n }\n else\n {\n $products = Product::take(1000)->get();\n }\n \n $categories = Category::whereNull('parent_id')->get();\n $cat = DB::table('categories')->where('id', request('category_id'))->get();\n return view('product.index', compact('products', 'categoryName', 'categories', 'cat', 'category'));\n }", "public function index()\n {\n return new ProductCollection(Product::all());\n }", "public function getProductsEndpointUrl(array $params = []) {\n $cats = str_replace(\"\\r\\n\", PHP_EOL, $this->config['categories']);\n\n $params = array_merge([\n 'latlong' => implode(',', array_values($this->config['coordinates'])),\n 'dist' => $this->config['distance'],\n 'cats' => implode(',', explode(PHP_EOL, $cats)),\n 'pge' => 1,\n 'size' => $this->config['result_count'],\n 'fl' => implode(',', $this->defaultFieldList),\n 'order' => 'product_update_date',\n ], $params);\n\n return $this->getEndpointUrl('products', $params);\n }", "public function index()\n {\n return RecipeCategoryResource::collection(Recipe::all());\n }", "public function index()\n\t{\n\t\t$products = Product::all();\n\t\tforeach ($products as $key => $value) {\n\t\t\t$product = $value;\n\t\t\t$product['linked_product'] = unserialize($value['linked_product']);\n\t\t\t$product['category'] = Category::find($value['cat_id']);\n\n\t\t\t$productsnew[] = $product;\n\t\t}\n\n\t\treturn Response::json($productsnew);\n\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function displayAllProducts()\n {\n return $this->paginate(['category', 'subcategory', 'brand', 'reviews'], false, 12);\n }", "public function index()\n {\n return CategoryResource::collection(Category::all());\n }", "public function index()\n {\n $request = request();\n $category_id = $request->input('category_id');\n $keyword = $request->input('q');\n\n $products = Product::when($category_id, function($query, $category_id) {\n return $query->where('category_id', $category_id);\n })\n ->when($keyword, function($query, $keyword) {\n return $query->where('name', 'LIKE', \"%$keyword%\")\n ->orWhere('description', 'LIKE', \"%$keyword%\");\n })\n ->with('category')\n ->paginate();\n\n return $products;\n }", "public function index() {\n\n // Get all categories with at least one product\n $products = Product::all();\n $category_ids = array();\n\n foreach($products as $product){\n\n if (!in_array($product->category_id.'', $category_ids)){\n\n $category_ids[] = $product->category_id;\n }\n\n }\n\n // Get all categories\n $categories = \\DB::table('categories')->whereNull('parent_id')->get();\n\n // Get all sub categories\n foreach($categories as $category) {\n $subCategories[$category->id] = \\DB::table('categories')->where('parent_id', '=', $category->id)->get();\n }\n\n // Check if category has products\n /*$i=0;\n foreach($categories as $category){\n\n $used = false;\n foreach($subCategories as $subCategory){\n if($subCategory->parent_id === $category->id){\n $used = true;\n }\n }\n if(!$used){\n unset($categories[$i]);\n }\n $i++;\n }*/\n\n // Check if filter exists\n if (session()->has('filter')) {\n\n $products = Product::whereIn('category_id', session()->get('filter'))->get();\n\n }else {\n\n $products = Product::all();\n\n }\n\n // Pass data to view\n return view('products.index', compact('products', 'categories', 'subCategories'));\n }", "public function add_endpoints() {\n\t\tadd_rewrite_endpoint( self::$endpoint, EP_ROOT | EP_PAGES );\n\t\t//flush_rewrite_rules();\n\t}", "public function categories(Request $request)\n {\n $idsCategories = [];\n if (isset($request['categories'])) {\n foreach ($request['categories'] as $idCategory) {\n if ((int) $idCategory != 0) {\n $idsCategories[] = (int) $idCategory;\n }\n }\n }\n $marketId = '0';\n if (isset($request['marketid'])) {\n $marketId = $request['marketid'];\n }\n $promo = '0';\n if (isset($request['promo'])) {\n $promo = $request['promo'];\n }\n try {\n if (count($idsCategories) != 0) {\n $request['categories'] = ['0'];\n }\n $this->productRepository->pushCriteria(new RequestCriteria($request));\n $this->productRepository->pushCriteria(new LimitOffsetCriteria($request));\n $this->productRepository->pushCriteria(new ProductsOfFieldsCriteria($request));\n $this->productRepository->pushCriteria(new ProductsOfCategoriesCriteria($request));\n\n $products = $this->productRepository->all();\n } catch (RepositoryException $e) {\n return $this->sendError($e->getMessage());\n }\n\n // return $this->sendResponse($products->toArray(), 'Products retrieved successfully');\n $productsFinal = [];\n\n $productsArray = $products->toArray();\n if (!isset($request['no_filter'])) {\n if ($promo) {\n return $this->sendResponse($productsArray, 'Promos enviados');\n } else {\n\n if (count($idsCategories) > 0) {\n $idMarket = $marketId;\n $valueActiveCategory = DB::table('categoriesproducts')->where('market_id', '=', $idMarket)->whereIn('category_id', $idsCategories)->pluck('active', 'category_id');\n $idsProducts = DB::table('products')->where('market_id', '=', $idMarket)->get(['featured', 'id'])->toArray();\n $algo = [];\n foreach ($idsProducts as $idP) {\n if ($idP->featured) {\n $algo[] = $idP->id;\n }\n }\n $datosProductosRaw = DB::table('product_categories')->whereIn('category_id', $idsCategories)->whereIn('product_id', $algo)->where('active', '1')->get();\n $idsProducts = [];\n foreach ($datosProductosRaw as $idPR) {\n if ($idPR->active) {\n $idsProducts[] = $idPR->product_id;\n }\n }\n $productsFilter = $this->productRepository->whereIn('id', $idsProducts)->get();\n $productsFinal = $productsFilter;\n } else if (count($productsArray) != 0) {\n\n $idMarket = $productsArray[0]['market_id'];\n $valueActiveCategory = DB::table('categoriesproducts')->where('market_id', '=', $idMarket)->pluck('active', 'category_id');\n $idsCategory = [];\n foreach ($valueActiveCategory as $categoryID => $id) {\n $idsCategory[] = $categoryID;\n }\n $productsTmp = [];\n foreach ($productsArray as $product) {\n $valueActiveProduct = DB::table('product_categories')->whereIn('category_id', $idsCategory)->where('product_id', '=', $product['id'])->pluck('active');\n foreach ($valueActiveProduct as $value) {\n if ($value) {\n $productsTmp[] = $product;\n }\n }\n }\n\n $productsFinal = $productsTmp;\n }\n }\n } else {\n $productsFinal = $productsArray;\n }\n\n return $this->sendResponse($productsFinal, 'Productos filtrados enviados');\n }", "public function index()\n {\n return ResourcesProduct::collection(Auth::check() ? Product::all() : Product::where('publish', true)->get());\n }", "public function index(){\n return CategoryResource::collection(Category::all());\n }", "public function index()\n {\n return CategoryResource::collection(Category::latest()->get());\n }", "public function listProducts($category_id, $request) {\n\n $json = array('success' => false);\n\n $this->load->model('rest/restadmin');\n\n $parameters = array(\n \"limit\" => 100,\n \"start\" => 1,\n 'filter_category_id' => $category_id\n );\n\n /*check limit parameter*/\n if (isset($request->get['limit']) && ctype_digit($request->get['limit'])) {\n $parameters[\"limit\"] = $request->get['limit'];\n }\n\n /*check page parameter*/\n if (isset($request->get['page']) && ctype_digit($request->get['page'])) {\n $parameters[\"start\"] = $request->get['page'];\n }\n\n /*check search parameter*/\n if (isset($request->get['search']) && !empty($request->get['search'])) {\n $parameters[\"filter_name\"] = $request->get['search'];\n $parameters[\"filter_tag\"] = $request->get['search'];\n }\n\n\n /*check sort parameter*/\n if (isset($request->get['sort']) && !empty($request->get['sort'])) {\n $parameters[\"sort\"] = $request->get['sort'];\n }\n\n /*check order parameter*/\n if (isset($request->get['order']) && !empty($request->get['order'])) {\n $parameters[\"order\"] = $request->get['order'];\n }\n\n $parameters[\"start\"] = ($parameters[\"start\"] - 1) * $parameters[\"limit\"];\n\n $products = $this->model_rest_restadmin->getProductsData($parameters, $this->customer);\n\n if (count($products) == 0 || empty($products)) {\n $json['success'] = false;\n $json['error'] = \"No product found\";\n } else {\n $json['success'] = true;\n foreach ($products as $product) {\n $json['data'][] = $this->getProductInfo($product);\n }\n }\n\n $this->sendResponse($json);\n }", "public function index() {\n\t\treturn $this->product->all();\n\t}", "public function getArrayOfproducts(): array\n {\n $products = $this->model->getByCategory('helmet', $this->route['action']);\n return $products;\n }", "public function getSearchData()\n\t{\n\t\t$search_data \t\t=\tjson_decode($this->request->getContent(),true);\n\t\t$search_term\t\t=\t$search_data['search_term'];\n\t\t$area_id\t\t\t=\t$search_data['area_id'];\n\t\t$city_id\t\t\t=\t$search_data['city_id'];\n\t\t$page_number\t\t=\t$search_data['page_number'];\n\t\t\n\t\t$products = $this->_productCollectionFactory->create()->addAttributeToSelect(\n\t\t\t'*'\n\t\t)->addFieldToFilter(\n\t\t\t'name',\n\t\t\t['like' => '%'.$search_term.'%']\n\t\t)-> addAttributeToFilter('visibility', array('in' => array(4) )\n\t\t)-> addAttributeToFilter('status', array('in' => array(1) ))\n\t\t->addCategoryIds()->setPageSize(10)\n ->setCurPage($page_number);\n\t\t\n\t\t\n\t\t$products->getSelect()\n\t\t\t\t->join(array(\"marketplace_product\" => 'marketplace_product'),\"`marketplace_product`.`mageproduct_id` = `e`.`entity_id`\",array(\"seller_id\" => \"seller_id\"))\n\t\t\t\t->join(array(\"marketplace_userdata\" => 'marketplace_userdata'),\"`marketplace_userdata`.`seller_id` = `marketplace_product`.`seller_id` AND (FIND_IN_SET('\".$area_id.\"', `area_id`)) AND (FIND_IN_SET('\".$city_id.\"', `region_id`)) \",array(\"shop_url\", \"logo_pic\")); \n\t\t\n\t\t\n\t\t$all_response \t=\tarray();\n\t\t$all_response['data'] \t=\tarray();\n\t\t$categories \t=\tarray();\n\t\t$seller_data \t=\tarray();\n\t\t$priceHelper \t= \t$this->_objectManager->create('Magento\\Framework\\Pricing\\Helper\\Data'); // Instance of Pricing Helper\n\t\t$StockState \t= \t$this->_objectManager->get('\\Magento\\CatalogInventory\\Api\\StockStateInterface');\n\t\t$store \t\t\t\t= \t$this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore();\n\t\tforeach($products as $product_data){\n\t\t\tif(!isset($all_response['data'][$product_data->getSellerId()])){\t\t\t\n\t\t\t\t$all_response['data'][$product_data->getSellerId()]['seller']\t=\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name'=> ucfirst($product_data->getShopUrl()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'shop_url'=> ($product_data->getShopUrl()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'logo'=> $product_data->getLogoPic(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\t\t\t\t\t\n\t\t\t}\n\t\t\t$categories\t\t\t=\t$product_data->getCategoryIds();\n\t\t\t$formattedPrice \t= \t$priceHelper->currency($product_data->getPrice(), true, false);\n\t\t\t\n\t\t\t$product_quantity\t=\t$StockState->getStockQty($product_data->getId(), $product_data->getStore()->getWebsiteId());\n\t\t\t$collectioncat \t\t= \t$this->_categoryCollectionFactory->create();\n\t\t\t$collectioncat->addAttributeToSelect(array('name'), 'inner');\n\t\t\t$collectioncat->addAttributeToFilter('entity_id', array('in' => $categories));\n\t\t\t$collectioncat->addAttributeToFilter('level', array('gt' => 1));\n\t\t\t$collectioncat->addIsActiveFilter();\n\t\t\t$productImageUrl \t= \t$store->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product/';\n\t\t\t\n\t\t\t$shortdescription\t=\t$product_data->getShortDescription();\n\t\t\tif($shortdescription==null){\n\t\t\t\t$shortdescription\t=\t\"\";\n\t\t\t}\n\t\t\tif($product_data->getTypeId()!=\"simple\"){\n\t\t\t\t$price\t\t\t=\t0;\n\t\t\t\t$product_price\t=\t0;\n\t\t\t\t$product_special_price\t=\t0;\n\t\t\t\t$_children = $product_data->getTypeInstance()->getUsedProducts($product_data);\n\t\t\t\tforeach ($_children as $child){\n\t\t\t\t\t$productPrice = $child->getPrice();\n\t\t\t\t\t$price = $price ? min($price, $productPrice) : $productPrice;\n\t\t\t\t}\n\t\t\t\t$special_price\t=\t$product_data->getFinalPrice(); \n\t\t\t\tif($price <= $product_data->getFinalPrice()){\n\t\t\t\t\t$special_price\t=\tnull; \n\t\t\t\t}\n\t\t\t\t$formattedPrice\t\t\t=\t$price; \n\t\t\t\t$product_price\t\t\t=\t$product_data->getProductPrice();\n\t\t\t\t$product_special_price\t=\t$product_data->getProductSpecialPrice();\n\t\t\t}else{\n\t\t\t\t$formattedPrice\t\t\t=\t$product_data->getPrice(); \n\t\t\t\t$special_price\t\t\t=\t$product_data->getFinalPrice(); \n\t\t\t\t$product_price\t\t\t=\t0;\n\t\t\t\t$product_special_price\t=\t0;\n\t\t\t}\n\t\t\tif($formattedPrice == $special_price ){\n\t\t\t\t$special_price\t\t\t=\tnull; \n\t\t\t}\n\t\t\t$formattedPrice\t\t\t\t=\tnumber_format($formattedPrice, 2);\n\t\t\tif($special_price !=null){\n\t\t\t\t$special_price\t\t\t\t=\tnumber_format($special_price, 2);\n\t\t\t}\n\t\t\t$all_response['data'][$product_data->getSellerId()]['products'][]\t=\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'id'=>$product_data->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t'name'=>$product_data->getName(),\n\t\t\t\t\t\t\t\t\t\t\t\t'sku'=>$product_data->getSku(),\n\t\t\t\t\t\t\t\t\t\t\t\t'short_description'=>$shortdescription,\n\t\t\t\t\t\t\t\t\t\t\t\t'price'=>$formattedPrice,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_price'=>$product_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_special_price'=>$product_special_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'special_price'=>$special_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'image'=>ltrim($product_data->getImage(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'small_image'=>ltrim($product_data->getSmallImage(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'thumbnail'=>ltrim($product_data->getThumbnail(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'quantity'=>$product_quantity,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_data'=>$product_data->getData(),\n\t\t\t\t\t\t\t\t\t\t\t\t'productImageUrl'=>$productImageUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t'categories'=>$collectioncat->getData(),\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$all_response['data'][$product_data->getSellerId()]['categories']\t=\t$collectioncat->getData();\n\t\t}\n\t\t\n\t\t\n\t\t$search_data \t=\t[['page_number'=>$page_number,'total_count'=>$products->getSize()]];\n\t\tif(!empty($all_response['data'])){\n\t\t\tforeach($all_response['data'] as $serller_id=>$seller_data){\n\t\t\t\t$customer_data \t\t\t\t\t= \t$this->_objectManager->create('Magento\\Customer\\Model\\Customer')->load($serller_id);\n\t\t\t\t$seller_data['seller']['name']\t=\ttrim($customer_data->getData('firstname').\" \".$customer_data->getData('lastname'));\n\t\t\t\t$search_data[]\t=\t[\n\t\t\t\t\t\t\t\t\t\t'seller_data'=>$seller_data['seller'],\n\t\t\t\t\t\t\t\t\t\t'products'=>$seller_data['products'],\n\t\t\t\t\t\t\t\t\t\t'categories'=>$seller_data['categories']\n\t\t\t\t\t\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $search_data;\n\t}", "public function fetchAll()\n {\n $products = product::with('brand')->paginate(8);\n return productResource::collection($products);\n }", "public final function getEndpoints() {\n $this->endpoints[] = 'index';\n return $this->endpoints;\n }", "private function exportProducts(){\n Product::initStore($this->store_settings->store_name, config('shopify.api_key'), $this->store_settings->access_token);\n $products_count = Product::count();\n $products_per_page = 250;\n $number_of_pages = ceil($products_count/$products_per_page);\n $all_products = [];\n $products = [];\n //to init start time\n ShopifyApiThrottle::init();\n for( $page = 1; $page <= $number_of_pages; $page++ ){\n //wait for some time so it doesn't reach throttle point\n if( $page > 1 ){ ShopifyApiThrottle::wait(); }\n\n $products = Product::all([\n 'limit' => $products_per_page,\n 'page' => $page\n ]);\n if($products)\n $all_products = array_merge($all_products, $products);\n //to re-init start time\n ShopifyApiThrottle::init();\n }\n return $all_products;\n }", "public function index(Category $category)\n {\n\n $vendedores= $category->products()\n ->with('seller') /*implementar con(with) la otra relacion */\n ->get()\n ->pluck('seller') /*solo filtrar por la coleccion*/\n ->unique('id') /*para que no se repitan los datos en este caso los vendedores \"sellers\"*/\n ->values(); /*quitar los valores en blanco*/\n \n\n return $this->showAll($vendedores);\n // dd($vendedores);\n \n }", "public function index(){\n return CategoryResource::collection(Category::orderBy('id','DESC')->paginate(10));\n }", "public function index()\n {\n return product_client::all();\n }", "public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}" ]
[ "0.6458531", "0.63298553", "0.6302737", "0.6299358", "0.6050368", "0.59567225", "0.59119076", "0.58100474", "0.5800538", "0.5738983", "0.5716174", "0.5709875", "0.57030153", "0.5698487", "0.56896275", "0.5689594", "0.5635815", "0.56319785", "0.56288624", "0.56185794", "0.56167144", "0.5584065", "0.5544118", "0.5536516", "0.552512", "0.5497322", "0.5484468", "0.5441236", "0.54336154", "0.5433065", "0.5432588", "0.5410819", "0.54081637", "0.5401435", "0.5381626", "0.5378735", "0.53767186", "0.5364587", "0.53595495", "0.5357859", "0.5356742", "0.53307885", "0.5322342", "0.53134227", "0.5309361", "0.5307333", "0.53048825", "0.52903783", "0.5278226", "0.52778053", "0.5277258", "0.5276091", "0.5275817", "0.52732986", "0.52726555", "0.52703255", "0.5261468", "0.52580464", "0.525377", "0.52535933", "0.5228607", "0.52208155", "0.52204806", "0.52171", "0.5216283", "0.5210853", "0.52072364", "0.52018076", "0.5200844", "0.5191854", "0.51892215", "0.51843685", "0.5181283", "0.5181064", "0.51694715", "0.5168516", "0.5165182", "0.5164802", "0.5164068", "0.5155737", "0.5153358", "0.51513565", "0.51482856", "0.51442665", "0.51432234", "0.51399004", "0.5135608", "0.5133708", "0.51289153", "0.51255757", "0.5122837", "0.5108691", "0.51066846", "0.5096028", "0.50934094", "0.5091856", "0.5088008", "0.5086979", "0.5085699", "0.5083778" ]
0.7007666
0
Extract usesfull pagination data (max product pages) and set its in lastPage property.
private function extractPagination($rawData) { $crawler = new Crawler($rawData); // Extract pagination data if first loop. if ( $this->currentPage == 1 ) { $paginationNode = $crawler->filterXPath('//p[contains(@class, \'result-list-pagination\')]'); $lastPageHref = $paginationNode->filterXPath('//a')->last()->attr('href'); $query = parse_url($lastPageHref, PHP_URL_QUERY); parse_str($query, $params); $this->lastPage = $params['page']; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildPagination() {}", "protected function buildPagination() {}", "abstract public function preparePagination();", "private function calcLastPageCount()\n\t{\n\t\t$this->lastPageCount=$this->totalRecords%$this->recordsPerPage;\n\t}", "public function getLastPage() {}", "private function setTotalPages()\n {\n $this->totalPages = ceil($this->totalData / $this->limit);\n }", "function dustrial_loop_shop_per_page( $products ) {\n if( function_exists( 'dustrial_framework_init' ) ) {\n $shop_posts_per_page = dustrial_get_option('shop_posts_per_page');\n if (!empty($shop_posts_per_page)) {\n $shop_posts_per_page = $shop_posts_per_page;\n } else {\n $shop_posts_per_page = '8';\n }\n } else {\n $shop_posts_per_page = '8';\n }\n $products = $shop_posts_per_page;\n return $products;\n}", "function alchemists_get_products_per_page(){\n\n global $woocommerce;\n\t$per_page = get_option( 'wc_glt_count', '6,12,24' );\n\n\t$per_page_array = array();\n\t$per_page_array = explode( ',', $per_page );\n\n $default = $per_page_array[0];\n $count = $default;\n $options = alchemists_get_products_per_page_options();\n\n // capture form data and store in session\n if(isset($_POST['alchemists-woocommerce-products-per-page'])){\n\n // set products per page from dropdown\n $products_max = intval($_POST['alchemists-woocommerce-products-per-page']);\n if($products_max != 0 && $products_max >= -1){\n\n \tif(is_user_logged_in()){\n\n\t \t$user_id = get_current_user_id();\n\t \t$limit = get_user_meta( $user_id, '_product_per_page', true );\n\n\t \tif(!$limit){\n\t \t\tadd_user_meta( $user_id, '_product_per_page', $products_max);\n\t \t}else{\n\t \t\tupdate_user_meta( $user_id, '_product_per_page', $products_max, $limit);\n\t \t}\n \t}\n\n $woocommerce->session->jc_product_per_page = $products_max;\n return $products_max;\n }\n }\n\n // load product limit from user meta\n if(is_user_logged_in() && !isset($woocommerce->session->jc_product_per_page)){\n\n $user_id = get_current_user_id();\n $limit = get_user_meta( $user_id, '_product_per_page', true );\n\n if(array_key_exists($limit, $options)){\n $woocommerce->session->jc_product_per_page = $limit;\n return $limit;\n }\n }\n\n // load product limit from session\n if(isset($woocommerce->session->jc_product_per_page)){\n\n // set products per page from woo session\n $products_max = intval($woocommerce->session->jc_product_per_page);\n if($products_max != 0 && $products_max >= -1){\n return $products_max;\n }\n }\n\n return $count;\n}", "public function getLastPage();", "private function _pagination()\n {\n\n if (Request::has('pq_curpage') && Request::has('pq_rpp')) {\n $columnsTemp = $this->_columnsRaw;\n $pq_curPage = Request::input('pq_curpage');\n $pq_rPP = Request::input('pq_rpp');\n $queryTemp = new \\stdClass();\n $queryTemp = $this->_getQueryStatement();\n $queryTemp->columns = null;\n\n // Verifica si existe algun filtro para aplicarlo al COUNT y determinar cuantos registros hay en la consulta\n if (property_exists($this->_filterTable, 'query')) {\n $queryTemp->whereRaw($this->_filterTable->query, $this->_filterTable->param);\n }\n\n $totalRecordQuery = $queryTemp->count();\n $this->_query->columns = $columnsTemp;\n\n $skip = ($pq_rPP * ($pq_curPage - 1));\n\n if ($skip >= $totalRecordQuery) {\n $pq_curPage = ceil($totalRecordQuery / $pq_rPP);\n $skip = ($pq_rPP * ($pq_curPage - 1));\n }\n\n // Make limit to query\n $this->_query->offset($skip)\n ->limit($pq_rPP);\n\n $this->_paginationLimit = [\n 'totalRecords' => $totalRecordQuery,\n 'curPage' => $pq_curPage,\n ];\n }\n }", "public function paging() {\n\t\t$pages = ceil($this->count('all') / $this->_page_length);\n\t\t$response = array('pages' => $pages, 'page' => $this->_on_page,'length' => $this->_page_length,'items' => $this->count('all'));\n\t\treturn (object) $response;\t\t\n\t}", "public function getPagination()\n {\n return $this->pagination;\n }", "function lastPage()\n\t\t{\n\t\t\t$this->currentPage = $this->numberOfPages();\n\t\t}", "public function getPaginationData($data){\n\n $pagination_arr = [];\n $products_json = $data->toJson();\n $products_json = json_decode($products_json,true);\n $pagination_arr['current_page'] = $products_json['current_page'];\n $pagination_arr['first_page_url'] = $products_json['first_page_url'];\n $pagination_arr['from'] = $products_json['from'];\n $pagination_arr['last_page'] = $products_json['last_page'];\n $pagination_arr['last_page_url'] = $products_json['last_page_url'];\n $pagination_arr['next_page_url'] = $products_json['next_page_url'];\n $pagination_arr['per_page'] = $products_json['per_page'];\n $pagination_arr['prev_page_url'] = $products_json['prev_page_url'];\n $pagination_arr['to'] = $products_json['to'];\n $pagination_arr['total'] = $products_json['total'];\n\n return $pagination_arr;\n }", "function pagination(){}", "private function lastPage() {\n $this->currentPageNumber--;\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->lastPage[\"vOffset\"];\n $this->hOffset = $this->lastPage[\"hOffset\"];\n }", "private function refreshNbPages()\n {\n $this->_nbPages = $this->_limit ? ceil($this->_count/$this->_limit) : 0;\n }", "public function getPagination()\n {\n return $this->pagination;\n }", "public function getPagination() {\n return $this->pagination_;\n }", "function Pagination() \n { \n $this->current_page = 1; \n $this->mid_range = 7; \n $this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp; \n }", "function _getPages(& $result, $maxpages = 20) \n {\n $pageParameter = $this->_http_parameters['page'];\n $pageNumber = $result->pageNumber;\n\n $numrows = $result->results;\n if ($numrows == 0) {\n return null;\n }\n $queryString = $result->getInfo('queryString');\n $from = $result->resultsPerPage * ($pageNumber -1);\n $limit = $result->resultsPerPage;\n // Total number of pages\n $pages = (int) ceil($numrows / $limit);\n $data['numpages'] = $pages;\n // first & last page\n $data['firstpage'] = 1;\n $data['lastpage'] = $pages;\n // Build pages array\n $data['pages'] = array ();\n $pageUrl = $_SERVER['PHP_SELF'].'?'.$queryString;\n $pageUrl = str_replace('&'.$pageParameter.'='.$pageNumber, '', $pageUrl);\n $data['firstpageurl'] = $pageUrl.'&'.$pageParameter.'='.\"1\";\n $data['lastpageurl'] = $pageUrl.'&'.$pageParameter.'='.$pages;\n $data['current'] = 0;\n for ($i = 1; $i <= $pages; $i ++) {\n $url = $pageUrl.'&'.$pageParameter.'='. ($i);\n $offset = $limit * ($i -1);\n $data['pages'][$i] = $url;\n // $from must point to one page\n if ($from == $offset) {\n // The current page we are\n $data['current'] = $i;\n }\n }\n // Limit number of pages (Google like display)\n if ($maxpages) {\n $radio = floor($maxpages / 2);\n $minpage = $data['current'] - $radio;\n if ($minpage < 1) {\n $minpage = 1;\n }\n $maxpage = $data['current'] + $radio -1;\n if ($maxpage > $data['numpages']) {\n $maxpage = $data['numpages'];\n }\n foreach (range($minpage, $maxpage) as $page) {\n $tmp[$page] = $data['pages'][$page];\n }\n $data['pages'] = $tmp;\n $data['maxpages'] = $maxpages;\n } else {\n $data['maxpages'] = null;\n }\n // Prev link\n $prev = $from - $limit;\n if ($prev >= 0) {\n $pageUrl = '';\n $pageUrl = $_SERVER['PHP_SELF'].'?'.$queryString;\n if (strpos($pageUrl, ''.$pageParameter.'='.$pageNumber)) {\n $pageUrl = str_replace(\n ''.$pageParameter.'='.$pageNumber, \n ''.$pageParameter.'='. ($pageNumber -1), \n $pageUrl);\n } else {\n $pageUrl .= '&'.$pageParameter.'='. ($pageNumber -1);\n }\n $data['prev'] = $pageUrl;\n } else {\n $data['prev'] = null;\n }\n // Next link\n $next = $from + $limit;\n if ($next < $numrows) {\n $pageUrl = '';\n $pageUrl = $_SERVER['PHP_SELF'].'?'.$queryString;\n if (strpos($pageUrl, ''.$pageParameter.'='.$pageNumber)) {\n $pageUrl = str_replace(\n ''.$pageParameter.'='.$pageNumber, \n ''.$pageParameter.'='. ($pageNumber +1), \n $pageUrl);\n } else {\n $pageUrl .= '&'.$pageParameter.'='. ($pageNumber +1);\n }\n $data['next'] = $pageUrl;\n } else {\n $data['next'] = null;\n }\n // Results remaining in next page & Last row to fetch\n if ($data['current'] == $pages) {\n $data['remain'] = 0;\n $data['to'] = $numrows;\n } else {\n if ($data['current'] == ($pages -1)) {\n $data['remain'] = $numrows - ($limit * ($pages -1));\n } else {\n $data['remain'] = $limit;\n }\n $data['to'] = $data['current'] * $limit;\n }\n $data['numrows'] = $numrows;\n $data['from'] = $from +1;\n $data['limit'] = $limit;\n return $data;\n }", "function shAddPaginationInfo($limit, $limitstart, $showall, $iteration, $url, $location, $shSeparator = null, $defaultListLimitValue = null,\n $suppressPagination = false)\n{\n\t$mainframe = JFactory::getApplication();\n\n\t$pageInfo = Sh404sefFactory::getPageInfo(); // get page details gathered by system plugin\n\t$sefConfig = Sh404sefFactory::getConfig();\n\t$database = ShlDbHelper::getDb();\n\n\t//echo 'Incoming pagination : $listLimit : ' . $listLimit . ' | $defaultListLimit : ' . $defaultListLimit . \"\\n\";\n\n\t// clean suffix and index file before starting to add things to the url\n\t// clean suffix\n\tif (strpos($url, 'option=com_content') !== false && strpos($url, 'format=pdf') !== false)\n\t{\n\t\t$shSuffix = '.pdf';\n\t}\n\telse\n\t{\n\t\t$shSuffix = $sefConfig->suffix;\n\t}\n\t$suffixLength = JString::strLen($shSuffix);\n\tif (!empty($shSuffix) && ($shSuffix != '/') && JString::substr($location, -$suffixLength) == $shSuffix)\n\t{\n\t\t$location = JString::substr($location, 0, JString::strlen($location) - $suffixLength);\n\t}\n\n\t// clean index file\n\tif ($sefConfig->addFile && (empty($shSuffix) || JString::subStr($location, -$suffixLength) != $shSuffix))\n\t{\n\t\t$indexFileLength = JString::strlen($sefConfig->addFile);\n\t\tif (($sefConfig->addFile != '/') && JString::substr($location, -$indexFileLength) == $sefConfig->addFile)\n\t\t{\n\t\t\t$location = JString::substr($location, 0, JString::strlen($location) - $indexFileLength);\n\t\t}\n\t}\n\n\t// get a default limit value, for urls where it's missing\n\t$listLimit = shGetDefaultDisplayNumFromURL($url, $includeBlogLinks = true);\n\t$defaultListLimit = is_null($defaultListLimitValue) ? shGetDefaultDisplayNumFromConfig($url, $includeBlogLinks = false) : $defaultListLimitValue;\n\n\t// do we have a trailing slash ?\n\tif (empty($shSeparator))\n\t{\n\t\t$shSeparator = (JString::substr($location, -1) == '/') ? '' : '/';\n\t}\n\n\tif (!$suppressPagination)\n\t{\n\t\t// start computing pagination\n\t\tif (!empty($limit) && is_numeric($limit))\n\t\t{\n\t\t\t$pagenum = intval($limitstart / $limit);\n\t\t\t$pagenum++;\n\t\t}\n\t\telse if (!isset($limit) && !empty($limitstart))\n\t\t{\n\t\t\t// only limitstart\n\t\t\tif (strpos($url, 'option=com_content') !== false && strpos($url, 'view=article') !== false)\n\t\t\t{\n\t\t\t\t$pagenum = intval($limitstart + 1); // multipage article\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pagenum = intval($limitstart / $listLimit) + 1; // blogs, tables, ...\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pagenum = $iteration;\n\t\t}\n\t\t// Make sure we do not end in infite loop here.\n\t\tif ($pagenum < $iteration)\n\t\t\t$pagenum = $iteration;\n\t\t// shumisha added to handle table-category and table-section which may have variable number of items per page\n\t\t// There still will be a problem with filter, which may reduce the total number of items. Thus the item we are looking for\n\t\tif ($sefConfig->alwaysAppendItemsPerPage || (strpos($url, 'option=com_virtuemart') && $sefConfig->shVmUsingItemsPerPage))\n\t\t{\n\t\t\t$shMultPageLength = $sefConfig->pagerep . (empty($limit) ? $listLimit : $limit);\n\t\t}\n\t\telse\n\t\t\t$shMultPageLength = '';\n\t\t// shumisha : modified to add # of items per page to URL, for table-category or section-category\n\n\t\tif (!empty($sefConfig->pageTexts[$pageInfo->currentLanguageTag])\n\t\t\t&& (false !== strpos($sefConfig->pageTexts[$pageInfo->currentLanguageTag], '%s'))\n\t\t)\n\t\t{\n\t\t\t$page = str_replace('%s', $pagenum, $sefConfig->pageTexts[$pageInfo->currentLanguageTag]) . $shMultPageLength;\n\t\t\tif ($sefConfig->LowerCase)\n\t\t\t{\n\t\t\t\t$page = JString::strtolower($page);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = $sefConfig->pagerep . $pagenum . $shMultPageLength;\n\t\t}\n\n\t\t// V 1.2.4.t special processing to replace page number by headings\n\t\t$shPageNumberWasReplaced = false;\n\t\tif (strpos($url, 'option=com_content') !== false && strpos($url, 'view=article') !== false && !empty($limitstart))\n\t\t{\n\t\t\t// this is multipage article - limitstart instead of limit in J1.5\n\t\t\tif ($sefConfig->shMultipagesTitle)\n\t\t\t{\n\t\t\t\tparse_str($url, $shParams);\n\t\t\t\tif (!empty($shParams['id']))\n\t\t\t\t{\n\t\t\t\t\t$shPageTitle = '';\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$contentElement = ShlDbHelper::selectObject('#__content', array('id', 'fulltext', 'introtext'),\n\t\t\t\t\t\t\tarray('id' => $shParams['id']));\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\tJError::raise(E_ERROR, 500, $e->getMessage());\n\t\t\t\t\t}\n\t\t\t\t\t$contentText = $contentElement->introtext . $contentElement->fulltext;\n\t\t\t\t\tif (!empty($contentElement) && (strpos($contentText, 'class=\"system-pagebreak') !== false))\n\t\t\t\t\t{\n\t\t\t\t\t\t// search for mospagebreak tags\n\t\t\t\t\t\t// copied over from pagebreak plugin\n\t\t\t\t\t\t// expression to search for\n\t\t\t\t\t\t$regex = '#<hr([^>]*)class=(\\\"|\\')system-pagebreak(\\\"|\\')([^>]*)\\/>#iU';\n\t\t\t\t\t\t// find all instances of mambot and put in $matches\n\t\t\t\t\t\t$shMatches = array();\n\t\t\t\t\t\tpreg_match_all($regex, $contentText, $shMatches, PREG_SET_ORDER);\n\t\t\t\t\t\t// adds heading or title to <site> Title\n\t\t\t\t\t\tif (empty($limitstart))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// if first page use heading of first mospagebreak\n\t\t\t\t\t\t\t/* if ( $shMatches[0][2] ) {\n\t\t\t\t\t\t\t parse_str( html_entity_decode( $shMatches[0][2] ), $args );\n\t\t\t\t\t\t\tif ( @$args['heading'] ) {\n\t\t\t\t\t\t\t$shPageTitle = stripslashes( $args['heading'] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{ // for other pages use title of mospagebreak\n\t\t\t\t\t\t\tif ($limitstart > 0 && $shMatches[$limitstart - 1][1])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$args = JUtility::parseAttributes($shMatches[$limitstart - 1][0]);\n\t\t\t\t\t\t\t\tif (@$args['title'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$shPageTitle = $args['title'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (@$args['alt'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$shPageTitle = $args['alt'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{ // there is a page break, but no title. Use a page number\n\t\t\t\t\t\t\t\t\t$shPageTitle = str_replace('%s', $limitstart + 1, $sefConfig->pageTexts[$pageInfo->currentLanguageTag]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($shPageTitle))\n\t\t\t\t\t{\n\t\t\t\t\t\t// found a heading, we should use that as a Title\n\t\t\t\t\t\t$location .= $shSeparator . titleToLocation($shPageTitle);\n\t\t\t\t\t}\n\t\t\t\t\t$shPageNumberWasReplaced = true; // always set the flag, otherwise we'll a Page-1 added\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// mutiple pages article, but we don't want to use smart title.\n\t\t\t\t// directly use limitstart\n\t\t\t\t$page = str_replace('%s', $limitstart + 1, $sefConfig->pageTexts[$pageInfo->currentLanguageTag]);\n\t\t\t}\n\t\t}\n\t\t// maybe this is a multipage with \"showall=1\"\n\t\tif (strpos($url, 'option=com_content') !== false && strpos($url, 'view=article') !== false && strpos($url, 'showall=1') !== false)\n\t\t{\n\t\t\t// this is multipage article with showall\n\t\t\t$tempTitle = JText::_('All Pages');\n\t\t\t$location .= $shSeparator . titleToLocation($tempTitle);\n\t\t\t$shPageNumberWasReplaced = true; // always set the flag, otherwise we'll a Page-1 added\n\t\t}\n\n\t\t// make sure we remove bad characters\n\t\t$takethese = str_replace('|', '', $sefConfig->friendlytrim);\n\t\t$location = JString::trim($location, $takethese);\n\n\t\t// add page number\n\t\tif (!$shPageNumberWasReplaced\n\t\t\t&& ((!isset($limitstart) && (isset($limit) && $limit != 1 && $limit != $listLimit && $limit != $defaultListLimit)) || !empty($limitstart))\n\t\t)\n\t\t{\n\t\t\t$location .= $shSeparator . $page;\n\t\t}\n\t}\n\t// add suffix\n\t$format = Sh404sefHelperUrl::getUrlVar($url, 'format');\n\t$shouldAddSuffix = empty($format) || $format == 'html';\n\tif ($shouldAddSuffix && !empty($shSuffix) && !empty($location) && $location != '/' && JString::substr($location, -1) != '/')\n\t{\n\t\t$location = $shSuffix == '/' ? $location . $shSuffix : str_replace($shSuffix, '', $location) . $shSuffix;\n\t}\n\n\t// add default index file\n\tif ($sefConfig->addFile)\n\t{\n\t\tif ((empty($shSuffix) || (!empty($shSuffix) && $shouldAddSuffix && JString::subStr($location, -$suffixLength) != $shSuffix)) && JString::substr($location, -1) == '/')\n\t\t{\n\t\t\t$location .= $sefConfig->addFile;\n\t\t}\n\t}\n\treturn JString::ltrim($location, '/');\n}", "protected function _calculatePageSize() {\r\n\r\n if (array_key_exists('next_collection_link', $this->data)) {\r\n\r\n $url = $this->data['next_collection_link'];\r\n\r\n $urlParts = parse_url($url);\r\n\r\n if (empty($urlParts['query'])) return $this->pageSize;\r\n\r\n $query = array();\r\n\r\n parse_str($urlParts['query'], $query);\r\n\r\n if (empty($query['ws_size'])) return $this->pageSize;\r\n\r\n $this->pageSize = $query['ws_size'];\r\n\r\n }\r\n\r\n return $this->pageSize;\r\n\r\n }", "public function pagination(){\n\t\treturn $this->dataInfos['XMLPM']['PAGINATION'];\n\t}", "protected function checkForMorePages()\n {\n $this->hasMore = $this->items->count() > $this->limit;\n\n $this->items = $this->items->slice(0, $this->limit);\n }", "public function getPerPage();", "private function setTotalPages()\r\n\t{\r\n\t\t$this->total_pages = ceil($this->num_rows / $this->rows_per_page);\r\n\t}", "public function getExtraPageData();", "function calcMaxPage($totalNoOfProducts,$noOfProductBoxesPerPage){\n\n // h max page (an spasw to result set twn proiontwn se 3-ades)\n // to indexing moy ksekina apo to 0 \n $maxPage = (floor($totalNoOfProducts / $noOfProductBoxesPerPage)) - 1;\n \n // to plhthos twn proiontwn sthn teleutai selida\n $numberOfProductsInLastPage = $totalNoOfProducts % $noOfProductBoxesPerPage;\n \n // an sto telos tou result set exw ypoloipo, exw allh mia skarth selida\n if ($numberOfProductsInLastPage > 0){\n \n $maxPage = $maxPage + 1;\n }\n \n return $maxPage;\n }", "function set_pagination(){\n\t\tif ($this->rpp>0)\n\t\t{\n\t\t\t$compensation= ($this->num_rowset % $this->rpp)>0 ? 1 : 0;\n\t\t\t$num_pages = (int)($this->num_rowset / $this->rpp) + $compensation;\n\t\t} else {\n\t\t\t$compensation = 0;\n\t\t\t$num_pages = 1;\n\t\t}\n\n\t\tif ($num_pages>1){\n\t\t\t$this->tpl->add(\"pagination\", \"SHOW\", \"TRUE\");\n\n\t\t\tfor ($i=0; $i<$num_pages; $i++){\n\t\t\t\t$this->tpl->add(\"page\", array(\n\t\t\t\t\t\"CLASS\"\t=> \"\",\n\t\t\t\t\t\"VALUE\"\t=> \"\",\n\t\t\t\t));\n\t\t\t\t$this->tpl->parse(\"page\", true);\n\t\t\t}\n\t\t}\n/*\n\t\t\t<patTemplate:tmpl name=\"pagination\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t<div class=\"pagination\">\n\t\t\t\t<ul>\t\n\t\t\t\t\t<patTemplate:tmpl name=\"prev_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li class=\"disablepage\"><a href=\"javascript: return false;\">« Предишна</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t\t<patTemplate:tmpl name=\"page\">\n\t\t\t\t\t<li {CLASS}>{VALUE}</li>\n\t\t\t\t\t</patTemplate:tmpl>\n<!--\n\t\t\t\t\t<li class=\"currentpage\">1</li>\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">2</a></li>\n\t\t\t\t\t<li><a href=\"?page=2&sort=date&type=desc\">3</a></li>\n//-->\n\t\t\t\t\t<patTemplate:tmpl name=\"next_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">Следваща »</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t</patTemplate:tmpl>\n*/\n\t}", "public function getPageSize();", "public function getItemsPerPage();", "public function getItemsPerPage();", "public function setPagination($limit, $offset = 0);", "private function getNumPages() {\n //display all in one page\n if (($this->limit < 1) || ($this->limit > $this->itemscount)) {\n $this->numpages = 1;\n } else {\n //Calculate rest numbers from dividing operation so we can add one\n //more page for this items\n $restItemsNum = $this->itemscount % $this->limit;\n //if rest items > 0 then add one more page else just divide items\n //by limit\n $restItemsNum > 0 ? $this->numpages = intval($this->itemscount / $this->limit) + 1 : $this->numpages = intval($this->itemscount / $this->limit);\n }\n }", "protected function paginate()\n {\n if ($this->currentItem == $this->pagerfanta->getMaxPerPage() and $this->pagerfanta->hasNextPage()) {\n $this->pagerfanta->setCurrentPage($this->pagerfanta->getNextPage());\n $this->loadData();\n }\n }", "public function can_return_a_collection_of_paginated_products()\n {\n $product1 = $this->create('Product');\n $product2 = $this->create('Product');\n $product3 = $this->create('Product');\n\n $response = $this->actingAs($this->create('User', [], false), 'api')->json('GET', '/api/products');\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => ['id','name','slug','price','created_at']\n ],\n\n 'links' => ['first', 'last', 'prev', 'next'],\n 'meta' => [\n 'current_page', 'last_page', 'from', 'to', 'path', 'per_page', 'total'\n ]\n ]);\n }", "public function load_more_promoted_products()\n {\n post_method();\n $offset = clean_number($this->input->post('offset', true));\n $promoted_products = get_promoted_products($offset, $this->promoted_products_limit);\n\n $data_json = array(\n 'result' => 0,\n 'html_content' => \"\",\n 'offset' => $offset + $this->promoted_products_limit,\n 'hide_button' => 0,\n );\n $html_content = \"\";\n if (!empty($promoted_products)) {\n foreach ($promoted_products as $product) {\n $vars = array('product' => $product, 'promoted_badge' => false);\n $html_content .= '<div class=\"col-6 col-sm-6 col-md-4 col-lg-3 col-product\">' . $this->load->view(\"product/_product_item\", $vars, true) . '</div>';\n }\n $data_json['result'] = 1;\n $data_json['html_content'] = $html_content;\n if ($offset + $this->promoted_products_limit >= get_promoted_products_count()) {\n $data_json['hide_button'] = 1;\n }\n }\n echo json_encode($data_json);\n }", "public function pagesize() { return 15; }", "function poco_woocommerce_pagination() {\n if (woocommerce_products_will_display()) {\n woocommerce_pagination();\n }\n }", "public function assign() {\r\n\t\t$this->current_page = parent::getCurrentPageNumber();\r\n\t\t$per_page = parent::getItemCountPerPage();\r\n\t\t\r\n\t\t// Busca o total de paginas\r\n\t\t$this->total_pages = (int)(parent::getTotalItemCount() / parent::getItemCountPerPage());\r\n\t\t$this->total_pages++;\r\n\t\t\r\n\t\t// Busca o total\r\n\t\t$this->total_items = parent::getTotalItemCount();\r\n\t\t\r\n\t\t// Verifica o total\r\n\t\tif($this->total_items % $per_page == 0) {\r\n\t\t\t$this->total_pages--;\r\n\t\t}\r\n\t\t\r\n\t\t// Busca a pagina anterior\r\n\t\t$this->previous_page = $this->current_page - 1;\r\n\t\tif($this->previous_page <= 0) {\r\n\t\t\t$this->previous_page = 1;\r\n\t\t}\r\n\t\t\r\n\t\t// Busca a proxima pagina \r\n\t\t$this->next_page = $this->current_page + 1;\r\n\t\tif($this->next_page > $this->total_pages) {\r\n\t\t\t$this->next_page = $this->total_pages;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function pageAction()\n {\n $page = $this->getRequest()->getParam('page', 1);\n $count = $this->getRequest()->getParam('count', 20);\n $collectionJson = Mage::helper('neklo_productposition/product')->getCollectionJson($page, $count);\n $this->getResponse()->setBody($collectionJson);\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n }", "public function totalPage();", "public function page($pagination_link, $values,$other_url){\n $total_values = count($values);\n $pageno = (int)(isset($_GET[$pagination_link])) ? $_GET[$pagination_link] : $pageno = 1;\n $counts = ceil($total_values/$this->limit);\n $param1 = ($pageno - 1) * $this->limit;\n $this->data = array_slice($values, $param1,$this->limit); \n \n \n if ($pageno > $this->total_pages) {\n $pageno = $this->total_pages;\n } elseif ($pageno < 1) {\n $pageno = 1;\n }\n if ($pageno > 1) {\n $prevpage = $pageno -1;\n $this->firstBack = array($this->functions->base_url_without_other_route().\"/$other_url/1\", \n $this->functions->base_url_without_other_route().\"/$other_url/$prevpage\");\n // $this->functions->base_url_without_other_route()./1\n // $this->firstBack = \"<div class='first-back'><a href='blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/1'>\n // <i class='fa fa-arrow-circle-o-left' aria-hidden='true'></i>&nbsp;First\n // </a> \n // <a href='blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/$prevpage'>\n // <i class='fa fa-arrow-circle-o-left' aria-hidden='true'></i>&nbsp;\n // prev\n // </a></div>\";\n }\n\n // $this->where = \"<div class='page-count'>(Page $pageno of $this->total_pages)</div>\";\n $this->where = \"page $pageno of $this->total_pages\";\n if ($pageno < $this->total_pages) {\n $nextpage = $pageno + 1;\n $this->nextLast = array($this->functions->base_url_without_other_route().\"/$other_url/$nextpage\",\n $this->functions->base_url_without_other_route().\"/$other_url/$this->total_pages\");\n // $this->nextLast = \"blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/$nextpage'>Next&nbsp;\n // <i class='fa fa-arrow-circle-o-right' aria-hidden='true'></i></a> \n // <a href='blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/$this->total_pages'>Last&nbsp;\n // <i class='fa fa-arrow-circle-o-right' aria-hidden='true'></i>\n // </a></div>\";\n }\n\n return $pageno;\n }", "function getFeatureProducts(){\n \n $itemonpage = !empty($_GET['per_page'])?$_GET['per_page']:3;\n $page = !empty($_GET['page'])?$_GET['page']:1;\n $offset= ($page-1)*$itemonpage;\n\n $numberPage = ceil(30/$itemonpage);\n \n $sql = self::$connection->prepare(\"SELECT * FROM products limit \".$itemonpage.\" offset \".$offset);\n \n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n include \"link.php\";\n return $items; //return an array\n }", "protected function buildPagination()\n {\n $this->calculateDisplayRange();\n $pages = [];\n for ($i = $this->displayRangeStart; $i <= $this->displayRangeEnd; $i++) {\n $pages[] = [\n 'number' => $i,\n 'offset' => ($i - 1) * $this->itemsPerPage,\n 'isCurrent' => $i === $this->currentPage\n ];\n }\n $pagination = [\n 'linkConfiguration' => $this->linkConfiguration,\n 'pages' => $pages,\n 'current' => $this->currentPage,\n 'numberOfPages' => $this->numberOfPages,\n 'lastPageOffset' => ($this->numberOfPages - 1) * $this->itemsPerPage,\n 'displayRangeStart' => $this->displayRangeStart,\n 'displayRangeEnd' => $this->displayRangeEnd,\n 'hasLessPages' => $this->displayRangeStart > 2,\n 'hasMorePages' => $this->displayRangeEnd + 1 < $this->numberOfPages\n ];\n if ($this->currentPage < $this->numberOfPages) {\n $pagination['nextPage'] = $this->currentPage + 1;\n $pagination['nextPageOffset'] = $this->currentPage * $this->itemsPerPage;\n }\n if ($this->currentPage > 1) {\n $pagination['previousPage'] = $this->currentPage - 1;\n $pagination['previousPageOffset'] = ($this->currentPage - 2) * $this->itemsPerPage;\n }\n return $pagination;\n }", "function set_pagination() {\n\t\tglobal $wp_query;\n\n\t\treturn (int) $wp_query->get( 'posts_per_page' );\n\t}", "function getPagingParameters()\n {\n }", "private function limit_page()\n {\n $page = $this->define_page();\n $start = $page * $this->count - $this->count;\n $fullnumber = $this->total;\n $total = $fullnumber['count'] / $this->count;\n is_float($total) ? $max = $total + 2 : $max = $total + 1;\n $array = array('start'=>(int)$start,'max'=>(int)$max);\n return $array;\n }", "public function getLastPage() {\n return (int)ceil($this->_itemsCount / $this->_itemsPerPage);\n }", "public function getPagination()\n {\n return $this->get(self::pagination);\n }", "public function boot(): AbstractPagination\n {\n $items = $this->filter($this->items);\n\n // calc stats by remaining items\n $this->items = $items;\n $this->itemCount = count($items);\n $this->maxPages = (int) ceil($this->itemCount / $this->itemsPerPage);\n $this->isEmpty = 0 === $this->itemCount;\n\n // set this pagination as booted\n $this->booted = true;\n\n return $this;\n }", "function paginate() {\n\t\t$all_rs = $this->db->query($this->sql );\n\t\t$this->total_rows = $all_rs->num_rows;\n\t\t\n\t\t//Return FALSE if no rows found\n\t\tif ($this->total_rows == 0) {\n\t\t\tif ($this->debug)\n\t\t\t\techo \"Query returned zero rows.\";\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//Max number of pages\n\t\t$this->max_pages = ceil($this->total_rows / $this->rows_per_page );\n\t\tif ($this->links_per_page > $this->max_pages) {\n\t\t\t$this->links_per_page = $this->max_pages;\n\t\t}\n\t\t\n\t\t//Check the page value just in case someone is trying to input an aribitrary value\n\t\tif ($this->page > $this->max_pages || $this->page <= 0) {\n\t\t\t$this->page = 1;\n\t\t}\n\t\t\n\t\t//Calculate Offset\n\t\t$this->offset = $this->rows_per_page * ($this->page - 1);\n\t\t\n\t\t//Fetch the required result set\n\t\t$rs = $this->db->query($this->sql . \" LIMIT {$this->offset}, {$this->rows_per_page}\" );\n\t\t$this->data = $rs->rows;\n\t}", "public function fetchData()\n {\n if (null === $this->data) {\n $adaptable = $this->getAdaptable();\n if ($adaptable instanceof \\ArrayObject) {\n $this->data = $adaptable->getArrayCopy();\n } else {\n $this->data = (array) $adaptable;\n }\n\n $page = $this->getPageNumber() - 1;\n $limit = $this->getItemsPerPage();\n $this->data = array_splice($this->data, $page * $limit, $limit);\n }\n }", "public function get_pagination() {\n\t\treturn $this->pagination();\n\t}", "public function SetNumPages()\n\t\t{\n\t\t\t$this->_pricenumpages = ceil($this->GetNumProducts() / GetConfig('CategoryProductsPerPage'));\n\t\t}", "public function getPerPage(): int;", "public function getPaginated();", "function jb_dripdeals_load_more_scripts()\n{\n\n global $wp_query;\n\n $args = array(\n 'post_type' => 'product',\n 'posts_per_page' => POST_PER_PAGE,\n);\n$products = new WP_Query($args);\n$variables = $products->query_vars;\n$page = $variables['paged'];\n\n//var_dump($products->max_num_pages);\n // In most cases it is already included on the page and this line can be removed\n wp_enqueue_script('jquery');\n\n wp_register_script('loadmore', get_stylesheet_directory_uri() . '/js/loadmore.js', array('jquery'));\n\n \n wp_localize_script('loadmore', 'jb_dripdeals_loadmore_params', array(\n 'ajaxurl' => site_url() . '/wp-admin/admin-ajax.php', // WordPress AJAX\n 'posts' => json_encode($variables), // everything about our loop is here\n 'current_page' => $page ? $page : 1,\n 'max_page' => $products->max_num_pages,\n ));\n\n wp_enqueue_script('loadmore');\n}", "public function getPaginate(){ }", "function bt_new_loop_shop_per_page( $cols ) {\n // $cols contains the current number of products per page based on the value stored on Options -> Reading\n // Return the number of products you wanna show per page.\n $cols = 12;\n return $cols;\n}", "function kvell_edge_woocommerce_products_per_page() {\n\t\t$products_per_page_meta = kvell_edge_options()->getOptionValue( 'edgtf_woo_products_per_page' );\n\t\t$products_per_page = ! empty( $products_per_page_meta ) ? intval( $products_per_page_meta ) : 12;\n\t\t\n\t\tif ( isset( $_GET['woo-products-count'] ) && $_GET['woo-products-count'] === 'view-all' ) {\n\t\t\t$products_per_page = 9999;\n\t\t}\n\t\t\n\t\treturn $products_per_page;\n\t}", "private function setLimitAndOffset()\n {\n $this->offset = ($this->page - 1) * $this->config->limit;\n if ($this->config->limit == 0) {\n $this->config->limit = count(self::$needles);\n }\n }", "public function Pages($max = null)\n {\n $result = new ArrayList();\n\n if ($max) {\n $start = ($this->CurrentPage() - floor($max / 2)) - 1;\n $end = $this->CurrentPage() + floor($max / 2);\n\n if ($start < 0) {\n $start = 0;\n $end = $max;\n }\n\n if ($end > $this->TotalPages()) {\n $end = $this->TotalPages();\n $start = max(0, $end - $max);\n }\n } else {\n $start = 0;\n $end = $this->TotalPages();\n }\n\n for ($i = $start; $i < $end; $i++) {\n $result->push(new ArrayData([\n 'PageNum' => $i + 1,\n 'Link' => HTTP::setGetVar(\n $this->getPaginationGetVar(),\n $i * $this->getPageLength(),\n ($this->request instanceof HTTPRequest) ? $this->request->getURL(true) : null\n ),\n 'CurrentBool' => $this->CurrentPage() == ($i + 1)\n ]));\n }\n\n return $result;\n }", "public function get_page_permastruct()\n {\n }", "private function calculate() {\n $currentPage = $this->getCurrentPageParameter();\n if ($currentPage < 1) {\n $currentPage = 1;\n }\n $lastPage = $this->getLastPage();\n if ($currentPage > $lastPage) {\n $currentPage = $lastPage;\n }\n $minimumPage = $currentPage - (int)floor($this->_buttonLimit / 2);\n if ($minimumPage + $this->_buttonLimit > $lastPage) {\n $minimumPage = $lastPage - $this->_buttonLimit + 1;\n }\n if ($minimumPage < 1) {\n $minimumPage = 1;\n }\n $maximumPage = $minimumPage + $this->_buttonLimit;\n if ($maximumPage > $lastPage) {\n $maximumPage = $lastPage;\n }\n $this->_currentPage = $currentPage;\n $this->_minimumPage = $minimumPage;\n $this->_maximumPage = $maximumPage;\n $this->_previousPage = ($currentPage > 1) ? $currentPage - 1 : 0;\n $this->_nextPage = ($currentPage >= $lastPage) ? $lastPage : $currentPage + 1;\n $this->_lastPage = $lastPage;\n }", "public function getCurrentPageData() {}", "private function prepareExternalProduct() {\n if ($this->getSaverData()->isFirstPage()) {\n $this->setPrice();\n $this->setSKU();\n $this->setEnableReviews();\n $this->setMenuOrder();\n $this->setExternalProductDetails();\n }\n\n $this->setTags();\n $this->setAttributes();\n }", "private function setNumberOfPages(): void\n {\n $this->number_of_pages = (int)ceil($this->number_of_records / $this->per_page);\n }", "public function maxPerPage($context = null);", "public function testPaginationSimpleLastPage()\n {\n // init\n $oPagination = new \\Pagination();\n $oPagination->setUrl('http://www.st.ro');\n $oPagination->setPage(20);\n $oPagination->setPerPage(10);\n $oPagination->setItemsNo(200);\n \n //run the test\n $this->invokeMethod($oPagination, 'compute');\n \n // asserts\n $this->assertEquals(20, $oPagination->getMaxPage());\n $this->assertEquals(2, $oPagination->getPrevPages());\n $this->assertEquals(0, $oPagination->getNextPages());\n $this->assertTrue($oPagination->getFirstPage());\n $this->assertFalse($oPagination->getLastPage());\n }", "function jb_dripdeals_loadmore_ajax_handler()\n{\n $args = json_decode(stripslashes($_POST['query']), true);\n $args['paged'] = $_POST['page'] + 1; // we need next page to be loaded\n $args['post_status'] = 'publish';\n\n\n //run the query\n $prop = new WP_Query($args);\n\n if ($prop->have_posts()):\n // run the loop\n \n \n while($prop->have_posts()) {\n $prop->the_post();\n $pid = get_the_ID();\n $product = wc_get_product($pid);\n ?>\n <div class=\"col-xl-4 col-lg-4 col-md-4 col-sm-6 margin product\">\n <div class=\"brand_box\">\n <a href=\"<?php the_permalink() ?>\">\n <img src=\"<?php the_post_thumbnail_url() ?>\" alt=\"<?php the_title()?>\" />\n <h3>₦<strong class=\"red\"><?php echo number_format($product->get_sale_price(), 2, '.', ','); ?></strong></h3>\n <span> <a href=\"<?php the_permalink() ?>\" ><?php the_title() ?></a></span>\n <i><img src=\"<?php echo get_theme_file_uri('images/star.png')?>\"/></i>\n <i><img src=\"<?php echo get_theme_file_uri('images/star.png')?>\"/></i>\n <i><img src=\"<?php echo get_theme_file_uri('images/star.png')?>\"/></i>\n <i><img src=\"<?php echo get_theme_file_uri('images/star.png')?>\"/></i>\n </a>\n </div>\n </div>\n <?php \n }\n endif;\n die; // here we exit the script and even no wp_reset_query() required!\n}", "public function setExtraPageData(array $data);", "function GetPagination($page, $perpage, $count) {\n $result = [];\n $result['page'] = $page > 0 ? $page - 1 : 0;\n $result['total'] = $count > $perpage ? $perpage : $count;\n $result['start'] = $result['page'] * $perpage;\n $last = $result['total'] + $result['start'];\n $result['last'] = $last > $count ? $count : $last;\n return $result;\n}", "protected function applyPaging()\n\t{\n\t\t$this->paginator->page = $this->page;\n\t\t$this->paginator->itemCount = count($this->dataSource);\n\n\t\tif ($this->wasRendered && $this->paginator->itemCount < 1 && !empty($this->filters)) {\n\t\t\t// NOTE: don't use flash messages (because you can't - header already sent)\n\t\t\t$this->getTemplate()->flashes[] = (object)array('message' => $this->translate('Used filters did not match any items.'),\n\t\t\t\t'type' => 'info',);\n\t\t}\n\t\t//@mzkTODO\n\t\t$this->dataSource->reduce($this->paginator->length, $this->paginator->offset);\n\t}", "public function getLastPage(): int;", "protected function _buildDataObject()\r\n\t{\r\n\t\t// Initialise variables.\r\n\t\t$data = new stdClass;\r\n\t\t\r\n\t\t$limitString = '&limit=' . $this->limit; // sh404 fix\r\n\t\t\r\n\t\t// Build the additional URL parameters string.\r\n\t\t$params = '';\r\n\t\tif (!empty($this->_additionalUrlParams))\r\n\t\t{\r\n\t\t\tforeach ($this->_additionalUrlParams as $key => $value)\r\n\t\t\t{\r\n\t\t\t\t$params .= '&' . $key . '=' . $value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$data->all = new JPaginationObject(JText::_('JLIB_HTML_VIEW_ALL'), $this->prefix);\r\n\t\tif (!$this->_viewall)\r\n\t\t{\r\n\t\t\t$data->all->base = '0';\r\n\t\t\t$data->all->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=');\r\n\t\t}\r\n\r\n\t\t// Set the start and previous data objects.\r\n\t\t$data->start = new JPaginationObject(JText::_('JLIB_HTML_START'), $this->prefix);\r\n\t\t$data->previous = new JPaginationObject(JText::_('JPREV'), $this->prefix);\r\n\r\n\t\tif ($this->get('pages.current') > 1)\r\n\t\t{\r\n\t\t\t$page = ($this->get('pages.current') - 2) * $this->limit;\r\n\r\n\t\t\t// Set the empty for removal from route\r\n\t\t\t//$page = $page == 0 ? '' : $page;\r\n\r\n\t\t\t$data->start->base = '0';\r\n\t\t\t$data->start->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=0');\r\n\t\t\t$data->previous->base = $page;\r\n\t\t\t$data->previous->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $page . $limitString);\r\n\t\t}\r\n\r\n\t\t// Set the next and end data objects.\r\n\t\t$data->next = new JPaginationObject(JText::_('JNEXT'), $this->prefix);\r\n\t\t$data->end = new JPaginationObject(JText::_('JLIB_HTML_END'), $this->prefix);\r\n\r\n\t\tif ($this->get('pages.current') < $this->get('pages.total'))\r\n\t\t{\r\n\t\t\t$next = $this->get('pages.current') * $this->limit;\r\n\t\t\t$end = ($this->get('pages.total') - 1) * $this->limit;\r\n\r\n\t\t\t$data->next->base = $next;\r\n\t\t\t$data->next->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $next . $limitString);\r\n\t\t\t$data->end->base = $end;\r\n\t\t\t$data->end->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $end . $limitString);\r\n\t\t}\r\n\r\n\t\t$data->pages = array();\r\n\t\t$stop = $this->get('pages.stop');\r\n\t\tfor ($i = $this->get('pages.start'); $i <= $stop; $i++)\r\n\t\t{\r\n\t\t\t$offset = ($i - 1) * $this->limit;\r\n\t\t\t// Set the empty for removal from route\r\n\t\t\t//$offset = $offset == 0 ? '' : $offset;\r\n\r\n\t\t\t$data->pages[$i] = new JPaginationObject($i, $this->prefix);\r\n\t\t\tif ($i != $this->get('pages.current') || $this->_viewall)\r\n\t\t\t{\r\n\t\t\t\t$data->pages[$i]->base = $offset;\r\n\t\t\t\t$data->pages[$i]->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $offset . $limitString);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function getPagination(){\n\t\tif (empty($this->_pagination))\t{\n\t\t\tjimport('joomla.html.pagination');\n\t\t\tif (!$this->_total) $this->getlistAdvertisers();\n\t\t\t$this->_pagination = new JPagination( $this->_total, $this->getState('limitstart'), $this->getState('limit') );\n\t\t}\n\t\treturn $this->_pagination;\n\t}", "function pager($current_page, $records_per_page, $pages_per_pageList, $dataQuery, $countQuery){\n $obj->record = array(); // beinhaltet ein Arrray des objects mit Daten wor&uuml;ber dann zugegriffen wird.\n $obj->current_page = $current_page; // Startet mit 0!\n $obj->total_cur_page = 0; // shows how many records belong to current page\n $obj->records_per_page = 0;\n $obj->total_records = 0;\n $obj->total_pages = 0;\n $obj->preceding = false; // Ist true wenn es eine Seite vor der angezeigten gibt.\n $obj->subsequent = false; // Ist true wenn es eine Seite nach der angezeigten gibt.\n $obj->pages_per_pageList = 10; //$pages_per_pageList;\n $result=mysql_query($countQuery, $this->CONNECTION);\n $obj->total_records = mysql_num_rows($result);\n if($obj->total_records>0){\n $obj->record = $this->select($dataQuery);\n $obj->total_cur_page = sizeof($obj->record);\n $obj->records_per_page = $records_per_page;\n $obj->total_pages = ceil($obj->total_records/$records_per_page);\n $obj->offset_page = $obj->pages_per_pageList*floor($obj->current_page/$obj->pages_per_pageList);\n $obj->total_pages_in_pageList = $obj->total_pages-($obj->offset_page+$obj->pages_per_pageList);\n $obj->last_page_in_pageList = $obj->offset_page+$obj->pages_per_pageList;\n if($obj->last_page_in_pageList>$obj->total_pages) $obj->last_page_in_pageList=$obj->total_pages;\n if($obj->offset_page>0) $obj->pageList_preceding=true;\n else $obj->pageList_preceding=false;\n if($obj->last_page_in_pageList<$obj->total_pages) $obj->pageList_subsequent=true;\n else $obj->pageList_subsequent=false;\n if($obj->current_page>1) $obj->preceding=true;\n if($obj->current_page<$obj->total_pages) $obj->subsequent=true;\n }\n return $obj;\n }", "function MyMod_Paging_NPages_Set()\n {\n if ($this->NumberOfItems>$this->NItemsPerPage)\n {\n $this->MyMod_Paging_N=intval($this->NumberOfItems/$this->NItemsPerPage);\n $res=$this->NumberOfItems % $this->NItemsPerPage;\n if ($res>0) { $this->MyMod_Paging_N++; }\n }\n elseif ($this->NumberOfItems>0)\n {\n $this->MyMod_Paging_N=1;\n }\n else\n {\n $this->MyMod_Paging_N=0;\n }\n }", "protected function _getMaxResultsPerPage() {\r\n return 500;\r\n }", "function __construct()\n {\n //$this->pagination_params['fields'] = \"product_flash_sale_id,product_flash_sale_category_id,product_flash_sale_subcategory_id,product_flash_sale_childcategory_id,product_flash_sale_name,product_flash_sale_stock,product_flash_sale_price,CONCAT(product_flash_sale_image_path,product_flash_sale_image) AS product_flash_sale_image,product_flash_sale_status\";\n //$this->pagination_params['fields'] = \"product_flash_sale_id,product_flash_sale_category_id,product_flash_sale_name,product_flash_sale_is_featured,product_flash_sale_status\";\n $this->pagination_params['fields'] = \"product_flash_sale_id,product_flash_sale_status\";\n\n\n /*\n $this->pagination_params['joins'][] = array(\n \"table\"=>\"category as pcat\",\n \"joint\"=>\"pcat.category_id = product_flash_sale.product_flash_sale_category_id\"\n );\n\n\n\n $this->pagination_params['joins'][] = array(\n \"table\"=>\"category as scat\",\n \"joint\"=>\"scat.category_id = product_flash_sale.product_flash_sale_subcategory_id\"\n );\n\n\n\n $this->pagination_params['joins'][] = array(\n \"table\"=>\"category as ccat\",\n \"joint\"=>\"ccat.category_id = product_flash_sale.product_flash_sale_childcategory_id\"\n );\n\n */\n\n /* $this->pagination_params['joins'][] = array(\n \"table\"=>\"category\" ,\n \"joint\"=>\"category.category_id = product_flash_sale.product_flash_sale_category_id\",\n // add left to get import records\n \"type\"=>\"left\"\n );*/\n\n\n /*$this->relations['product_flash_sale_price'] = array(\n \"type\" =>\"has_many\",\n \"own_key\" =>\"pp_product_flash_sale_id\",\n \"other_key\"=>\"pp_price_id\",\n );\n\n\n $this->relations['product_flash_sale_color'] = array(\n \"type\"=>\"has_many\",\n \"own_key\"=>\"mba_product_flash_sale_id\", // item_category column\n \"other_key\"=>\"mba_color_id\", // item_category column\n );*/\n\n /*$this->relations['product_flash_sale_prep_size'] = array(\n \"type\" =>\"has_many\",\n \"own_key\" =>\"pp_product_flash_sale_id\",\n \"other_key\"=>\"pp_prep_id\",\n );*/\n\n $this->relations['product_sale'] = array(\n \"type\"=>\"has_many\",\n \"own_key\"=>\"mba_flash_sale_id\", // item_category column\n \"other_key\"=>\"mba_product_id\", // item_category column\n );\n\n parent::__construct();\n\n }", "public function getPaginatedData()\n {\n return $this->paginatedData;\n }", "public function GetRecentNewsPaginate() {\n if(isset($_GET['pagPage'])){\n try {\n $paginationPage = $_GET['pagPage'];\n $model = new News(Database::instance());\n $paginationData = $model->GetRecentPostsPagination($paginationPage);\n\n $this->json($paginationData);\n } catch (\\PDOException $ex) {\n $this->errorLog(\"GetRecentNewsPaginate()25\", $ex->getMessage());\n\n }\n } else {\n //u slucaju da nema parametar kroz url dobija vrdnost 0 i ispisuje prvih 5 recent news na home page\n try {\n $paginationPage = 0;\n $model = new News(Database::instance());\n $paginationData = $model->GetRecentPostsPagination($paginationPage);\n\n $this->json($paginationData);\n } catch (\\PDOException $ex) {\n $this->errorLog(\"GetRecentNewsPaginate()37\", $ex->getMessage());\n }\n\n }\n\n }", "public function pages()\n\t{\n\t\treturn ceil($this->_count_total / $this->config['total_items']);\n\t}", "public function getPaginate ($p_rowsPerPage, $p_currentPage);", "protected function fillPaginationParameters($data)\r\n {\r\n if ($order = $this->getOrder()) {\r\n $data['order'] = $order;\r\n }\r\n\r\n if ($sinceToken = $this->getSinceToken()) {\r\n $data['since_token'] = $sinceToken;\r\n }\r\n\r\n return $data;\r\n }", "public function getLastPage()\n {\n return $this->request->param('paging.' . $this->pagingType . '.pageCount');\n }", "public function pageEnd() {\r\n\t\t$intReturn = ($this->getCurrentPage() * $this->__pageItems);\r\n\t\tif ($intReturn > count($this->collection)) $intReturn = count($this->collection);\r\n\r\n\t\treturn $intReturn;\r\n\t}", "function getPaginator(){\n\n/// getPaginator Function Code Starts ///\n\n$per_page = 6;\n\nglobal $db;\n\n$aWhere = array();\n\n$aPath = '';\n\n/// Manufacturers Code Starts ///\n\nif(isset($_REQUEST['man'])&&is_array($_REQUEST['man'])){\n\nforeach($_REQUEST['man'] as $sKey=>$sVal){\n\nif((int)$sVal!=0){\n\n$aWhere[] = 'manufacturer_id='.(int)$sVal;\n\n$aPath .= 'man[]='.(int)$sVal.'&';\n\n}\n\n}\n\n}\n\n/// Manufacturers Code Ends ///\n\n/// Products Categories Code Starts ///\n\nif(isset($_REQUEST['p_cat'])&&is_array($_REQUEST['p_cat'])){\n\nforeach($_REQUEST['p_cat'] as $sKey=>$sVal){\n\nif((int)$sVal!=0){\n\n$aWhere[] = 'p_cat_id='.(int)$sVal;\n\n$aPath .= 'p_cat[]='.(int)$sVal.'&';\n\n}\n\n}\n\n}\n\n/// Products Categories Code Ends ///\n\n/// Categories Code Starts ///\n\nif(isset($_REQUEST['cat'])&&is_array($_REQUEST['cat'])){\n\nforeach($_REQUEST['cat'] as $sKey=>$sVal){\n\nif((int)$sVal!=0){\n\n$aWhere[] = 'cat_id='.(int)$sVal;\n\n$aPath .= 'cat[]='.(int)$sVal.'&';\n\n}\n\n}\n\n}\n\n/// Categories Code Ends ///\n\n$sWhere = (count($aWhere)>0?' WHERE '.implode(' or ',$aWhere):'');\n\n$query = \"select * from products \".$sWhere;\n\n$result = mysqli_query($db,$query);\n\n$total_records = mysqli_num_rows($result);\n\n$total_pages = ceil($total_records / $per_page);\n\necho \"<li><a href='shop.php?page=1\";\n\nif(!empty($aPath)){ echo \"&\".$aPath; }\n\necho \"' >\".'First Page'.\"</a></li>\";\n\nfor ($i=1; $i<=$total_pages; $i++){\n\necho \"<li><a href='shop.php?page=\".$i.(!empty($aPath)?'&'.$aPath:'').\"' >\".$i.\"</a></li>\";\n\n};\n\necho \"<li><a href='shop.php?page=$total_pages\";\n\nif(!empty($aPath)){ echo \"&\".$aPath; }\n\necho \"' >\".'Last Page'.\"</a></li>\";\n\n/// getPaginator Function Code Ends ///\n\n}", "public function testPaginationSimpleBeforeLastPage()\n {\n // init\n $oPagination = new \\Pagination();\n $oPagination->setUrl('http://www.st.ro');\n $oPagination->setPage(19);\n $oPagination->setPerPage(10);\n $oPagination->setItemsNo(200);\n \n //run the test\n $this->invokeMethod($oPagination, 'compute');\n \n // asserts\n $this->assertEquals(20, $oPagination->getMaxPage());\n $this->assertEquals(2, $oPagination->getPrevPages());\n $this->assertEquals(1, $oPagination->getNextPages());\n $this->assertTrue($oPagination->getFirstPage());\n $this->assertFalse($oPagination->getLastPage());\n }", "public function setPagination($pagination) {\n $this->pagination_ = $pagination;\n $this->results_ = null;\n }", "function redart_pagination( $query = false, $load_more = false ){\r\n\t$wp_query = redart_global_variables('wp_query');\t\r\n\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : ( ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1 );\r\n\r\n\t// default $wp_query\r\n\tif( $query ) $wp_query = $query;\r\n\r\n\t$wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; \r\n\t\r\n\tif( empty( $paged ) ) $paged = 1;\r\n\t$prev = $paged - 1;\r\n\t$next = $paged + 1;\r\n\r\n\t$end_size = 1;\r\n\t$mid_size = 2;\r\n\t$show_all = redart_option('general','showall-pagination');\r\n\t$dots = false;\r\n\r\n\tif( ! $total = $wp_query->max_num_pages ) $total = 1;\r\n\t\r\n\t$output = '';\r\n\tif( $total > 1 )\r\n\t{\r\n\t\tif( $load_more ){\r\n\t\t\t// ajax load more -------------------------------------------------\r\n\t\t\tif( $paged < $total ){\r\n\t\t\t\t$output .= '<div class=\"column one pager_wrapper pager_lm\">';\r\n\t\t\t\t\t$output .= '<a class=\"pager_load_more button button_js\" href=\"'. get_pagenum_link( $next ) .'\">';\r\n\t\t\t\t\t\t$output .= '<span class=\"button_icon\"><i class=\"icon-layout\"></i></span>';\r\n\t\t\t\t\t\t$output .= '<span class=\"button_label\">'. esc_html__('Load more', 'redart') .'</span>';\r\n\t\t\t\t\t$output .= '</a>';\r\n\t\t\t\t$output .= '</div>';\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// default --------------------------------------------------------\t\r\n\t\t\t$output .= '<div class=\"column one pager_wrapper\">';\r\n\r\n\t\t\t\t$big = 999999999; // need an unlikely integer\r\n\t\t\t\t$args = array(\r\n\t\t\t\t\t'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),\r\n\t\t\t\t\t'total' => $wp_query->max_num_pages,\r\n\t\t\t\t\t'current' => max( 1, get_query_var('paged') ),\r\n\t\t\t\t\t'show_all' => $show_all,\r\n\t\t\t\t\t'end_size' => $end_size,\r\n\t\t\t\t\t'mid_size' => $mid_size,\r\n\t\t\t\t\t'prev_next' => true,\r\n\t\t\t\t\t'prev_text' => '<i class=\"fa fa-angle-double-left\"></i>'.esc_html__('Prev', 'redart'),\r\n\t\t\t\t\t'next_text' => esc_html__('Next', 'redart').'<i class=\"fa fa-angle-double-right\"></i>',\r\n\t\t\t\t\t'type' => 'list'\r\n\t\t\t\t);\r\n\t\t\t\t$output .= paginate_links( $args );\r\n\r\n\t\t\t$output .= '</div>'.\"\\n\";\r\n\t\t}\r\n\t}\r\n\treturn $output;\r\n}", "public function paginateLatestQueries($page = 1, $perPage = 15);", "public function getPagination() : int\n {\n\n return $this->pagination;\n }", "private function exportProducts(){\n Product::initStore($this->store_settings->store_name, config('shopify.api_key'), $this->store_settings->access_token);\n $products_count = Product::count();\n $products_per_page = 250;\n $number_of_pages = ceil($products_count/$products_per_page);\n $all_products = [];\n $products = [];\n //to init start time\n ShopifyApiThrottle::init();\n for( $page = 1; $page <= $number_of_pages; $page++ ){\n //wait for some time so it doesn't reach throttle point\n if( $page > 1 ){ ShopifyApiThrottle::wait(); }\n\n $products = Product::all([\n 'limit' => $products_per_page,\n 'page' => $page\n ]);\n if($products)\n $all_products = array_merge($all_products, $products);\n //to re-init start time\n ShopifyApiThrottle::init();\n }\n return $all_products;\n }", "public function do_paging()\n {\n }", "function so22835795_loop_shop_per_page() {\n return -1; //return any number, -1 === show all\n }", "private function paginate()\n\t{\n\t\tif ($this->_listModel) {\n\t\t\t$this->_listModel->loadNextPage();\n\t\t}\n\t}", "protected function getPageSize()\n\t{\n\t\treturn $this->showPager() ? $this->getProductsPerPage() : $this->getProductsCount();\n\t}" ]
[ "0.6617372", "0.6617372", "0.64528716", "0.62495255", "0.6187624", "0.6144755", "0.6065227", "0.6059052", "0.6040978", "0.60401154", "0.6014538", "0.59953827", "0.59746003", "0.5961514", "0.59560186", "0.5917216", "0.5902409", "0.5865036", "0.5863645", "0.5846291", "0.5845641", "0.58447725", "0.58423233", "0.5819702", "0.58160365", "0.58134633", "0.58086073", "0.58074284", "0.5768882", "0.5760704", "0.57562166", "0.5722995", "0.5722995", "0.5719992", "0.57190096", "0.5717731", "0.57174456", "0.57138103", "0.5674665", "0.566881", "0.5666858", "0.5665165", "0.56594217", "0.56519204", "0.56487954", "0.56357586", "0.5629619", "0.5618628", "0.5585957", "0.5584531", "0.5579849", "0.55788934", "0.5571792", "0.55583215", "0.5556207", "0.5541286", "0.5538", "0.55292124", "0.55240786", "0.551653", "0.55159706", "0.551196", "0.5511213", "0.5506305", "0.54993194", "0.5491691", "0.5485229", "0.5479001", "0.54753155", "0.54737645", "0.5469446", "0.54663587", "0.5455548", "0.5453945", "0.5452431", "0.5450693", "0.5446622", "0.54450095", "0.5434283", "0.5430184", "0.54257816", "0.54231256", "0.5406229", "0.5403279", "0.5395013", "0.5393733", "0.53929645", "0.53838766", "0.5382382", "0.53778434", "0.53772485", "0.53757626", "0.5373757", "0.53729486", "0.5371889", "0.5367677", "0.53670853", "0.5366993", "0.5363761", "0.5361054" ]
0.62032133
4
Get data and pass to command handler.
public function execute(InputInterface $input, OutputInterface $output) { $item = $input->getArgument('item'); $namespace = 'Petrol'; $petrol_path = $this->findPetrolPath(); $data = new MakeData($item, $namespace, $petrol_path); $handler = new MakeHandler($input, $output); $handler->handle($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleGetData()\n\t{\n\t\t$data = $this->getData();\n\t\t$options = $this->getOptions();\n\n\t\t$this->presenter->sendResponse(\n\t\t\tnew JsonResponse(\n\t\t\t\t[\n\t\t\t\t\t\"data\" => $data,\n\t\t\t\t\t\"options\" => $options,\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\t}", "protected abstract function _commandHandler(string $command, $data_array);", "public function handleData();", "private function get_command(){\n if (!isset($_POST['command'])) {\n die(\"No command received, no result\");\n }\n $this->command = $_POST['command'];\n }", "public function handle($data);", "public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}", "protected abstract function handleData();", "public function getDataAction () {\n\t\t$this->getAnswer();\n\t}", "public function getDataAction () {\n\t\t$this->getAnswer();\n\t}", "public function doProcessData() {}", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->data = $this->data['value'];\r\r\n }\r\r\n }", "abstract function getdata();", "function get_data()\n {\n }", "function getData()\r\n {\r\n //if POST or PUT get the data wiht file_get_contents\r\n if ($this->request === \"POST\" || $this->request === \"PUT\") {\r\n $this->preCleanData = JSON_decode(file_get_contents(\"php://input\"));\r\n //else get the ID from $_get\r\n } else if ($this->request === \"GET\" || $this->request === \"DELETE\") {\r\n if (isset($_GET['ID'])) {\r\n $this->data = $_GET['ID'];\r\n return;\r\n } else {\r\n return;\r\n }\r\n }\r\n $this->cleanData();\r\n }", "protected function obtainData()\n\t{\n\t\t$this->obtainDataReferences();\n\t\t$this->obtainDataOrders();\n\t}", "public function processData() {}", "protected function getData() { }", "abstract public function get__do_process ( $data );", "public function getData() {}", "public function get_data();", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public static function getData() {}", "protected function setGetData()\n\t{\n\t\t$this->request->addParams($this->query->getParams());\n\t}", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData()\r\n {\r\n }", "public function processGet() {\n if (!isset($this->arguments[\"data\"])) {\n $this->inmueblesDestacados();\n } else if (is_numeric($this->arguments[\"data\"])) {\n $this->view((int) $this->arguments[\"data\"]);\n } else {\n $this->findByfilters($this->arguments[\"data\"]);\n }\n }", "protected function loadData()\n\t{\n\t\t$delimiter = \"|||---|||---|||\";\n\t\t$command = 'show --pretty=format:\"%an'.$delimiter.'%ae'.$delimiter.'%cd'.$delimiter.'%s'.$delimiter.'%B'.$delimiter.'%N\" ' . $this->hash;\n\n\t\t$response = $this->repository->run($command);\n\n\t\t$parts = explode($delimiter,$response);\n\t\t$this->_authorName = array_shift($parts);\n\t\t$this->_authorEmail = array_shift($parts);\n\t\t$this->_time = array_shift($parts);\n\t\t$this->_subject = array_shift($parts);\n\t\t$this->_message = array_shift($parts);\n\t\t$this->_notes = array_shift($parts);\n\t}", "public function run()\n {\n //\n $this->grabData();\n }", "protected static function getData()\n {\n }", "function handle($client, $data)\n {\n debug(\"Got data: \" . $data);\n return \"Thanks for ${data}!\\n\";\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "abstract public function getMenuData();", "public function dataReceived($data);", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n // All keys are srings in array, merge it with defaults to override\r\r\n $this->e_data = array_merge($this->default_options, $this->e_data);\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "public function getCommand() {}", "public function get_data($handle, $key)\n {\n }", "private function _get_data($command) {\n\t\t$this->warning = '';\n\t\t\n\t\t//The URL to get the data\n\t\tif ($command == 'handshake') {\n\t\t\t$url = 'http://'.$this->ip_address.'/'.$command.'/';\n\t\t} else {\n\t\t\t$url = 'http://'.$this->ip_address.'/'.$this->password.'/'.$command.'/';\n\t\t}\n\t\t\n\t\t//Only use for debugging since the password is in PLAIN TEXT!!\n\t\t//echo $url.'<br/>';\n\t\t\n\t\t//Load the data in json format\n\t\tunset ($this->json);\n\t\t$this->json = file_get_contents($url);\n\t\t$this->json = str_replace(\"hu-\", \"hu_min\", $this->json);\n\t\t$this->json = str_replace(\"te-\", \"te_min\", $this->json);\n\t\t$this->json = str_replace(\"hu+\", \"hu_plus\", $this->json);\n\t\t$this->json = str_replace(\"te+\", \"te_plus\", $this->json);\n\t\t\n\t\t//Reset the last data and fill it again\n\t\tunset ($this->raw);\n\t\t$this->raw = json_decode($this->json);\n\t\t\n\t\t//Did we get the data and is all ok?\n\t\tif (isset($this->raw->status) && $this->raw->status == 'ok') {\n\t\t\t//Version as this class was written on?\t\t\t\n\t\t\tif ($this->raw->version != $this->_version) {\t\t\t\t\n\t\t\t\t$this->warning = \"<b>This homewizard class was written for version \".$this->_version.\". Results can be in error!</b><br/>\\n\";\n\t\t\t}\n\t\t\n\t\t\t$this->status = true;\n\t\t\t$this->version = $this->raw->version;\n\t\t\t$this->last_update = date('d-m-Y H:i:s');\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->status = false;\n\t\t\t$this->version = '';\n\t\t\treturn false;\n\t\t}\n\t}", "public function getData()\n {\n }", "function getData();", "public function retrieveData(){\n\t\t$mParser = new RecipeParser;\n\t\t$mParser->retrieveInfoForObject($this);\n\t}", "public function data($args, $assocArgs = [])\n {\n /**\n * @var array $aliases\n * @var array $actions\n */\n extract($this->parseArgs($args));\n\n $this->fetchSyncData($aliases[0], $actions);\n \\WP_CLI::line(json_encode($this->syncData[$aliases[0]], JSON_PRETTY_PRINT));\n }", "public function getProcessData()\n {\n }", "public static function getCommandData($input) {\n $response = false;\n if (isset($input['hostname']) && isset($input['commandcode'])) {\n $url = self::getUrl('getcommanddata');\n $request = Array(\n \"data\" => Array(\n \"hostname\" => $input['hostname'],\n \"commandcode\" => $input['commandcode']\n )\n );\n $request = json_encode($request);\n $response = self::getApiResponse($url, $request);\n $response = json_decode($response, true);\n if (isset($response['data'])) {\n $response = $response['data'];\n } else {\n return false;\n }\n }\n return $response;\n }", "protected function process($data) {\n return $data;\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function getData()\n {\n }", "public function GetData();", "function get_data() {\r\n return $this->data;\r\n }", "abstract protected function getCommand();", "public function getIncomingData() {}", "private function getData()\n {\n if (isset($this->data)) {\n return $this->data;\n }\n\n return $this->data = Entry::find($this->context->get('id'));\n }", "public function get_data()\n {\n\n\n }", "abstract protected function data();", "function processData() ;", "protected function ProcessHookData()\n {\n if ($_IPS['SENDER'] == 'Execute') {\n echo 'This script cannot be used this way.';\n return;\n }\n\n if ((IPS_GetProperty($this->InstanceID, 'Username') != '') || (IPS_GetProperty($this->InstanceID, 'Password') != '')) {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n $_SERVER['PHP_AUTH_USER'] = '';\n }\n if (!isset($_SERVER['PHP_AUTH_PW'])) {\n $_SERVER['PHP_AUTH_PW'] = '';\n }\n\n if (($_SERVER['PHP_AUTH_USER'] != IPS_GetProperty($this->InstanceID, 'Username')) || ($_SERVER['PHP_AUTH_PW'] != IPS_GetProperty($this->InstanceID, 'Password'))) {\n header('WWW-Authenticate: Basic Realm=\"Geofency WebHook\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Authorization required';\n return;\n }\n }\n\n if (!isset($_GET['id'])) {\n die('Missing parameter: id');\n }\n\n $id = intval($_GET['id']);\n\n if (!$this->IsAllowedObject($id)) {\n echo 'This id is not allowed';\n return;\n }\n\n if (!IPS_VariableExists($id) && !IPS_MediaExists($id)) {\n echo 'Invalid VariableID/MediaID';\n return;\n }\n\n $startTime = time();\n if (isset($_GET['startTime']) && $_GET['startTime'] != '') {\n $startTime = intval($_GET['startTime']);\n }\n\n /*\n * 0 = Hour\n * 1 = Day\n * 2 = Week\n * 3 = Month\n * 4 = Year\n * 5 = Decade\n *\n */\n $timeSpan = 4;\n if (isset($_GET['timeSpan'])) {\n $timeSpan = intval($_GET['timeSpan']);\n }\n\n if (isset($_GET['isRawDensity']) && intval($_GET['isRawDensity'])) {\n $density = 2;\n } elseif (isset($_GET['isHighDensity']) && intval($_GET['isHighDensity'])) {\n $density = 1;\n } else {\n $density = 0;\n }\n\n $isExtrema = false;\n if (isset($_GET['isExtrema'])) {\n $isExtrema = intval($_GET['isExtrema']);\n }\n\n $isDynamic = false;\n if (isset($_GET['isDynamic'])) {\n $isDynamic = intval($_GET['isDynamic']);\n }\n\n $isContinuous = false;\n if (isset($_GET['isContinuous'])) {\n $isContinuous = intval($_GET['isContinuous']);\n }\n\n $width = 800;\n if (isset($_GET['width']) && intval($_GET['width']) > 0) {\n $width = intval($_GET['width']);\n }\n\n $height = 600;\n if (isset($_GET['height']) && intval($_GET['height']) > 0) {\n $height = intval($_GET['height']);\n }\n\n $showTitle = true;\n if (isset($_GET['showTitle'])) {\n $showTitle = intval($_GET['showTitle']);\n }\n\n $showLegend = true;\n if (isset($_GET['showLegend'])) {\n $showLegend = intval($_GET['showLegend']);\n }\n\n //Calculate proper startTime\n if ($isContinuous) {\n switch ($timeSpan) {\n case 0: //Hour\n $startTime = mktime(intval(date('H', $startTime)) - 1, intval(floor(intval(date('i', $startTime)) / 5) * 5 + 5), 0, intval(date('m', $startTime)), intval(date('d', $startTime)), intval(date('Y', $startTime)));\n break;\n case 1: //Day\n $startTime = mktime(intval(date('H', $startTime)) + 1, 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)) - 1, intval(date('Y', $startTime)));\n break;\n case 2: //Week\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)) - 7 + 1, intval(date('Y', $startTime)));\n break;\n case 3: //Month\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)) - 1, intval(date('d', $startTime)) + 1, intval(date('Y', $startTime)));\n break;\n case 4: //Year\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)) + 1, 1, intval(date('Y', $startTime)) - 1);\n break;\n case 5: //Decade\n $startTime = mktime(0, 0, 0, 1, 1, intval(date('Y', $startTime)) - 9);\n break;\n default:\n echo 'Invalid timespan';\n\n return;\n }\n } else {\n switch ($timeSpan) {\n case 0: //Hour\n $startTime = mktime(intval(date('H', $startTime)), 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)), intval(date('Y', $startTime)));\n break;\n case 1: //Day\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)), intval(date('Y', $startTime)));\n break;\n case 2: //Week\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)) - intval(date('N', $startTime)) + 1, intval(date('Y', $startTime)));\n break;\n case 3: //Month\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)), 1, intval(date('Y', $startTime)));\n break;\n case 4: //Year\n $startTime = mktime(0, 0, 0, 1, 1, intval(date('Y', $startTime)));\n break;\n case 5: //Decade\n $startTime = mktime(0, 0, 0, 1, 1, floor(intval(date('Y', $startTime)) / 10) * 10);\n break;\n default:\n echo 'Invalid timespan';\n\n return;\n }\n }\n\n $css = file_get_contents(__DIR__ . '/style.css');\n\n //Add CSS for multi charts\n if (IPS_MediaExists($id)) {\n $css .= PHP_EOL . PHP_EOL;\n $css .= $this->BuildCSSForMultiChart($id);\n }\n\n $legend = '';\n if ($showLegend) {\n if (IPS_MediaExists($id)) {\n $legend = $this->BuildLegendForMultiChart($id) . '<br/>';\n } else {\n $legend = 'Name: ' . IPS_GetName($id) . '<br/>';\n }\n }\n\n $acID = IPS_GetInstanceListByModuleID('{43192F0B-135B-4CE7-A0A7-1475603F3060}')[0];\n $chart = AC_RenderChart($acID, $id, $startTime, $timeSpan, $density, $isExtrema, $isDynamic, $width, $height);\n\n //Translate strings\n $chart = $this->TranslateChart($chart);\n\n //Bail out on error\n if ($chart === false) {\n return;\n }\n\n $title = '';\n if ($showTitle) {\n $title = $this->Translate('Start time') . ': ' . date('d.m.Y H:i', $startTime) . '<br/>';\n }\n\n echo <<<EOT\n<html>\n<head><style>body { background: black; color: white; font-family: Verdana } $css</style></head>\n<body>\n<div class=\"ipsChart\">\n$title\n$legend\n$chart\n</div>\n</body>\nEOT;\n }", "public function gatherData() {\r\n\t\t$this->resource->gatherData();\r\n\t}", "function dataHandler($parser, $data){\n \tif ($this->readingdata) {\n \t\t$this->currentdata.=$data; \t\t\n \t}\n }", "public function proccess(){\n\t\t#Get endpoint params\n\t\t$endpointParams = $this->getEndpointParams();\n\t\t#Check if endpoint was read\n\t\tif($endpointParams == []) return [\"success\" => 0, \"msg\" => \"The requested endpoint ({$this->endpointURL}) didn't match any expected command. Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints.\"];\n\t\t#Get current command (the first part of endpoint) and also removes it from the arguments array\n\t\t$currentCommand = array_shift($endpointParams);\n\t\t#Execute command and return output\n\t\tswitch ($currentCommand) {\n\t\t\t#List upcoming movies\n\t\t\tcase 'upcoming': return $this->retrieveUpcomingMovies($endpointParams);\n\t\t\t#Get movie info\n\t\t\tcase 'movie': return $this->retrieveMovie($endpointParams);\n\t\t\t#Search for movies using terms\n\t\t\tcase 'search': return $this->retrieveSearch($endpointParams);\n\t\t\t#Fallback\n\t\t\tdefault: return [\"success\" => 0, \"msg\" => \"The command '{$currentCommand}' is unknown! Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints.\"];\n\t\t}\n\t}", "protected function processData($data)\n {\n return $data;\n }", "private function _REST_Handle()\r\n {\r\n // Check encruption requirement\r\n if($this->_get_array_value($_GET,\"AUTH\") == true)\r\n {\r\n $request_command[\"AUTH\"] = true;\r\n \r\n // restore the data from url code\r\n $url_data = $this->_get_array_value($_GET,\"data\");\r\n\r\n // Perform decryption, if clear text input, screw it\r\n $this->load->library('encrypt');\r\n $data_string_decrypt = json_decode($this->encrypt->decode($url_data), true);\r\n \r\n if($data_string_decrypt === NULL || $this->_fail_auth_check($data_string_decrypt))\r\n {\r\n $request_command[\"AUTH\"] = false;\r\n $request_command[\"status\"] = \"Error\";\r\n $request_command[\"status_information\"] = \"Error: Fail AUTH\";\r\n }\r\n }\r\n else\r\n {\r\n $request_command[\"AUTH\"] = false;\r\n $data_string = urldecode($_GET);\r\n $data_string_decrypt = json_decode($data_string, true);\r\n }\r\n \r\n // Obtain necessary data\r\n if($data_string_decrypt !== NULL)\r\n {\r\n $request_command[\"service\"] = $this->_get_array_value($data_string_decrypt,\"service\");\r\n $request_command[\"send_data\"] = $this->_get_array_value($data_string_decrypt,\"send_data\");\r\n }\r\n \r\n // Debug purpose\r\n //echo \"<br> get: \".json_encode($_GET).\"<br>\";\r\n //echo \"<br> result: \".json_encode($request_command).\"<br>\";\r\n return $request_command;\r\n }", "public function getData(): mixed;", "protected static function console($data) {\n //echo($data . \"<br>\");\n }", "public function handlerFor(Command $command);", "function getData() {\n\t\treturn $this->data;\n\t}", "public function dataAction() {\n\t\tswitch (filter_input(INPUT_GET, 'filetype')) {\n\t\t\tcase Mapper\\ApacheError::KEYWORD:\n\t\t\t\t$mapper = $this->_apacheErrorMapper;\n\t\t\t\tbreak;\n\t\t\tcase Mapper\\ApacheAccess::KEYWORD:\n\t\t\t\t$mapper = $this->_apacheAccessMapper;\n\t\t\t\tbreak;\n\t\t\tcase Mapper\\NginxError::KEYWORD:\n\t\t\t\t$mapper = $this->_nginxErrorMapper;\n\t\t\t\tbreak;\n\t\t\tcase Mapper\\NginxAccess::KEYWORD:\n\t\t\t\t$mapper = $this->_nginxAccessMapper;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$file = base64_decode(filter_input(INPUT_POST, 'file'));\n\t\t$startTime = filter_input(INPUT_POST, 'time_start');\n\t\t$endTime = filter_input(INPUT_POST, 'time_end');\n\t\t$term = filter_input(INPUT_POST, 'term');\n\t\t\n\t\techo json_encode(array(\n\t\t\t'header' => $mapper->getProperties(),\n\t\t\t'content' => $mapper->getLogEntries($file, $startTime, $endTime, $term)\n\t\t));\n\n\t\treturn array(\n\t\t\t'layout' => false,\n\t\t\t'view' => false\n\t\t);\n\t}", "function response() {\n\t\treturn $this->args;\n\t}", "protected function getData()\n {\n return $this->data;\n }", "public function client_send($data, $command = '')\n {\n }", "public function process($data);", "public function get_data() {\n\t\treturn $this->data;\n\t}", "public function getData(){\n\t\treturn $this->data;\n\t}" ]
[ "0.64654374", "0.64581233", "0.64575255", "0.62436765", "0.6219498", "0.6105075", "0.6078029", "0.6011139", "0.6011139", "0.5954009", "0.5917889", "0.59070253", "0.5903044", "0.5875896", "0.5836025", "0.58341897", "0.5816096", "0.58133197", "0.58023363", "0.57891065", "0.57391566", "0.57391566", "0.57391566", "0.5738711", "0.5730301", "0.5663578", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5580811", "0.5573602", "0.5571752", "0.55687696", "0.55520576", "0.55470985", "0.55436605", "0.55268663", "0.55166775", "0.55097556", "0.54819983", "0.54668736", "0.5461974", "0.5443762", "0.5437589", "0.5431641", "0.5417092", "0.5415813", "0.54059535", "0.5398248", "0.5396503", "0.5394216", "0.5394216", "0.5394216", "0.5394216", "0.5394216", "0.5394216", "0.5394216", "0.5394216", "0.5394216", "0.53871685", "0.53821504", "0.53762084", "0.5374193", "0.5373626", "0.53637254", "0.53520036", "0.5343974", "0.53375155", "0.53232604", "0.52986145", "0.52977383", "0.52815765", "0.5279827", "0.5273165", "0.5266623", "0.5263038", "0.5253901", "0.52399915", "0.52335036", "0.5217878", "0.5208076", "0.5206575", "0.51959276", "0.51954395" ]
0.0
-1
Return all available templates.
public function index() { $this->authorize('index', 'Template'); $templates = $this->templateLoader->loadAll(); $perPage = $this->request->get('per_page', 10); $page = $this->request->get('page', 1); if ($this->request->has('query')) { $templates = $templates->filter(function($template) { return str_contains(strtolower($template['name']), $this->request->get('query')); }); } if ($orderBy = $this->request->get('order_by', 'updated_at')) { $desc = $this->request->get('order_dir', 'desc') === 'desc'; $templates = $templates->sortBy($orderBy, SORT_REGULAR, $desc); } $pagination = new LengthAwarePaginator( $templates->slice($perPage * ($page - 1), $perPage)->values(), count($templates), $perPage, $page ); return $this->success(['pagination' => $pagination]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getTemplatesUsed()\n {\n return static::$allTemplates;\n }", "public function getAllTemplates() {\n $pages = Templates::templates()->get();\n\n return response()->json($pages);\n }", "protected function getAvailableTemplates( )\n\t{\n\t\t$available_templates = $this->getConfig( 'templates' );\n\n\t\treturn $available_templates;\n\t}", "public function getAllTemplates(){ //return all templates in database to the select to choose from templates\n return TemplatesResource::collection(TemplateProject::all());\n }", "function templates()\n {\n return [];\n }", "public function getTemplates (){\n $dir = conf::pathHtdocs() . \"/templates\";\n $templates = file::getFileList($dir, array('dir_only' => true));\n\n $ary = array ();\n foreach ($templates as $val){\n $info = $this->getSingleTemplate($val);\n if (empty($info)) {\n continue;\n }\n $ary[] = $info;\n }\n return $ary;\n }", "public function getTemplates()\n {\n $templates = SSViewer::get_templates_by_class(static::class, '', __CLASS__);\n // Prefer any custom template\n if ($this->getTemplate()) {\n array_unshift($templates, $this->getTemplate());\n }\n return $templates;\n }", "function ListTemplates()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $Config;\r\n\t\t\t\r\n\t\t\t$sql = \"select * from templates order by TemplateDisplayName asc\" ; \r\n\t\t\treturn $this->get_results($sql);\t\t\r\n\t }", "public function getTemplates() {\n $pages = Templates::templates()->paginate(Templates::getPageSize());\n\n return response()->json($pages);\n }", "public function index() {\n $templates = Template::all();\n return $templates;\n }", "public function getTemplates()\n {\n return $this->templates;\n }", "public function getTemplates()\n {\n return $this->templates;\n }", "function getTemplates() {\n\n // Lets load the data if it doesn't already exist\n if (empty($this->_data)) {\n\n // constructs the query\n $query = ' SELECT * '\n . ' FROM #__templateck';\n\n // retrieves the data\n $this->_data = $this->_getList($query);\n }\n\n return $this->_data;\n }", "public function get_templates()\n {\n $template = new MailTemplate();\n return $template->findAll();\n }", "public function getTemplates()\n {\n $finder = Finder::create()\n ->files()\n ->name('*.sql')\n ->in($this->rootDir.'/../templates')\n ;\n\n $templates = [];\n\n /** @var SplFileInfo $file */\n foreach ($finder as $file) {\n $templates[] = $file->getRelativePathname();\n }\n\n return $templates;\n }", "public function getTemplates(){\n\t\n\t\tif( empty($this->_templates) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 't.tmpl_id AS value, t.tmpl_name AS text' );\n\t\t\t$query->from( '#__zbrochure_templates AS t' );\n\t\t\t$query->where( 't.tmpl_published = 1' );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_templates = $this->_db->loadObjectList();\n\n\t\t}\n\t\t\n\t\treturn $this->_templates;\n\t\n\t}", "public function getShowTemplates();", "public function getTemplateList() {\n\t\t$aArgs = func_get_args();\n\t\t$aRet = call_user_func_array( array( $this, 'getTemplates' ), $aArgs );\n\t\treturn implode( '|', $aRet );\n\t}", "private function find_templates () {\r\n\t\t$results = array();\r\n\r\n\t\t$files = WooDojo_Utils::glob_php( '*.php', GLOB_MARK, $this->templates_dir );\r\n\r\n\t\tif ( is_array( $files ) && count( $files ) > 0 ) {\r\n\t\t\tforeach ( $files as $k => $v ) {\r\n\t\t\t\t$data = $this->get_template_data( $v );\r\n\t\t\t\tif ( is_object( $data ) && isset( $data->title ) ) {\r\n\t\t\t\t\t$results[$v] = $data->title;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n\t}", "function getAllPageTemplates() {\n global $wpdb;\n return $wpdb->get_col(\"SELECT DISTINCT meta_value FROM wp_postmeta WHERE meta_key = '_wp_page_template'\"); \n }", "public function GetSavedTemplates() {\n\t\t$templates = &drupal_static(__FUNCTION__, NULL, $this->reset);\n\n\t\tif (!isset($templates)) {\n\t\t\t$templates = db_select('{'.ACQUIA_COMPOSER_TEMPLATES_TABLE.'}', 'ac')\n\t\t\t\t->fields('ac')\n\t\t\t\t->execute()\n\t\t\t\t->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\tif (!count($templates)) {\n\t\t\t\t$templates = array();\n\t\t\t}\n\t\t}\n\t\treturn $templates;\n\t}", "public function getAllSlideTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:SlideTemplate')\n ->findAll();\n }", "function GetDocumentTemplates()\n\t{\n\t\t$result = $this->sendRequest(\"GetDocumentTemplates\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function viewProvider()\n {\n $config = $this->getMartyConfig();\n $templateDir = $config['templateDir'];\n $templates = [];\n $it = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($templateDir));\n /** @var \\SplFileInfo $file */\n foreach ($it as $file) {\n if ($file->isFile() && $file->getExtension() == 'tpl') {\n $templateName = substr($file->getPathname(), strlen($templateDir) + 1);\n $templateId = str_replace(['/', '.tpl'], ['.', ''], $templateName);\n $templates[$templateId] = [$templateName];\n }\n }\n\n return $templates;\n }", "public function getTemplates()\n {\n return [\n 'paths' => [\n 'app' => ['templates/app'],\n 'error' => ['templates/error'],\n 'layout' => ['templates/layout'],\n 'oauth' => ['templates/oauth'],\n ],\n ];\n }", "public function getAllScreenTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:ScreenTemplate')\n ->findAll();\n }", "function customcert_get_templates() {\n global $DB;\n\n return $DB->get_records_menu('customcert_template', array(), 'name ASC', 'id, name');\n}", "public function getTemplates()\n {\n return [\n// 'paths' => [\n// 'auth' => [__DIR__ . '/../templates/auth'],\n//\n// 'app' => [__DIR__ . '/../templates/app'],\n// 'error' => [__DIR__ . '/../templates/error'],\n// 'layout' => [__DIR__ . '/../templates/layout'],\n// ],\n ];\n }", "protected function templates(): array\n {\n return [\n 'links' => [\n 'home' => route('templates.show', 'home/index'),\n ],\n ];\n }", "function _get_templates()\n\t{\n\t\t$location = FILESYSTEM_PATH .'modules/customcats/templates/cattemplates/';\n\t\t$filelist=array();\n\t\tif ($handle = opendir($location))\n\t\t{\n\t\t\twhile (false !== ($file = readdir($handle)))\n\t\t\t{\n\t\t\t\tif ($file != \".\" && $file != \"..\" && $file!=\".svn\" && $file!=\"index.htm\")\n\t\t\t\t{\n\t\t\t\t\t$filelist[]=$file;\n\t\t\t\t}\n\t\t\t}\n \t\t\tclosedir($handle);\n\t\t}\n\t\treturn $filelist;\n\t}", "protected function getTemplates()\r\n\t{\r\n\t\t$templates = array();\r\n\t\tforeach ($this->getProjectDao()->getAllModelTemplates() as $template)\r\n\t\t\t$templates[$template->ID] = $template->Template;\r\n\t\treturn $templates;\r\n\t}", "public function getTemplates()\n {\n return [\n 'paths' => [\n 'app' => [__DIR__ . '/../templates/app'],\n 'error' => [__DIR__ . '/../templates/error'],\n 'layout' => [__DIR__ . '/../templates/layout'],\n 'mail' => [__DIR__ . '/../templates/mail'],\n ],\n ];\n }", "public function getTemplatesFromDB();", "public function getCreatedTemplates ()\n {\n // Get all the templates\n $table = DB::select('select id_template, name_template, created_at, icon from ezz_templates');\n return response()->json([\n 'templates' => $table\n ], 200);\n }", "public function allPages()\n {\n $this->get('/', function(Request $request, Response $response) {\n $templates = [];\n foreach(new DirectoryIterator($this->basePath . '/src/views/') as $fileInfo) {\n if ($fileInfo->isFile() && strtolower($fileInfo->getExtension()) === 'twig') {\n $baseName = $fileInfo->getBasename('.twig');\n\n $templates[$baseName] = [\n 'name' => $baseName,\n 'has_data' => file_exists($this->basePath . '/src/data/' . $baseName . '.php'),\n ];\n }\n }\n ksort($templates);\n\n return $this->view->render($response, 'app_pages.twig', ['templates' => $templates, 'css_url' => $cssUrl]);\n })->setName('templates.list');\n\n return $this;\n }", "public function getTemplates() : array\n {\n return [\n 'paths' => [\n 'elements' => [__DIR__ . '/../templates/'],\n ],\n ];\n }", "public function get()\n {\n return $this->templates;\n }", "public function get_available_templates($contextid) {\n\n $fs = get_file_storage();\n $files = $fs->get_area_files($contextid, 'mod_surveypro', SURVEYPRO_TEMPLATEFILEAREA, 0, 'sortorder', false);\n if (empty($files)) {\n return array();\n }\n\n $templates = array();\n foreach ($files as $file) {\n $templates[] = $file;\n }\n\n return $templates;\n }", "public function getTemplates() {\n\n\t\t$aArgs = func_get_args();\n\t\t$aRet = array();\n\t\t\n\t\tforeach ( $this->_aTemplates as $sTemplate => $aGroup ) {\n\t\t\t$bMatch = TRUE;\n\t\t\tforeach ( $aArgs as $sMatchGroup ) {\n\t\t\t\tif ( !in_array( $sMatchGroup, $aGroup ) ) {\n\t\t\t\t\t$bMatch = FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $bMatch ) $aRet[] = $sTemplate;\n\t\t}\n\t\t\n\t\treturn $aRet;\n\t}", "function getTemplates( $cwd = '.' ) {\n\n // New list\n $templates = array();\n\n // Use cache\n if ( !is_file( \"{$cwd}/tmp/cache/templates.cache\" ) ) {\n\n // Handle themes here\n $list = browse( \"{$cwd}/templates/\", false, true, false );\n\n // Loop\n foreach ( $list as $dir ) {\n\n // Definitions?\n if ( is_file( \"{$cwd}/templates/{$dir}/manifest.json\" ) ) {\n\n // Get json\n $loadedFile = json_decode( file_get_contents( \"{$cwd}/templates/{$dir}/manifest.json\" ), true );\n\n // Verify List - Do not append unless manifest is correct\n if ( !empty( $loadedFile[ 'name' ] ) && is_file( \"{$cwd}/templates/{$dir}/{$loadedFile['template']}\" ) ) {\n\n // This is JSON from the template\n $templates[ $dir ] = $loadedFile;\n\n // Add full path to the variable\n $templates[ $dir ][ 'path' ] = \"/templates/{$dir}\";\n\n }\n\n }\n\n }\n\n // Sort them ascending\n asort( $templates );\n\n // Store cache\n file_put_contents( \"{$cwd}/tmp/cache/templates.cache\", json_encode( $templates ) );\n\n } else {\n\n return json_decode( file_get_contents( \"{$cwd}/tmp/cache/templates.cache\" ), true );\n\n }\n\n return $templates;\n\n }", "function campaignTemplates() {\n $params = array();\n return $this->callServer(\"campaignTemplates\", $params);\n }", "public function retrieveMessageTemplates()\n {\n return $this->start()->uri(\"/api/message/template\")\n ->get()\n ->go();\n }", "public function get_custom_templates()\n {\n }", "public function retrieveEmailTemplates()\n {\n return $this->start()->uri(\"/api/email/template\")\n ->get()\n ->go();\n }", "function getPrintTemplates(){\r\n require $this->sRessourcesFile;\r\n if (in_array(\"print_templates\", $this->aSelectedFields)){\r\n $aParams['sSchemaVmap'] = array('value' => $this->aProperties['schema_vmap'], 'type' => 'schema_name');\r\n $aParams['group_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getGroupPrintTemplates'], $aParams);\r\n\t\t$sListPrintTemplateId = \"\";\r\n\t\t$aListPrintTemplateName = array();\r\n\t\twhile($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {\r\n\t\t\tif ($sListPrintTemplateId == \"\"){\r\n\t\t\t\t$sListPrintTemplateId = $aLigne[\"printtemplate_id\"];\r\n\t\t\t}else{\r\n\t\t\t\t$sListPrintTemplateId .= \"|\".$aLigne[\"printtemplate_id\"];\r\n\t\t\t}\r\n $aListPrintTemplateName[] = $aLigne[\"name\"];\r\n\t\t}\r\n\t\t$oPDOresult=$this->oConnection->oBd->fermeResultat();\r\n $this->aFields['print_templates'] = $sListPrintTemplateId;\r\n $this->aFields['print_templates_label'] = implode(',', $aListPrintTemplateName);\r\n }\r\n }", "public function getAllSMSTemplates()\n {\n $selectTempsql = 'SELECT temp_id, temp_name FROM ' . _DB_PREFIX_ . 'onehop_sms_templates';\n $selectTempsql .= ' WHERE 1 Order By temp_name ASC';\n $templateRes = Db::getInstance()->ExecuteS($selectTempsql);\n return $templateRes;\n }", "public function getTemplates($context = null);", "public function getTemplates() : array\n {\n return [\n 'paths' => [\n 'route' => [__DIR__ . '/../templates/route'],\n 'route-admin' => [__DIR__ . '/../templates/route-admin'],\n ],\n ];\n }", "public function get_templates($data)\n {\n $res = $this->service->getApi()->getAllTemplates();\n return $res;\n }", "public function getConfiguratedTemplates() {\n\t\t$sql = 'SELECT * FROM '.$this->tablePrefix.UserAgentThemeSwitcherData::BROWSERS_TABLE;\n\t\t$results = $this->connection->get_results($sql);\n\n\t\treturn $results;\n\t}", "static public function listTemplates($type)\n {\n $templates = array();\n\n $_templates = Horde::loadConfiguration('templates.php', '_templates', 'whups');\n foreach ($_templates as $name => $info) {\n if ($info['type'] == $type) {\n $templates[$name] = $info['name'];\n }\n }\n\n return $templates;\n }", "public function index()\n {\n $templates = $this->templates->paginate('name');\n\n return view('templates.index', compact('templates'));\n }", "public function getTemplateNames() {\n\t\treturn array_keys(self::$_config->template->toArray());\n\t}", "public function getTemplates()\n\t{\n\t\t$templates = [\n\t\t\t'br' => '<br/>',\n\t\t\t'e' => '',\n\t\t\t'i' => '',\n\t\t\t'p' => '<p><xsl:apply-templates/></p>',\n\t\t\t's' => ''\n\t\t];\n\n\t\tforeach ($this->configurator->tags as $tagName => $tag)\n\t\t{\n\t\t\tif (isset($tag->template))\n\t\t\t{\n\t\t\t\t$templates[$tagName] = (string) $tag->template;\n\t\t\t}\n\t\t}\n\n\t\tksort($templates);\n\n\t\treturn $templates;\n\t}", "public function get_post_templates()\n {\n }", "public function getWaiverTemplates()\n {\n $url = SmartwaiverRoutes::getWaiverTemplates();\n $this->sendGetRequest($url);\n\n try\n {\n // Map array data from API JSON response to a SmartwaiverWaiver object\n $templates = array_map(function ($data) {\n return new SmartwaiverTemplate($data);\n }, $this->lastResponse->responseData);\n }\n catch(InvalidArgumentException $e)\n {\n throw new SmartwaiverSDKException(\n $this->lastResponse->getGuzzleResponse(),\n $this->lastResponse->getGuzzleBody(),\n $e->getMessage()\n );\n }\n\n // Return array of retrieved templates\n return $templates;\n }", "public function getFormTemplates();", "public function getEmailTemplates()\n {\n try {\n return json_decode($this->filesystem->get($this->storagePath));\n } catch (Exception $e) {\n return [];\n }\n }", "public function readCollectionOfPossibleTemplatesToBeInstalledFromFileSystem(){\n\t\t$rootTemplateFoldersToBeMapped = array();\n\t\t$rootTemplateFoldersToBeMapped = $this->searchFolderForTemplatesToBeMapped($this->absoluteRootTemplatesBasePath);\n\t\t//Get all Extension Templates below Root Folders\n\t\t$templateFoldersToBeMapped = array();\n\t\tforeach($rootTemplateFoldersToBeMapped as $rootTemplateFolder) {\n\t\t\t$extensionTempateFoldersToBeMappedFromThisRootTemplate = $this->searchFolderForTemplatesToBeMapped($this->absoluteRootTemplatesBasePath . $rootTemplateFolder . '/' . $this->subFolderNameForExtensionTemplateStructure . '/');\n\n\t\t\tforeach($extensionTempateFoldersToBeMappedFromThisRootTemplate as $extensionTempateFoldersToBeMappedFromThisRootTemplate) {\n\t\t\t\t$templateFoldersToBeMapped[] = $rootTemplateFolder . '/' . $this->subFolderNameForExtensionTemplateStructure . '/' . $extensionTempateFoldersToBeMappedFromThisRootTemplate;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//merge extension and root template folders\n\t\t$templateFoldersToBeMapped = array_merge(\n\t\t\t$rootTemplateFoldersToBeMapped, \n\t\t\t$templateFoldersToBeMapped\n\t\t);\n\t\t\n\t\treturn $templateFoldersToBeMapped;\n\t}", "public static function list_templates()\n\t{\n\n\t\t$functions = get_class_methods('Controller_Admin_Documents');\n\n\t\t$doc_gen_functions = NULL;\n\t\tforeach ($functions as $key => $function)\n\t\t{\n\t\t\tif (strpos($function, 'action_doc_template') !== FALSE)\n\t\t\t{\n\t\t\t\t$cache = explode('action_doc_', $function);\n\t\t\t\t$doc_gen_functions[] = $cache[1];\n\t\t\t}\n\t\t}\n\n\t\treturn $doc_gen_functions;\n\t}", "function templates()\r\n\t{\r\n\t\t$websitepath = $this->website_path;\r\n\t\t$theme = $this->theme;\r\n\t\t$directory = $_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.'';\r\n\t\tif(file_exists($directory))\r\n\t\t{\r\n\t\t\tif ($handle = opendir($_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.'')) { \r\n\t\t\t\t$i = 0;\r\n\t\t\t\twhile (false !== ($file = readdir($handle)))\r\n\t\t\t\t{ \r\n\t\t\t\t\tif ($file != \".\" && $file != \"..\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(!is_dir($_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.''))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$myFile = $_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file;\r\n\t\t\t\t\t\t\t$fh = fopen($myFile, 'r');\r\n\t\t\t\t\t\t\t$theData = fread($fh, 5000);\r\n\t\t\t\t\t\t\tfclose($fh);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$pos = strrpos($theData, \"{{{{{KSD Template\");\r\n\t\t\t\t\t\t\tif ($pos === false) { // note: three equal signs\r\n\t\t\t\t\t\t\t\t//die(\"Not a template.\");\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$array1 = explode(\"}}}}}\",$theData);\r\n\t\t\t\t\t\t\t\t$array2 = explode(\"{{{{{\",$array1[0]);\r\n\t\t\t\t\t\t\t\t$data = $array2[1];\r\n\t\t\t\t\t\t\t\t$array3 = explode(\",\",$data);\r\n\t\t\t\t\t\t\t\t$filearray[$i]['file'] = $file; \r\n\t\t\t\t\t\t\t\t$filearray[$i]['name'] = $array3[1]; \r\n\t\t\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}// END while\t\r\n\t\t\t\tclosedir($handle);\r\n\t\t\t} \r\n\t\t} else {\r\n\t\t\techo(\"$directory <br />NOT EXISTS\");\r\n\t\t}\r\n\t\treturn $filearray;\r\n\t}", "function GetTemplates($userid=0)\n\t{\n\t\t$this->GetDb();\n\n\t\t$qry = \"SELECT templateid, name, ownerid FROM \" \n\t\t . SENDSTUDIO_TABLEPREFIX \n\t\t . \"templates\";\n\t\t\n\t\tif ($userid) {\n\t\t\t$qry .= \" AS t, \" . SENDSTUDIO_TABLEPREFIX \n\t\t\t . \" usergroups_access AS a \"\n\t\t\t . \" WHERE \"\n\t\t\t . \" a.resourceid = t.templateid AND \" \n\t\t\t . \" a.resourcetype = 'templates' \";\n\t\t\t$qry .= \" OR t.ownerid='\" . $this->Db->Quote($userid) . \"'\";\n\t\t} else {\n\t\t\tif (!$this->TemplateAdmin()) {\n\t\t\t\t$qry .= \" WHERE ownerid='\" . $this->Db->Quote($this->userid) . \"'\";\n\t\t\t\t\n\t\t\t\tif (!empty($this->access['templates'])) {\n\t\t\t\t\t$qry .= \" OR templateid IN (\" . implode(',', $this->access['templates']) . \")\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$qry .= \" OR isglobal='1'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$qry .= \" ORDER BY LOWER(name) ASC\";\n\n\t\t$templates = array();\n\t\t$result = $this->Db->Query($qry);\n\t\t\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$templates[$row['templateid']] = $row['name'];\n\t\t}\n\n\t\treturn $templates;\n\t}", "function wpsl_get_templates() {\n\n $templates = array(\n array(\n 'id' => 'default',\n 'name' => __( 'Default', 'wpsl' ),\n 'path' => WPSL_PLUGIN_DIR . 'frontend/templates/default.php'\n ),\n array(\n 'id' => 'below_map',\n 'name' => __( 'Show the store list below the map', 'wpsl' ),\n 'path' => WPSL_PLUGIN_DIR . 'frontend/templates/store-listings-below.php'\n )\n );\n\n return apply_filters( 'wpsl_templates', $templates );\n}", "public function onGetPageTemplates(Event $event)\n {\n $event->types->scanTemplates(__DIR__.\"/templates\");\n }", "public function getTemplates()\n {\n return $this->hasMany(Template::className(), ['atk_id' => 'id']);\n }", "protected function getTemplatesRequest(){\n\t\t\n\t\t//If the user is logged in\n\t\tif($this->getModel()->checkLogin(true))\n\t\t{\n\t\t\t// Set the state and tell plugins.\n\t\t\t$this->setState('GETTING_TEMPLATES_LIST');\n\t\t\t$this->notifyObservers();\n\t\t\t\n\t\t\t//Gets template data\n\t\t\t$data = $this->getModel()->getFeaturedTemplates();\n\t\t\t\n\t\t\t//Show data\n\t\t\t$this->getView()->showInstallableTemplates($data);\n\t\t}\n\t}", "public function index()\n\t{\n\t\t$cat = EmailCategory::all();\n\t\t$userId = Auth::id();\n\t\t$ut = UserTemplate::all()->where('user', $userId);\n\t\treturn view('predefinedTemplates')->with(array('cat'=>$cat, 'ut'=> $ut));\n\t}", "protected function _loadTemplates()\n {\n $this->_tpl = array();\n $dir = Solar_Class::dir($this, 'Data');\n $list = glob($dir . '*.php');\n foreach ($list as $file) {\n \n // strip .php off the end of the file name to get the key\n $key = substr(basename($file), 0, -4);\n \n // load the file template\n $this->_tpl[$key] = file_get_contents($file);\n \n // we need to add the php-open tag ourselves, instead of\n // having it in the template file, becuase the PEAR packager\n // complains about parsing the skeleton code.\n // \n // however, only do this on non-view files.\n if (substr($key, 0, 4) != 'view') {\n $this->_tpl[$key] = \"<?php\\n\" . $this->_tpl[$key];\n }\n }\n }", "static function getAllSettingsTemplates($a_type)\r\n\t{\r\n\t\tglobal $ilDB;\r\n\r\n\t\t$set = $ilDB->query(\"SELECT * FROM adm_settings_template \".\r\n\t\t\t\" WHERE type = \".$ilDB->quote($a_type, \"text\").\r\n\t\t\t\" ORDER BY title\");\r\n\r\n\t\t$settings_template = array();\r\n\t\twhile ($rec = $ilDB->fetchAssoc($set))\r\n\t\t{\r\n\t\t\t$settings_template[] = $rec;\r\n\t\t}\r\n\r\n\t\treturn $settings_template;\r\n\t}", "public function loadTemplates() {\n // Get database hooks.\n $doctrine = $this->container->get('doctrine');\n $slideTemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:SlideTemplate');\n $screenemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:ScreenTemplate');\n $entityManager = $doctrine->getManager();\n\n // Get parameters.\n $path = $this->container->get('kernel')->getRootDir() . '/../web/';\n $serverAddress = $this->container->getParameter('absolute_path_to_server');\n\n // Locate templates in /web/bundles/\n $templates = $this->findTemplates($path . 'bundles/');\n\n foreach ($templates['slides'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadSlideTemplate($config, $slideTemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n foreach ($templates['screens'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadScreenTemplate($config, $screenemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n // Get all templates from the database, and push update to screens.\n $existingTemplates = $screenemplateRepository->findAll();\n $middlewareService = $this->container->get('os2display.middleware.communication');\n foreach ($existingTemplates as $template) {\n foreach ($template->getScreens() as $screen) {\n $middlewareService->pushScreenUpdate($screen);\n }\n }\n }", "public function allEmailTemplateForDataTable()\n {\n return $this->emailTemplateRepository->getAllEmailTemplateForDataTable();\n }", "public function templates()\n {\n $this->authorize();\n\n ee()->load->helper('form');\n ee()->load->library('form_validation');\n ee()->load->model('publisher_template');\n\n if (empty($_POST))\n {\n $vars = array(\n 'hidden' => array(),\n 'save_url' => ee()->publisher_helper_cp->mod_link('templates', array(), TRUE),\n 'templates' => ee()->publisher_template->get_by_group()\n );\n\n return ee()->load->view('templates', $vars, TRUE);\n }\n else\n {\n ee()->publisher_template->save_translations();\n ee()->session->set_flashdata('message_success', lang('publisher_templates_saved'));\n ee()->publisher_helper_url->redirect(ee()->publisher_helper_cp->mod_link('templates'));\n }\n }", "public function getAll(array $filters = null)\n {\n $response = $this->mailjet->get(Resources::$Template,\n ['filters' => $filters]);\n if (!$response->success()) {\n $this->throwError(\"TemplateManager :getAll() failed\", $response);\n }\n\n return $response->getData();\n }", "protected function templatesSelectList(){\n $selectList = array('' => 'Default (Vertical List)');\n foreach( $this->templateAndDirectoryList() AS $fileSystemHandle => $path ){\n if( strpos($fileSystemHandle, '.') !== false ){\n $selectList[ $fileSystemHandle ] = substr($this->getHelper('text')->unhandle($fileSystemHandle), 0, strrpos($fileSystemHandle, '.'));\n }else{\n $selectList[ $fileSystemHandle ] = $this->getHelper('text')->unhandle($fileSystemHandle);\n }\n }\n return $selectList;\n }", "function fetch_templates( $module_id = false ) // fetch templates for module or all or global\n\t{\n\t\tif( $module_id ) {\n\t\t\t$this->db->where( 'module_id', $module_id );\n\t\t}\n\t\t$query=$this->db->get( 'templates' );\n\t\t$this->db->flush_cache();\n\t\treturn $query->result_array();\n\t}", "function getTemplateFiles()\r\n{\r\n\t$directory = \"models/site-templates/\";\r\n\t$languages = glob($directory . \"*.css\");\r\n\t//print each file name\r\n\treturn $languages;\r\n}", "function getFormTemplates(){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/formtemplates';\n\t\t$request = $baseUrl . $endpoint;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}", "public function getMailTemplates()\n {\n $arrTemplates = array();\n $objTemplates = Database::getInstance()->execute(\"SELECT id,name,category FROM tl_mail_templates ORDER BY category, name\");\n\n while( $objTemplates->next() )\n {\n if ($objTemplates->category == '')\n {\n $arrTemplates[$objTemplates->id] = $objTemplates->name;\n }\n else\n {\n $arrTemplates[$objTemplates->category][$objTemplates->id] = $objTemplates->name;\n }\n }\n\n return $arrTemplates;\n }", "protected function getDocblockTemplates()\n\t{\n\t\treturn $this->docblockTemplates;\n\t}", "function tidyt_get_simple_feed_templates($name){\n $templates = array();\n $paged = array();\n\n $paged = tidyt_get_paged_template_functions($name);\n\n $templates = array_merge($paged, $templates);\n\n return $templates;\n}", "public function getPushoverTemplateDropdownValues()\n\t{\n\t\t$templates = [];\n\n\t\t$finder = new FileFinder();\n\t\t$finder->setOption('name_regex', '/^.*\\.ss$/');\n\n $parent = $this->getFormParent();\n\t\t\n if (!$parent) {\n return [];\n }\n\n $pushoverTemplateDirectory = $parent->config()->get('pushover_template_directory');\n $templateDirectory = ModuleResourceLoader::resourcePath($pushoverTemplateDirectory);\n\n if (!$templateDirectory) {\n\t\t\treturn [];\n }\n\t\t\n $found = $finder->find(BASE_PATH . DIRECTORY_SEPARATOR . $templateDirectory);\n\n\t\tforeach ($found as $key => $value) {\n\t\t\t$template = pathinfo($value);\n $absoluteFilename = $template['dirname'] . DIRECTORY_SEPARATOR . $template['filename'];\n\n // Optionally remove vendor/ path prefixes\n $resource = ModuleResourceLoader::singleton()->resolveResource($templateDirectory);\n if ($resource instanceof ModuleResource && $resource->getModule()) {\n $prefixToStrip = $resource->getModule()->getPath();\n } else {\n $prefixToStrip = BASE_PATH;\n }\n $templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1);\n\n // Optionally remove \"templates/\" prefixes\n if (preg_match('/(?<=templates\\/).*$/', $templatePath, $matches)) {\n $templatePath = $matches[0];\n }\n\n $templates[$templatePath] = $template['filename'];\n }\n return $templates;\n\t}", "public function registerMailTemplates()\n {\n return [];\n }", "public function getEnabledSlideTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:SlideTemplate')\n ->findByEnabled(TRUE);\n }", "public function getTemplateOptions();", "public function getItemTemplates()\n\t{\n\t\treturn $this->getTemplateGroup('item_');\n\t}", "public function index()\n {\n $templates = $this->template->all();\n\n return View::make('admin::admin.templates.index', compact('templates'))\n ->with('title','templates Manage');\n }", "static function getTemplates($id) {\n return EmailmarketingTemplates::includedInCampaign($id);\n }", "public function fetchAll()\n {\n $templateTypeTable = new Api_Model_DbTable_TemplateType();\n\n $rowset = $templateTypeTable->fetchAll(null, 'name');\n\n $templateTypes = new Set();\n foreach ($rowset as $row) {\n $templateType = Type::factory($row);\n\n $templateTypes->addItem($templateType);\n }\n\n return $templateTypes;\n }", "function skcw_get_templates_list() {\n\tif (!empty($_GET['page']) && $_GET['page'] == 'code-to-widget') { return; }\n\t$template_path = get_option('skcw_template_directory');\n\tif (empty($template_path)) { return false; }\n\n\t$templates = wp_cache_get('skcw_templates', 'skcw_templates');\n\tif (!is_array($templates) || empty($templates)) {\n\t\t$templates = array();\n\t}\n\telse {\n\t\treturn $templates;\n\t}\n\t\n\t$templ_dir = @opendir($template_path);\n\tif (!$templ_dir) { return false; }\n\t\n\twhile (($file = readdir($templ_dir)) !== false) {\n\t\tif (is_file(trailingslashit($template_path).$file) && is_readable(trailingslashit($template_path).$file)) {\n\t\t\t$template_data = file_get_contents(trailingslashit($template_path).$file);\n\t\t\tif (preg_match('|Widget Name: (.*)$|mi', $template_data, $widget_name)) {\n\t\t\t\t$widget_name = $widget_name[1];\n\t\t\t}\n\t\t\tif (preg_match('|Widget Description: (.*)$|mi', $template_data, $widget_description)) {\n\t\t\t\t$widget_description = $widget_description[1];\n\t\t\t}\n\t\t\tif (preg_match('|Widget Title: (.*)$|mi', $template_data, $widget_title)) {\n\t\t\t\t$widget_title = $widget_title[1];\n\t\t\t}\n\t\t\tif (!empty($widget_name) && !empty($widget_description)) {\n\t\t\t\t$widget_classname = sanitize_title('skcw-'.$widget_name);\n\t\t\t\t$templates[$widget_classname] = array(\n\t\t\t\t\t\t'file' => $file,\n\t\t\t\t\t\t'widget_name' => $widget_name,\n\t\t\t\t\t\t'widget_classname' => $widget_classname,\n\t\t\t\t\t\t'widget_description' => $widget_description,\n\t\t\t\t\t\t'widget_title' => $widget_title\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\t@closedir($templ_dir);\n\tupdate_option('skcw_templates_list',$templates);\n\twp_cache_set('skcw_templates', $templates, 'skcw_templates');\n\treturn is_array($templates) ? $templates : false;\n}", "public static function msgTemplatesList(){\n $accessToken = WxApi::accessToken();\n $offset = 0;\n $count = 5;\n $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=' . $accessToken;\n $postFields = json_encode(array(\n // \"access_token\" => $accessToken,\n \"offset\" => 0,\n \"count\" => 5,\n ));\n $api = curl_init();\n curl_setopt($api, CURLOPT_URL, $url);\n curl_setopt($api, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($api, CURLOPT_HEADER, false);\n curl_setopt($api, CURLOPT_POST, true);\n curl_setopt($api, CURLOPT_POSTFIELDS, $postFields);\n $listObj = curl_exec($api);\n curl_close($api);\n $listObj = json_decode($listObj);\n if($listObj->errcode != 0){\n return NULL;\n }else{\n return $listObj->list;\n // return json_encode($listObj->list);\n }\n }", "public function index()\n {\n $tournamentTemplates = TournamentTemplate::orderBy(\"tournament_name\")->get();\n return view(\"Settings.tournament-templates\", [\"tournamentTemplates\" => $tournamentTemplates, \"addTournamentTemplateUrl\" => url(\"/settings/tournament-templates\")]);\n }", "public function populateDefaultTemplateSets()\n {\n $root_dir = Core::getRootDir();\n\n $data_folder = \"$root_dir/modules/form_builder/default_template_sets\";\n $dh = opendir($data_folder);\n\n if (!$dh) {\n return array(false, \"You appear to be missing the default_template_sets folder, or your \\$g_root_dir settings is invalid.\");\n }\n\n $template_set_files = array();\n while (($file = readdir($dh)) !== false) {\n $parts = pathinfo($file);\n if ($parts[\"extension\"] !== \"json\") {\n continue;\n }\n\n $template_set = json_decode(file_get_contents(\"$data_folder/$file\"));\n $schema = json_decode(file_get_contents(\"$root_dir/modules/form_builder/schemas/template_set-1.0.0.json\"));\n $response = Schemas::validateSchema($template_set, $schema);\n\n if ($response[\"is_valid\"]) {\n $template_set_files[$file] = $template_set;\n } else {\n // TODO\n }\n }\n\n // now install the template sets. Ensure the \"default-*.json\" one is set first\n TemplateSets::importTemplateSetData($template_set_files[$this->defaultTemplateSet]);\n\n foreach ($template_set_files as $filename => $template_set) {\n if ($filename === $this->defaultTemplateSet) {\n continue;\n }\n TemplateSets::importTemplateSetData($template_set);\n }\n }", "public static function getTemplatesForDropdown()\n\t{\n\t\t// @remark When adding new templates Add them here + in frontend layout folder as show_<name-of-template>.tpl\n\t\treturn array(\n\t\t\t'default' => BL::lbl('Default'),\n\t\t\t'lightbox' => BL::lbl('Lightbox'),\n\t\t\t'slideshow' => BL::lbl('Slideshow')\n\t\t);\n\t}", "function getTemplateFiles() // used in admin_configuration.php\r\n\r\n{\r\n\r\n\t$directory = \"models/site-templates/\";\r\n\r\n\t$languages = glob($directory . \"*.css\");\r\n\r\n\t//print each file name\r\n\r\n\treturn $languages;\r\n\r\n}", "public function getEnabledScreenTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:ScreenTemplate')\n ->findByEnabled(TRUE);\n }", "function scan_templates_for_translations () {\r\n $this->CI->load->helper( 'file' );\r\n $filename = config_item( 'dummy_translates_filename' );\r\n\r\n // Clean Pattern for new file\r\n $clean_pattern = \"<?php\\n\";\r\n\r\n // Emptying file\r\n write_file( $filename, $clean_pattern );\r\n\r\n $path = realpath( config_item( 'current_template_uri' ) );\r\n $directory = new RecursiveDirectoryIterator( $path );\r\n $iterator = new RecursiveIteratorIterator( $directory );\r\n\r\n // Regex for no deprecated twig templates\r\n $regex = '/^((?!DEPRECATED).)*\\.twig$/i';\r\n $file_iterator = new RegexIterator( $iterator, $regex, RecursiveRegexIterator::GET_MATCH );\r\n\r\n $files = 0;\r\n $arr_strings = array();\r\n\r\n foreach( $file_iterator as $name => $object ) {\r\n $files++;\r\n\r\n // Mega regex for Quoted String tokens with escapable quotes\r\n // http://www.metaltoad.com/blog/regex-quoted-string-escapable-quotes\r\n $pattern = '/{%\\s?trans\\s?((?<![\\\\\\\\])[\\'\"])((?:.(?!(?<![\\\\\\\\])\\1))*.?)\\1/';\r\n $current_file = fopen( $name, 'r' );\r\n\r\n while ( ( $buffer = fgets( $current_file ) ) !== false ) {\r\n if ( preg_match_all( $pattern, $buffer, $matches ) ) {\r\n foreach( $matches[ 2 ] as $match ) {\r\n // Escaping quotes not yet escaped\r\n $match = preg_replace( '/(?<![\\\\\\\\])(\\'|\")/', \"\\'\", $match );\r\n array_push( $arr_strings, \"echo _( '$match' );\\n\" );\r\n }\r\n }\r\n }\r\n\r\n fclose( $current_file );\r\n }\r\n\r\n // Remove duplicates\r\n $arr_strings = array_unique( $arr_strings );\r\n write_file( $filename, implode( $arr_strings ), 'a' );\r\n\r\n $result = array(\r\n 'templates' => $files,\r\n 'strings' => count( $arr_strings ),\r\n 'output' => $filename,\r\n 'lint' => check_php_file_syntax( $filename )\r\n );\r\n\r\n return $result;\r\n }", "public function getLicenseTemplates()\n {\n return $this->_licenseTemplates;\n }", "private function registerTemplates()\n {\n if (!isset($this->config['templates']) || !count($this->config['templates'])) {\n return;\n }\n\n $templatesToAdd = [];\n foreach ($this->config['templates'] as $templateName) {\n $templatesToAdd[ sanitize_title_with_dashes($templateName) ] = $templateName;\n }\n\n add_filter('theme_page_templates', function ($templates) use ($templatesToAdd) {\n foreach ($templatesToAdd as $slug => $name) {\n $templates[ $slug ] = $name;\n }\n return $templates;\n });\n }", "public static function get_available_templates( $type ) {\n $paths = glob( get_template_directory() . \"/portfolio/$type*.php\" );\n $names = array();\n\n foreach ( $paths as $path ) {\n $file_data = get_file_data( $path, array( 'Portfolio Style' ) );\n $names[] = $file_data[0];\n }\n\n return $names;\n }", "function medigroup_mikado_blog_templates() {\n\n $templates = array();\n $grid_templates = medigroup_mikado_blog_grid_types();\n $full_templates = medigroup_mikado_blog_full_width_types();\n foreach($grid_templates as $grid_template) {\n array_push($templates, 'blog-'.$grid_template);\n }\n foreach($full_templates as $full_template) {\n array_push($templates, 'blog-'.$full_template);\n }\n\n return $templates;\n\n }" ]
[ "0.80282915", "0.79768234", "0.79326385", "0.7880739", "0.7776463", "0.7776139", "0.76777995", "0.76511616", "0.7649571", "0.7640154", "0.7635228", "0.7635228", "0.7505148", "0.75045735", "0.74423444", "0.73726684", "0.7322831", "0.72995937", "0.7254559", "0.71874946", "0.7132512", "0.71276426", "0.70871216", "0.7046704", "0.7041749", "0.7018082", "0.6988205", "0.6983203", "0.6960543", "0.69338655", "0.691647", "0.6912555", "0.69097435", "0.6884175", "0.68592304", "0.6849327", "0.6843881", "0.6829992", "0.6801131", "0.6786391", "0.6786373", "0.6784243", "0.6784038", "0.6777538", "0.66892093", "0.66573143", "0.66476303", "0.664184", "0.659324", "0.6582928", "0.65801495", "0.6557698", "0.65070933", "0.65020573", "0.64961976", "0.64589125", "0.64354086", "0.64188945", "0.63952905", "0.6389453", "0.6362123", "0.6353356", "0.63492495", "0.634727", "0.6344719", "0.6319933", "0.63090384", "0.6295921", "0.6282474", "0.62786806", "0.6246953", "0.62361", "0.6231004", "0.6220071", "0.6213481", "0.6206965", "0.6200847", "0.6194498", "0.6176234", "0.61588824", "0.61501306", "0.61479145", "0.6132998", "0.6126847", "0.61256045", "0.6120266", "0.61104983", "0.6069508", "0.603817", "0.60305655", "0.6028148", "0.6025962", "0.6025961", "0.60206485", "0.6020604", "0.60113233", "0.60105884", "0.59975684", "0.5997233", "0.5989463" ]
0.6502482
53
Get template by specified name.
public function show($name) { $this->authorize('show', 'Template'); try { $template = $this->templateLoader->load($name); } catch (FileNotFoundException $exception) { return abort(404); } return $this->success(['template' => $template]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTemplate($name){\n if(isset($name)){\n return $this->template[$name]; // $this->envir->loadTemplate($template)\n }\n return $this->template[$this->templace_interator++]; // $this->envir->loadTemplate($template)\n }", "public function getPageTemplate($name)\n {\n if(array_key_exists($name, $this->pages)) {\n return $this->templates[$this->pages[$name]];\n }\n }", "protected function getTemplate($name)\n {\n $format = '%s/%s.tpl';\n\n if (file_exists($template = sprintf($format, WORKSPACE . '/template', $name))) {\n return $template;\n } elseif (file_exists($template = sprintf($format, TEMPLATE, $name))) {\n return $template;\n } else {\n return false;\n }\n }", "public function getTemplate(string $template_name) {\n /*if (isset($this->templates[$template_name]) && $this->templates[$template_name]->name != $template_name)\n throw new Exception(\"name conflict occurred on template ('{$this->templates[$template_name]->name}' found at '$template_name')\");\n else*/\n if (!isset($this->templates[$template_name]))\n throw new Exception(\"there is not a template named '$template_name'\");\n\n return $this->templates[$template_name];\n }", "protected\n function getTemplate($template, $name)\n {\n $this->template = $this->file->get($template);\n\n if ($this->needsScaffolding($template)) {\n return $this->replaceStandardParams($this->getScaffoldedTemplate($name));\n }\n\n // Otherwise, just set the file\n // contents to the file name\n return $this->replaceStandardParams($name);\n }", "private function locate_template( $name ) {\n\t\t$file = plugin_dir_path( $this->plugin->file ) . 'templates/' . $name . '.php';\n\n\t\tif ( is_readable( $file ) ) {\n\t\t\treturn $file;\n\t\t}\n\t}", "public function get_template($template_type, $template_name)\n\t{\n\t\treturn cms_orm('CmsModuleTemplate')->find_by_module_and_template_type_and_name($this->get_name(), $template_type, $template_name);\n\t}", "public function getTemplate($templateName) {\n $findOptions = array(\n\t\t\t'conditions' => array(\n\t\t\t\t'LabelTemplate.template_name' => $templateName,\n\t\t\t),\n\t\t\t'fields' => array('LabelTemplate.*'),\n\t\t);\n\n\t\t$template = $this->find( 'first', $findOptions );\n $template = Hash::get($template, 'LabelTemplate.template');\n \n return $template;\n }", "public function findOneByTemplateName($templateName);", "function fusion_wc_get_template( $slug, $name = '' ) {\n\t\tif ( function_exists( 'wc_get_template' ) ) {\n\t\t\twc_get_template( $slug, $name );\n\t\t} elseif ( function_exists( 'woocommerce_get_template' ) ) {\n\t\t\twoocommerce_get_template( $slug, $name );\n\t\t}\n\t}", "function LoadTemplate( $name )\n{\n if ( file_exists(\"$name.html\") ) return file_get_contents(\"$name.html\");\n if ( file_exists(\"templates/$name.html\") ) return file_get_contents(\"templates/$name.html\");\n if ( file_exists(\"../templates/$name.html\") ) return file_get_contents(\"../templates/$name.html\");\n}", "public function findTemplate(string $index): Template\n {\n $template = $this->getByIndex($index);\n\n if ($template instanceof Template) {\n return $template;\n }\n\n // Oops, template not found\n throw TemplateNotFoundException::create($index);\n }", "public static function getTemplate($nameTemplate, $data = array()) {\n $result = \"\";\n $file = DIR_HOME . SP. 'view'. SP .'template'. SP . $nameTemplate .'.php';\n if(file_exists($file)) {\n extract($data);\n ob_start();\n require($file);\n $result = ob_get_contents();\n ob_end_clean();\n }\n return $result;\n }", "function lumi_sfm_template( $name ) {\n\tif ( empty( $name ) ) {\n\t\treturn false;\n\t}\n\n\tif ( isset( $lumi_sfm['Template'][ $name ] ) ) {\n\t\treturn $lumi_sfm['Template'][ $name ]; //If template functions are already loaded\n\t}\n\n\tinclude_once LUMI_SFM_CORE_PATH . $name . '.template.php';\n\t$class_name = '\\\\Lumiart\\\\SecretFileManager\\\\Template\\\\' . $name;\n\t$lumi_sfm['Template'][ $name ] = new $class_name;\n\n\treturn $lumi_sfm['Template'][ $name ];\n}", "protected function getTemplate($template_name)\n\t{\n\t\t$template = false;\n\t\t$default_template = _PS_PDF_DIR_.'/'.$template_name.'.tpl';\n\t\t$overriden_template = _PS_THEME_DIR_.'/pdf/'.$template_name.'.tpl';\n\n\t\tif (file_exists($overriden_template))\n\t\t\t$template = $overriden_template;\n\t\telse if (file_exists($default_template))\n\t\t\t$template = $default_template;\n\n\t\treturn $template;\n\t}", "public function load(string $templateName): string;", "public function loadTemplate($name, $index = null)\n {\n $cls = $this->getTemplateClass($name, $index);\n if (isset($this->loadedTemplates[$cls])) {\n return $this->loadedTemplates[$cls];\n }\n if (!class_exists($cls, false)) {\n if (false === $cache = $this->getCacheFilename($name)) {\n eval('?>'.$this->compileSource($this->getLoader()->getSource($name), $name));\n } else {\n if (!is_file($cache) || ($this->isAutoReload() && !$this->isTemplateFresh($name, filemtime($cache)))) {\n $this->writeCacheFile($cache, $this->compileSource($this->getLoader()->getSource($name), $name));\n }\n require_once $cache;\n }\n }\n if (!$this->runtimeInitialized) {\n $this->initRuntime();\n }\n return $this->loadedTemplates[$cls] = new $cls($this);\n }", "public static function get_template_by_name($conn, $template_name)\n { \n Ossim_db::check_connection($conn);\n \n $template_data = array();\n \n $query = \"SELECT HEX(id) as id, name FROM acl_templates WHERE name = ?\"; \n \n $rs_1 = $conn->Execute($query, array($template_name));\n \n if (!$rs_1)\n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n } \n else \n { \n while (!$rs_1->EOF) \n {\n $template_id = $rs_1->fields['id'];\n \n //Menu permissions\n $query_2 = \"SELECT p.* FROM acl_templates_perms tp, acl_perm p WHERE tp.ac_templates_id=UNHEX(?) AND tp.ac_perm_id=p.id\";\n \n $rs_2 = $conn->Execute($query_2, array($template_id));\n \n if (!$rs_2) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n } \n else \n {\n $perms = array();\n \n while (!$rs_2->EOF) \n {\n $perms[$rs_2->fields['id']] = $rs_2->fields['value'];\n \n $rs_2->MoveNext();\n }\n \n $template_data[$template_id] = array(\n 'id' => $template_id,\n 'name' => $rs_1->fields['name'],\n 'perms' => $perms\n );\n }\n \n $rs_1->MoveNext();\n }\n }\n \n return $template_data;\n }", "public function loadTemplate($name, $path)\n {\n if (isset($this->loadedTemplates[$name])) {\n return $this->loadedTemplates[$name];\n }\n\n $fileCache = $this->getCache();\n $isFresh = $this->isTemplateFresh($name, $fileCache->getTimestamp($path));\n\n if (!$isFresh || !File::isFile($path)) {\n $markup = $this->getLoader()->getMarkup($name);\n $compiled = $this->getCompiler()->compileString($markup);\n\n $fileCache->write($path, $compiled);\n }\n\n $class = $this->getTemplateClass();\n\n return $this->loadedTemplates[$name] = new $class($this, $path);\n }", "public function resolveTemplateName($name);", "protected function findTemplate($name, $throw = true)\n {\n if ($this->hasAllowedExtensions()) {\n $this->checkAllowedExtensions($name);\n }\n\n return parent::findTemplate($name, $throw);\n }", "public function getTemplate($name, $params = [])\n {\n // Prepare view service\n $view = new View();\n $view->setViewsDir(__ROOT__ . '/App/views/');\n $view->setMainView('email');\n\n // Options for Sleet template engine\n $sleet = new Sleet($view, Di::fetch());\n $sleet->setOptions([\n 'compileDir' => __ROOT__ . '/App/tmp/sleet/',\n 'trimPath' => __ROOT__,\n 'compile' => Compiler::IF_CHANGE\n ]);\n\n // Set template engines\n $view->setEngines([\n '.sleet' => $sleet,\n '.phtml' => 'Ice\\Mvc\\View\\Engine\\Php'\n ]);\n\n $view->setContent($view->render($name, $params));\n return $view->layout();\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "abstract public function getTemplate();", "public function getTemplate($name, $params)\n {\n\n $parameters = array_merge(array(\n 'publicUrl' => $this->config->application->publicUrl,\n ), $params);\n\n // Set folder name 'email' app/views/email\n return $this->view->getRender('email', $name, $parameters, function($view){\n $view->setRenderLevel(View::LEVEL_LAYOUT);\n });\n\n return $this->$view->getContent();\n }", "public function find_template(string $for)\n {\n $template = new MailTemplate();\n return $template->where('for_slug', $for)->first();\n }", "public function getTemplate() {}", "abstract public function templateExists($name);", "function getTemplate();", "public function template() {\n\n // check for a cached template name\n if(isset($this->cache['template'])) return $this->cache['template'];\n\n // get the template name\n $templateName = $this->intendedTemplate();\n\n if($this->kirby->registry->get('template', $templateName)) {\n return $this->cache['template'] = $templateName; \n } else {\n return $this->cache['template'] = 'default';\n }\n\n }", "function acadp_get_template( $name, $widget = '' ) {\n\n\t$template_file = '';\n\n\tif( '' !== $widget ) {\n\n\t\t$templates = array(\n\t\t\t\"acadp/widgets/$widget/$name\",\n\t\t\t\"acadp_templates/widgets/$widget/$name\" // deprecated in 1.5.4\n\t\t);\n\n\t\tif( ! $template_file = locate_template( $templates ) ) {\n\t\t\t$template_file = ACADP_PLUGIN_DIR . \"widgets/$widget/views/$name\";\n\t\t}\n\n\t} else {\n\n\t\t$templates = array(\n\t\t\t\"acadp/$name\",\n\t\t\t\"acadp_templates/$name\" // deprecated in 1.5.4\n\t\t);\n\n\t\tif( ! $template_file = locate_template( $templates ) ) {\n\t\t\t$template_file = ACADP_PLUGIN_DIR . \"public/partials/$name\";\n\t\t}\n\n\t}\n\n\treturn apply_filters( 'acadp_get_template', $template_file, $name, $widget );\n\n}", "function get_template()\n {\n }", "abstract public function getTemplate($tpl);", "function wp6tools_get_template_part( $slug, $name = '' ) {\n \n $tpl_path = SIXTOOLS_DIR . '/templates/wp6tools_' . $slug . '-' . $name . '.php';\n \n if(file_exists( $tpl_path ))\n load_template( $tpl_path );\n else\n get_template_part($slug);\n}", "function learn_press_pmpro_get_template( $name, $args = null ) {\n\tif ( file_exists( learn_press_locate_template( $name, 'learnpress-paid-membership-pro', LP_PMPRO_TEMPLATE ) ) ) {\n\t\tlearn_press_get_template( $name, $args, 'learnpress-paid-membership-pro/', get_template_directory() . '/' . LP_PMPRO_TEMPLATE );\n\t} else {\n\t\tlearn_press_get_template( $name, $args, LP_PMPRO_TEMPLATE, LP_ADDON_PMPRO_PATH . '/templates/' );\n\t}\n}", "function db_get_template ($tpl_name, &$tpl_source, &$smarty_obj) {\n Global $loq;\n $rs = $loq->_adb->Execute(\"select template from \".T_TEMPLATES.\" where templatename='$tpl_id'\");\n if($rs !== false && !$rs->EOF){\n $tpl_source = $rs->fields[0];\n }\n return true;\n}", "function getTemplate($fileName) {\n\n $file = file_get_contents($fileName);\n\n if ($file) {\n\n return $file;\n }\n else {\n echo (\"File not found: \" . $fileName);\n }\n}", "public function load(string $name, ?array $options = null): Template\n {\n // Make namespace and filename from complete name\n // ('namespace::model.template' => ['namespace', 'model/template'])\n [$namespace, $filename] = NameResolver::resolve($name);\n\n // Find file in paths\n $file = $this->findFile($namespace, $filename, $options);\n\n // Try to load template from cache\n $template = $this->loadFromCache($namespace, $file, $options);\n\n // If no cached template\n if ($template === null) {\n\n // Read it via reader\n $content = $this->reader->content($file);\n\n // Parse it\n $templateArray = $this->parser->parse($content);\n\n // Make template\n $template = new Template($templateArray);\n\n // And cache whole template\n $this->storeToCache($namespace, $file, $template, $options);\n }\n\n // Check if template extends other\n if (\n empty($options['without_extending'])\n && $template->isExtendingEnabled()\n && ($extends = $template->extends()) !== null\n ) {\n\n // Prevent recursive extending\n if ($extends === $name) {\n throw new InvalidTemplateDefinitionException(\"Recursive extending found in [{$extends}]\");\n }\n\n // Load and merge template to be extended\n $template->extend($this->load($extends, $options));\n }\n\n return $template;\n }", "public function getTemplate()\n {\n if (!$this->_template instanceof KTemplateAbstract) {\n //Make sure we have a template identifier\n if (!($this->_template instanceof KServiceIdentifier)) {\n $this->setTemplate($this->_template);\n }\n\n $config = array(\n 'view' => $this,\n );\n\n $this->_template = $this->getService($this->_template, $config);\n }\n\n return $this->_template;\n }", "function get_template_part( $slug, $name = null ) {\n\n $templates = array();\n $name = (string) $name;\n if ( '' !== $name )\n $templates[] = \"{$slug}-{$name}.php\";\n\n $templates[] = \"{$slug}.php\";\n\n locate_template($templates, true, false);\n}", "public static function &get_template($filename)\n\t{\n\t\t$dbt = debug_backtrace();\n\t\t$template = new Template(realpath(dirname($dbt[0]['file']).'/../templates').'/'.$filename);\n\t\treturn $template;\n\t}", "public function get(string $templateName, array $criteria = [])\n {\n // TODO: Implement get() method.\n }", "protected function getTemplate($template) {\n\t\tif (!array_key_exists($template, $this->templates)) {\n\t\t\tif (is_file(D_LAYOUTS.$this->layout.'/templates/'.$template.'.tpl')) {\n\t\t\t\t$this->templates[$template] = file_get_contents(D_LAYOUTS.$this->layout.'/templates/'.$template.'.tpl');\n\t\t\t\treturn $this->templates[$template];\n\t\t\t} else {\n\t\t\t\ttrigger_error('Template '.$template.'.tpl does not exist in '.D_LAYOUTS.$this->layout.'/templates.', E_USER_ERROR);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->templates[$template];\n\t\t}\n\t}", "public function getTemplateName (string $type, string $name) : string\n {\n return $this->registry->getComponent($type, $name)->getTemplatePath();\n }", "function wac_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n\tif (!empty($args) && is_array($args)){\n\t\textract($args);\n\t}\n\n\t$located = wac_locate_template($template_name,$template_path,$default_path );\n\n\tif (!file_exists($located)){\n\t\twc_doing_it_wrong( __FUNCTION__, sprintf( __( '%s does not exist.','woo-auction' ), '<code>' . $located . '</code>' ), '2.1' );\n\t\treturn;\n\t}\n\n\t// Allow 3rd party plugin filter template file from their plugin.\n\t$located = apply_filters('wac_get_template',$located,$template_name,$args,$template_path,$default_path);\n\t\n\tinclude($located);\n}", "protected function fetch($name, $data=array()){\n\t\t\n\t\t\t# Register all stored vars in the Template Engine\n\t\t\tforeach( $data + $this->tplVars as $k => $v ){\n\t\t\t\t$this->Layers->get('templates')->assign($k, $v);\n\t\t\t}\n\t\t\t\n\t\t\t$name = preg_replace('/\\.tpl$/', '', $name);\n\t\t\tif( !is_file(SNIPPET_TEMPLATES.\"/{$name}.tpl\") ) $name = '404';\n\t\t\t\n\t\t\t$pathToFile = SNIPPET_TEMPLATES.\"/{$name}.tpl\";\n\t\t\t$this->Layers->get('templates')->assign('pathToTemplate', $pathToFile);\n\t\t\t\n\t\t\treturn $this->Layers->get('templates')->fetch('global.tpl');\n\t\t\n\t\t}", "public function getTemplate()\n {\n\n if ( ! $this->template) {\n $this->setDefaultTemplate();\n }\n\n if (is_string($this->template)) {\n $this->template = $this->createTemplate($this->template);\n }\n\n return $this->template;\n }", "public function setTemplateName($name)\n {\n $this->templateName = (string)$name;\n return $this;\n }", "protected function getTemplateInfo($template_name)\n {\n /** @var $db JDatabase */\n $db = JFactory::getDbo();\n /** @var $query JDatabaseQuery */\n $query = $db->getQuery(true);\n $query->select('template, s.params, e.extension_id as id, s.id as style_id');\n $query->from('#__template_styles as s');\n $query->leftJoin('#__extensions as e ON e.type=' . $db->quote('template') . ' AND e.element=s.template AND e.client_id=s.client_id');\n $query->where('s.template =' . $db->quote($template_name), 'AND');\n $query->where('s.client_id = 1', 'AND');\n $db->setQuery($query);\n // Check for a database error.\n if ($db->getErrorNum()) {\n JError::raiseWarning(500, $db->getErrorMsg());\n return false;\n }\n $objects = $db->loadObjectList();\n if ($objects == null) {\n return false;\n }\n $template = new stdClass();\n $template->styles = array();\n foreach ($objects as $template_style)\n {\n $template->name = $template_style->template;\n $template->id = $template_style->id;\n $template->styles[$template_style->style_id] = new JRegistry($template_style->params);\n }\n return $template;\n }", "function carton_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n\tglobal $carton;\n\n\tif ( $args && is_array($args) )\n\t\textract( $args );\n\n\t$located = carton_locate_template( $template_name, $template_path, $default_path );\n\n\tdo_action( 'carton_before_template_part', $template_name, $template_path, $located );\n\n\tinclude( $located );\n\n\tdo_action( 'carton_after_template_part', $template_name, $template_path, $located );\n}", "public function emailTemplateByName($name, $lang) {\n try {\n $template = DB::table('email_templates')\n ->leftJoin('emailtemplates_tr', 'emailtemplates_tr.email_templates_id', '=', 'email_templates.id')\n ->leftJoin('languages', 'languages.id', '=', 'emailtemplates_tr.languages_id')\n ->select('email_templates.id as template_id', 'email_templates.*', 'emailtemplates_tr.*')\n ->where('emailtemplates_tr.name', 'LIKE', '%'.$name.'%')\n ->where('languages.locale', $lang)\n ->first();\n \n return $template;\n } catch (\\Exception $ex) {\n //dd($ex);\n return false;\n }\n }", "public function getTemplateOf($key)\n {\n return $this->template[$this->mappedFields[$key]];\n }", "public function getTemplatePart($slug, $name = null)\n {\n \\get_template_part('templates/template-parts/' . $slug, $name);\n }", "protected\n function getScaffoldedTemplate($name)\n {\n $modelVars = GeneratorsServiceProvider::getModelVars($this->cache->getModelName());\n\n // Replace template vars in view\n $this->template = GeneratorsServiceProvider::replaceModelVars($this->template, $modelVars);\n\n $useLang = false;\n // Create and Edit views require form elements\n if (str_contains($this->template, '{{formElements}}')) {\n $formElements = $this->makeFormElements($modelVars, false, false, false, false);\n $this->template = str_replace('{{formElements}}', $formElements, $this->template);\n }\n\n if (str_contains($this->template, '{{formElements:readonly}}')) {\n $formElements = $this->makeFormElements($modelVars, true, false, false);\n $this->template = str_replace('{{formElements:readonly}}', $formElements, $this->template);\n }\n\n // no booleans\n if (str_contains($this->template, '{{formElements:nobool}}')) {\n $formElements = $this->makeFormElements($modelVars, false, false, true);\n $this->template = str_replace('{{formElements:nobool}}', $formElements, $this->template);\n }\n\n if (str_contains($this->template, '{{formElements:nobool:readonly}}')) {\n $formElements = $this->makeFormElements($modelVars, true, false, true);\n $this->template = str_replace('{{formElements:nobool:readonly}}', $formElements, $this->template);\n }\n\n // only booleans\n if (str_contains($this->template, '{{formElements:bool}}')) {\n $formElements = $this->makeFormElements($modelVars, false, true, false);\n $this->template = str_replace('{{formElements:bool}}', $formElements, $this->template);\n }\n\n if (str_contains($this->template, '{{formElements:bool:readonly}}')) {\n $formElements = $this->makeFormElements($modelVars, true, true, false);\n $this->template = str_replace('{{formElements:bool:readonly}}', $formElements, $this->template);\n }\n\n if (str_contains($this->template, '{{formElements:op}}')) {\n $formElements = $this->makeFormElements($modelVars, false, false, false, true);\n $this->template = str_replace('{{formElements:op}}', $formElements, $this->template);\n }\n\n if (str_contains($this->template, '{{formElements:bool:op}}')) {\n $formElements = $this->makeFormElements($modelVars, false, true, false, true);\n $this->template = str_replace('{{formElements:bool:op}}', $formElements, $this->template);\n }\n\n if (str_contains($this->template, '{{formElements:nobool:op}}')) {\n $formElements = $this->makeFormElements($modelVars, false, false, true, true);\n $this->template = str_replace('{{formElements:nobool:op}}', $formElements, $this->template);\n }\n\n if (str_contains($this->template, '{{formElements:filters}}')) {\n $formElements = $this->makeFormElements($modelVars, false, false, false, false, true);\n $this->template = str_replace('{{formElements:filters}}', $formElements, $this->template);\n }\n\n // And finally create the table rows\n if (str_contains($this->template, '{{headings:lang}}')) {\n $useLang = true;\n $this->template = str_replace('{{headings:lang}}', '{{headings}}', $this->template);\n } else {\n }\n\n list($headings, $fields, $editAndDeleteLinks) = $this->makeTableRows($modelVars, $useLang);\n $this->template = str_replace('{{headings}}', implode(PHP_EOL . \"\\t\\t\\t\\t\", $headings), $this->template);\n $this->template = str_replace('{{fields}}', implode(PHP_EOL . \"\\t\\t\\t\\t\\t\", $fields) . PHP_EOL . $editAndDeleteLinks, $this->template);\n $this->template = str_replace('{{fields:nobuttons}}', implode(PHP_EOL . \"\\t\\t\\t\\t\\t\", $fields), $this->template);\n\n return $this->adjustBladeWrap($this->template);\n }", "protected function findTemplate($name, $throw = true) {\n\t\t$name = str_replace(array('EUREKAG6KBundle:', ':'), array('', '/'), $name);\n\t\treturn parent::findTemplate($name, $throw);\n\t}", "public function show($tname)\n {\n $template = DB::table('templates')->select('*')->where('tname', '=', $tname)->get();\n\n return view('/templates/show')->with('template', $template);\n }", "public function findTemplate($template_name) {\n $test_path = $this->wp_theme_root . 'templates/' . $template_name;\n if ( file_exists( $test_path ) ) {\n return $test_path;\n } else {\n $test_path = $this->path. 'templates/' . $template_name;\n if ( file_exists($test_path) ) {\n return $test_path;\n } else {\n throw new Exception( __('Core Template was not found: ') . ' ' . $template_name );\n }\n }\n }", "public function findTemplate($template_name) {\n $test_path = $this->wp_theme_root . 'templates/' . $template_name;\n if ( file_exists( $test_path ) ) {\n return $test_path;\n } else {\n $test_path = $this->path. 'templates/' . $template_name;\n if ( file_exists($test_path) ) {\n return $test_path;\n } else {\n throw new Exception( __('Core Template was not found: ') . ' ' . $template_name );\n }\n }\n }", "function load_template($template_name='default', Page $p)\n{\n\t$template_path = TEMPLATES_DIR . \"/\" . $template_name . \"/template.php\";\n\n\tif(!file_exists($template_path)) throw new FrameworkException(\"$template_path: template doesn't exist\");\n\n\t$p->setTemplate($template_path);\n\t$p->display();\n}", "public function createTemplate($name, array $params = array())\n {\n if (sizeof($params) > 0) {\n extract($params, EXTR_OVERWRITE);\n }\n \n ob_start();\n ob_implicit_flush(false);\n require ($this->getViewBasePath().'/'.$name.'.php');\n return ob_get_clean();\n }", "public function getTemplate($id)\n {\n $response = $this->get(Resources::$Template, ['id' => $id]);\n if (!$response->success()) {\n $this->throwError('MailjetService:getTemplate() failed', $response);\n }\n return $response->getData();\n }", "function getTemplateName() {\n\t\treturn $this->templateName;\n\t}", "function ffd_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\r\n\tif ( ! empty( $args ) && is_array( $args ) ) {\r\n\t\textract( $args ); // @codingStandardsIgnoreLine\r\n\t}\r\n\r\n\t$located = ffd_locate_template( $template_name, $template_path, $default_path );\r\n\r\n\tif ( ! file_exists( $located ) ) {\r\n\t\t/* translators: %s template */\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Allow 3rd party plugin filter template file from their plugin.\r\n\t$located = apply_filters( 'ffd_get_template', $located, $template_name, $args, $template_path, $default_path );\r\n\r\n\tdo_action( 'ffd_before_template_part', $template_name, $template_path, $located, $args );\r\n\r\n\tinclude $located;\r\n\r\n\tdo_action( 'ffd_after_template_part', $template_name, $template_path, $located, $args );\r\n}", "public function getTemplate($aName = '', $aJobid = 0, $aPhraseTyp = 'job') {\n $lRet = array();\n \n if(!empty($aName)){\n $lSql = 'SELECT `template_id`, `category`, `layout`, `amount` FROM `al_cms_template` WHERE `name`='.esc($aName).' AND `type`='.esc($aPhraseTyp).' ORDER BY id ASC';\n $lQry = new CCor_Qry($lSql);\n foreach ($lQry as $lRow) {\n $lRet[] = array('category' => $lRow['category'], 'layout' => $lRow['layout'], 'amount' => $lRow['amount']);\n\n $lUsr = CCor_Usr::getInstance();\n if(!empty($lRow['template_id']) && $lUsr -> getPref('phrase.'.$aJobid.'.template', NULL) == NULL) {\n $lUsr -> setPref('phrase.'.$aJobid.'.template', $lRow['template_id']);\n }\n }\n }\n \n return $lRet;\n }", "protected function findTemplate($name, $throw = true)\n {\n list($namespace, $shortname) = $this->parseModuleName($name);\n if (!in_array($namespace, $this->paths, true) && $namespace !== self::MAIN_NAMESPACE) {\n $this->addPath(self::getModuleTemplateDir($namespace), $namespace);\n }\n return parent::findTemplate($name, $throw);\n }", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "function youpztStore_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n if ( $args && is_array( $args ) ) {\n extract( $args );\n }\n\n $located = youpztStore_locate_template( $template_name, $template_path, $default_path );\n\n if ( ! file_exists( $located ) ) {\n //_doing_it_wrong( __FUNCTION__, sprintf( '<code>%s</code> does not exist.', $located ), '2.1' );\n return;\n }\n\n // Allow 3rd party plugin filter template file from their plugin.\n $located = apply_filters('youpztStore_get_template', $located, $template_name, $args, $template_path, $default_path );\n\n include( $located );\n\n}", "public static function get_by_template( $template_name, $args = array() ) {\n\t\t$args = wp_parse_args( $args, array(\n\t\t\t'post_type' => 'page',\n\t\t\t'posts_per_page' => 1,\n\t\t\t'orderby' => 'date',\n\t\t\t'order' => 'desc',\n\t\t\t'suppress_filters' => false,\n\t\t\t'meta_query' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key' => '_wp_page_template',\n\t\t\t\t\t'value' => $template_name\n\t\t\t\t)\n\t\t\t)\n\t\t) );\n\n\t\t$posts = get_posts( $args );\n\n\t\tif ( ! $posts ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn reset( $posts );\n\t}", "private function getTemplateForPage($page)\n {\n return (view()->exists($page->template)) ? $page->template : 'default';\n }", "public function get($id)\n {\n $response = $this->mailjet->get(Resources::$Template, ['id' => $id]);\n if (!$response->success()) {\n $this->throwError(\"TemplateManager:get() failed\", $response);\n }\n\n return $response->getData();\n }", "function getTemplate()\r\n\t{\r\n\t\tglobal $config;\r\n\t\tglobal $section;\r\n\t\t\r\n\t\t$style = $_REQUEST[\"_style\"];\r\n\t\t$site = $this->Site();\r\n\t\tif(!$site) Site::getSite();\r\n\t\t\r\n\t\t$templateFile = \"\";\r\n\t\t\r\n\t\tswitch($style)\r\n\t\t{\r\n\t\tcase 'print':\r\n\t\t\t$templateFile = $site->print_template;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 'popup':\r\n\t\t\t$templateFile = $site->popup_template;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 'mobile':\r\n\t\t\t$templateFile = $site->mobile_template;\r\n\t\t\t\r\n\t\tcase 'nude':\r\n\t\t\treturn \"{description}\";\r\n\t\t}\r\n\r\n\t\tif ($section)\r\n\t\t{\r\n\t\t\tif (!$templateFile) $templateFile = $section->getTemplateFile($this->identifier);\r\n\t\t}\r\n\t\t\t\t\r\n\t\tif (!$templateFile) $templateFile = $this->template;\r\n\t\tif (!$templateFile) $templateFile = $site->default_template;\r\n\t\t\r\n\t\t$templateFile = ComponentManager::fireEvent(\"OverrideTemplate\", $templateFile);\r\n\t\t\r\n\t\t$template = file_get_contents(\"{$config['homedir']}/templates/{$templateFile}\");\r\n\r\n\t\treturn $template;\r\n\t}", "function s3_storage_load_template($name, array $_vars)\n{\n $template = locate_template($name, false, false);\n\n // Use the default template if the theme doesn't have it\n if (!$template) {\n $template = dirname(__FILE__) . '/../templates/' . $name . '.php';\n }\n\n // Load the template\n extract($_vars);\n require $template;\n}", "function smarty_resource_text_get_template($tpl_name, &$tpl_source, &$smarty_obj) {\n\t$tpl_source = $tpl_name;\n\treturn true;\n}", "function learn_press_pmpro_locate_template( $name ) {\n\t$file = learn_press_locate_template( $name, 'learnpress-paid-membership-pro', learn_press_template_path() . '/addons/paid-membership-pro/' );\n\t// If template does not exists then look in learnpress/addons/paid-membership-pro in the theme\n\tif ( ! file_exists( $file ) ) {\n\t$file = learn_press_locate_template( $name, learn_press_template_path() . '/addons/paid-membership-pro/', LP_ADDON_PMPRO_PATH . '/templates/' );\n\t}\n\treturn $file;\n}", "function astra_addon_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n\n\t\t$located = astra_addon_locate_template( $template_name, $template_path, $default_path );\n\n\t\tif ( ! file_exists( $located ) ) {\n\t\t\t/* translators: 1: file location */\n\t\t\t_doing_it_wrong( __FUNCTION__, esc_html( sprintf( __( '%s does not exist.', 'astra-addon' ), '<code>' . $located . '</code>' ) ), '1.0.0' );\n\t\t\treturn;\n\t\t}\n\n\t\t// Allow 3rd party plugin filter template file from their plugin.\n\t\t$located = apply_filters( 'astra_addon_get_template', $located, $template_name, $args, $template_path, $default_path );\n\n\t\tdo_action( 'astra_addon_before_template_part', $template_name, $template_path, $located, $args );\n\n\t\tinclude $located;\n\n\t\tdo_action( 'astra_addon_after_template_part', $template_name, $template_path, $located, $args );\n\t}", "function rf_locate_template( $template_name, $template_path = '', $default_path = '' )\n{\n if ( ! $template_path ) {\n $template_path = RFFramework()->template_path();\n }\n\n if ( ! $default_path ) {\n $default_path = RFFramework()->path();\n }\n\n // Locate the template within the template structure\n $template = locate_template(\n array(\n trailingslashit( $template_path ) . $template_name\n )\n );\n\n if ( ! $template ) {\n $template = trailingslashit( $default_path ) . $template_name;\n }\n return $template;\n}", "public static function Get($name);", "function carton_get_template_part( $slug, $name = '' ) {\n\tglobal $carton;\n\t$template = '';\n\n\t// Look in yourtheme/slug-name.php and yourtheme/carton/slug-name.php\n\tif ( $name )\n\t\t$template = locate_template( array ( \"{$slug}-{$name}.php\", \"{$carton->template_url}{$slug}-{$name}.php\" ) );\n\n\t// Get default slug-name.php\n\tif ( !$template && $name && file_exists( $carton->plugin_path() . \"/templates/{$slug}-{$name}.php\" ) )\n\t\t$template = $carton->plugin_path() . \"/templates/{$slug}-{$name}.php\";\n\n\t// If template file doesn't exist, look in yourtheme/slug.php and yourtheme/carton/slug.php\n\tif ( !$template )\n\t\t$template = locate_template( array ( \"{$slug}.php\", \"{$carton->template_url}{$slug}.php\" ) );\n\n\tif ( $template )\n\t\tload_template( $template, false );\n}", "public function get_template_var($name = null)\n {\n if (isset($name)) {\n return $this->Vars[$name];\n }\n return $this->Vars;\n }", "public function getByName($name) {\n return $this->getBy($name, \"name\");\n }", "public function createTemplate(string $name, array $variables = [], string $engine = null): Template;", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "function getTemplateString($templateName) {\n if ($templateName) { //fetch template string !DOCUMENT!\n $templateString=$this->cObj->fileResource($templateName);\n $template=$this->cObj->getSubpart($templateString, '###'.strtoupper($this->cObj->data['xtemplate']).'###');\n return $template;\n }\n return '';\n }" ]
[ "0.8463446", "0.8097573", "0.78711486", "0.7598914", "0.7350094", "0.7281853", "0.72714216", "0.717092", "0.70359856", "0.6997082", "0.6902469", "0.6864246", "0.67922026", "0.6790387", "0.6746064", "0.6710415", "0.6660599", "0.65607303", "0.65528995", "0.6544062", "0.6542831", "0.65090144", "0.6497656", "0.6497656", "0.6497656", "0.6497656", "0.6497656", "0.6497656", "0.64689547", "0.64579517", "0.64203113", "0.6355769", "0.6325094", "0.6318583", "0.62944674", "0.6287059", "0.6284537", "0.62837833", "0.62596995", "0.6258056", "0.6257888", "0.62307054", "0.62266415", "0.6226292", "0.62258124", "0.6220672", "0.6220143", "0.62180245", "0.62180084", "0.62027895", "0.6195059", "0.61851275", "0.61767495", "0.6166427", "0.61643606", "0.61428845", "0.612989", "0.61217105", "0.6121021", "0.61181664", "0.6112467", "0.6111895", "0.6111895", "0.6099689", "0.6099483", "0.6095188", "0.6094047", "0.6092211", "0.60827523", "0.6081455", "0.60698336", "0.60680854", "0.6064034", "0.6062578", "0.6058159", "0.6051127", "0.60458493", "0.6035559", "0.60323596", "0.60278314", "0.60271144", "0.6025566", "0.601988", "0.6019086", "0.6011088", "0.60035044", "0.600209", "0.59992385", "0.59992385", "0.59992385", "0.59992385", "0.59992385", "0.59992385", "0.59992385", "0.59992385", "0.59992385", "0.59992385", "0.59992385", "0.59992385", "0.5979538" ]
0.7299244
5
Create a new template.
public function store() { $this->authorize('store', 'Template'); $this->validate($this->request, [ 'display_name' => 'required|string|min:1|max:255', 'category' => 'required|string|min:1|max:255', 'template' => 'required|file|mimes:zip', 'thumbnail' => 'required|file|image' ]); $params = $this->request->except('template'); $params['template'] = $this->request->file('template'); $params['thumbnail'] = $this->request->file('thumbnail'); if ($this->templateLoader->exists($params['display_name'])) { return $this->error(['display_name' => 'Template with this name already exists.']); } $this->repository->create($params); return $this->success([ 'template' => $this->templateLoader->load($params['display_name']) ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreateTemplate() {\n $searchService = $this->getProvider()->get('\\PM\\Search\\Service\\Template'); /* @var $searchService \\PM\\Search\\Service\\Template */\n\n $this->getExecutor()\n ->add(function(Database $database, Request $request) {\n $database->getTransaction()->begin();\n return array('templateData' => $request->getInput());\n })\n ->add('createTemplate', $searchService)\n ->add(function(Database $databasse) {\n $databasse->getTransaction()->commitAll();\n });\n }", "public function create()\n\t{\n\t\treturn View::make('file_templates.create')\n\t\t\t\t\t->with('title','Create New Template')\n\t\t\t\t\t->with('activeLink','system_manager');\n\t}", "public function create()\n {\n // * route: /template/create\n }", "public function create()\n {\n // * route: /template/create\n }", "public function create()\n {\n return View::make('admin::admin.templates.create')\n ->with('title','Create a new templates');\n }", "public function createTemplate(string $name, array $variables = [], string $engine = null): Template;", "public function create()\n {\n return view('templates.create');\n }", "public function create()\n {\n return view('templates.create');\n }", "public function actionCreate()\n {\n $model = new Template();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "protected function createViewTemplate()\n {\n $overwrite_file = $this->hasOption('force') ? $this->option('force') : false;\n\n $path = $this->getViewTemplatePath();\n\n $contents = $this->getViewTemplateContents();\n\n (new FileGenerator($path, $contents))->withFileOverwrite($overwrite_file)->generate();\n }", "public function create()\n {\n return view('ContractTemplate.create');\n }", "function &createTemplate() {\n global $option, $mosConfig_absolute_path;\n require_once($mosConfig_absolute_path . '/includes/patTemplate/patTemplate.php');\n \n $tmpl =& patFactory::createTemplate($option, true, false);\n $tmpl->setRoot(dirname(__FILE__) . '/templates');\n \n return $tmpl;\n }", "public function create()\n {\n $templates = Template::orderBy('order')->get();\n return view('params::activeTemplate.new', ['templates' => $templates]);\n }", "public function createTemplate(object $parameters, object $data, object $headers): object\n {\n $this->checkParameters(['template'], $data);\n $this->checkParameters(['name', 'active', 'data'], $data->template);\n\n // Save template into DB\n $template = new Template();\n $template->fill((array)$data->template);\n $template->save();\n\n $data->template = $template;\n\n return $data;\n }", "protected function createTemplateModel()\n {\n return new TemplateModel();\n }", "protected function createTemplate($templateName,$targetPath)\r\n {\r\n $templatePath = PathHelper::getTemplatesPath().'/'.$templateName;\r\n $this->mirror($templatePath,$targetPath);\r\n }", "protected function createTemplate($template)\n {\n $templateFactory = new Factory($this->config, 'templates');\n\n return $templateFactory->create($template, [$template, $this->viewBuilder]);\n }", "public function CreateTemplate($tname,$hfname,$tfname) {\r\n\t\t$fhcontents = addslashes(file_get_contents($hfname));\r\n\t\t$ftcontents = addslashes(file_get_contents($tfname));\r\n\t\t$sql = \"insert into templates (t_name, t_html, t_text) values (\\\"$tname\\\",\\\"$fhcontents\\\",\\\"$ftcontents\\\")\";\r\n\t\treturn $this->dbconn->query($sql);\r\n\t}", "public function addTemplate()\n\t{\n\t\t/* Check permission */\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'template_add_edit' );\n\t\t\n\t\t$type = \\IPS\\Request::i()->type;\n\t\t\n\t\t/* Build form */\n\t\t$form = new \\IPS\\Helpers\\Form();\n\t\t$form->hiddenValues['type'] = $type;\n\t\t\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Text( 'template_title', NULL, TRUE, array( 'regex' => '/^([A-Z_][A-Z0-9_]+?)$/i' ), function ( $val ) {\n\t\t\t/* PHP Keywords cannot be used as template names - so make sure the full template name is not in the list */\n\t\t\t$keywords = array( 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor' );\n\t\t\t\n\t\t\tif ( \\in_array( $val, $keywords ) )\n\t\t\t{\n\t\t\t\tthrow new \\DomainException( \\IPS\\Member::loggedIn()->language()->addToStack( 'template_reserved_word', FALSE, array( 'htmlsprintf' => array( \\IPS\\Member::loggedIn()->language()->formatList( $keywords ) ) ) ) );\n\t\t\t}\n\t\t} ) );\n\n\t\t/* Very specific */\n\t\tif ( $type === 'database' )\n\t\t{\n\t\t\t$groups = array(); /* I was sorely tempted to put 'Radiohead', 'Beatles' in there */\n\t\t\tforeach( \\IPS\\cms\\Databases::$templateGroups as $key => $group )\n\t\t\t{\n\t\t\t\t$groups[ $key ] = \\IPS\\Member::loggedIn()->language()->addToStack( 'cms_new_db_template_group_' . $key );\n\t\t\t}\n\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Select( 'database_template_type', NULL, FALSE, array(\n\t\t\t\t'options' => $groups\n\t\t\t) ) );\n\n\t\t\t$databases = array( 0 => \\IPS\\Member::loggedIn()->language()->addToStack('cms_new_db_assign_to_db_none' ) );\n\t\t\tforeach( \\IPS\\cms\\Databases::databases() as $obj )\n\t\t\t{\n\t\t\t\t$databases[ $obj->id ] = $obj->_title;\n\t\t\t}\n\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Select( 'database_assign_to', NULL, FALSE, array(\n\t\t\t\t'options' => $databases\n\t\t\t) ) );\n\t\t}\n\t\telse if ( $type === 'block' )\n\t\t{\n\t\t\t$plugins = array();\n\t\t\tforeach ( \\IPS\\Db::i()->select( \"*\", 'core_widgets', array( 'embeddable=1') ) as $widget )\n\t\t\t{\n\t\t\t\t/* Skip disabled applications */\n\t\t\t\tif ( !\\in_array( $widget['app'], array_keys( \\IPS\\Application::enabledApplications() ) ) )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$plugins[ \\IPS\\Application::load( $widget['app'] )->_title ][ $widget['app'] . '__' . $widget['key'] ] = \\IPS\\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );\n\t\t\t\t}\n\t\t\t\tcatch ( \\OutOfRangeException $e ) { }\n\t\t\t}\n\t\t\t\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Select( 'block_template_plugin_import', NULL, FALSE, array(\n\t\t\t\t\t'options' => $plugins\n\t\t\t) ) );\n\t\t\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Node( 'block_template_theme_import', NULL, TRUE, array(\n\t\t\t\t'class' => '\\IPS\\Theme'\n\t\t\t) ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Page, css, js */\n\t\t\tswitch( $type )\n\t\t\t{\n\t\t\t\tdefault:\n\t\t\t\t\t$flag = \\IPS\\cms\\Theme::RETURN_ONLY_TEMPLATE;\n\t\t\t\tbreak;\n\t\t\t\tcase 'page':\n\t\t\t\t\t$flag = \\IPS\\cms\\Theme::RETURN_PAGE;\n\t\t\t\tbreak;\n\t\t\t\tcase 'js':\n\t\t\t\t\t$flag = \\IPS\\cms\\Theme::RETURN_ONLY_JS;\n\t\t\t\tbreak;\n\t\t\t\tcase 'css':\n\t\t\t\t\t$flag = \\IPS\\cms\\Theme::RETURN_ONLY_CSS;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$templates = \\IPS\\cms\\Theme::i()->getRawTemplates( array(), array(), array(), $flag | \\IPS\\cms\\Theme::RETURN_ALL_NO_CONTENT );\n\n\t\t\t$groups = array();\n\n\t\t\tif ( isset( $templates['cms'][ $type ] ) )\n\t\t\t{\n\t\t\t\tforeach( $templates['cms'][ $type ] as $group => $data )\n\t\t\t\t{\n\t\t\t\t\t$groups[ $group ] = \\IPS\\cms\\Templates::readableGroupName( $group );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! \\count( $groups ) )\n\t\t\t{\n\t\t\t\t$groups[ $type ] = \\IPS\\cms\\Templates::readableGroupName( $type );\n\t\t\t}\n\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Radio( 'theme_template_group_type', 'existing', FALSE, array(\n\t\t\t\t 'options' => array( 'existing' => 'theme_template_group_o_existing',\n\t\t\t\t 'new'\t => 'theme_template_group_o_new' ),\n\t\t\t\t 'toggles' => array( 'existing' => array( 'group_existing' ),\n\t\t\t\t 'new' => array( 'group_new' ) )\n\t\t\t ) ) );\n\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Text( 'template_group_new', NULL, FALSE, array( 'regex' => '/^([a-z_][a-z0-9_]+?)?$/' ), NULL, NULL, NULL, 'group_new' ) );\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Select( 'template_group_existing', NULL, FALSE, array( 'options' => $groups ), NULL, NULL, NULL, 'group_existing' ) );\n\t\t}\n\n\t\tif ( ! \\IPS\\Request::i()->isAjax() AND $type !== 'database' )\n\t\t{\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\TextArea( 'template_content', NULL ) );\n\t\t}\n\t\n\t\tif ( $values = $form->values() )\n\t\t{\n\t\t\t$type = \\IPS\\Request::i()->type;\n\n\t\t\tif ( $type == 'database' )\n\t\t\t{\n\t\t\t\t/* We need to copy templates */\n\t\t\t\t$group = \\IPS\\cms\\Databases::$templateGroups[ $values['database_template_type' ] ];\n\t\t\t\t$templates = iterator_to_array( \\IPS\\Db::i()->select( '*', 'cms_templates', array( 'template_location=? AND template_group=? AND template_user_edited=0 AND template_user_created=0', 'database', $group ) ) );\n\n\t\t\t\tforeach( $templates as $template )\n\t\t\t\t{\n\t\t\t\t\tunset( $template['template_id'] );\n\t\t\t\t\t$template['template_original_group'] = $template['template_group'];\n\t\t\t\t\t$template['template_group'] = str_replace( '-', '_', \\IPS\\Http\\Url\\Friendly::seoTitle( $values['template_title'] ) );\n\n\t\t\t\t\t$save = array();\n\t\t\t\t\tforeach( $template as $k => $v )\n\t\t\t\t\t{\n\t\t\t\t\t\t$k = \\mb_substr( $k, 9 );\n\t\t\t\t\t\t$save[ $k ] = $v;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Make sure template tags call the correct group */\n\t\t\t\t\tif ( mb_stristr( $save['content'], '{template' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tpreg_match_all( '/\\{([a-z]+?=([\\'\"]).+?\\\\2 ?+)}/', $save['content'], $matches, PREG_SET_ORDER );\n\n\t\t\t\t\t\t/* Work out the plugin and the values to pass */\n\t\t\t\t\t\tforeach( $matches as $index => $array )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpreg_match_all( '/(.+?)=' . $array[ 2 ] . '(.+?)' . $array[ 2 ] . '\\s?/', $array[ 1 ], $submatches );\n\n\t\t\t\t\t\t\t$plugin = array_shift( $submatches[ 1 ] );\n\t\t\t\t\t\t\tif ( $plugin == 'template' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$value = array_shift( $submatches[ 2 ] );\n\t\t\t\t\t\t\t\t$options = array();\n\n\t\t\t\t\t\t\t\tforeach ( $submatches[ 1 ] as $k => $v )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$options[ $v ] = $submatches[ 2 ][ $k ];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( isset( $options['app'] ) and $options['app'] == 'cms' and isset( $options['location'] ) and $options['location'] == 'database' and isset( $options['group'] ) and $options['group'] == $template['template_original_group'] )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$options['group'] = $template['template_group'];\n\n\t\t\t\t\t\t\t\t\t$replace = '{template=\"' . $value . '\" app=\"' . $options['app'] . '\" location=\"' . $options['location'] . '\" group=\"' . $options['group'] . '\" params=\"' . ( isset($options['params']) ? $options['params'] : NULL ) . '\"}';\n\n\t\t\t\t\t\t\t\t\t$save['content'] = str_replace( $matches[$index][0], $replace, $save['content'] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$newTemplate = \\IPS\\cms\\Templates::add( $save );\n\t\t\t\t}\n\n\t\t\t\tif ( $values['database_assign_to'] )\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$db = \\IPS\\cms\\Databases::load( $values['database_assign_to'] );\n\t\t\t\t\t\t$key = 'template_' . $values['database_template_type'];\n\t\t\t\t\t\t$db->$key = $template['template_group'];\n\t\t\t\t\t\t$db->save();\n\t\t\t\t\t}\n\t\t\t\t\tcatch( \\OutOfRangeException $ex ) { }\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( $type === 'block' )\n\t\t\t{\n\t\t\t\t$save = array(\n\t\t\t\t\t'title'\t => str_replace( '-', '_', \\IPS\\Http\\Url\\Friendly::seoTitle( $values['template_title'] ) ),\n\t\t\t\t\t'params' => isset( $values['template_params'] ) ? $values['template_params'] : null,\n\t\t\t\t\t'location' => $type\n\t\t\t\t);\n\n\t\t\t\t/* Get template */\n\t\t\t\tlist( $widgetApp, $widgetKey ) = explode( '__', $values['block_template_plugin_import'] );\n\n\t\t\t\t/* Find it from the normal template system */\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Application::load( $widgetApp ), $widgetKey, mt_rand(), array() );\n\n\t\t\t\t$location = $plugin->getTemplateLocation();\n\n\t\t\t\t$theme = ( \\IPS\\IN_DEV ) ? \\IPS\\Theme::master() : $values['block_template_theme_import'];\n\t\t\t\t$templateBits = $theme->getRawTemplates( $location['app'], $location['location'], $location['group'], \\IPS\\Theme::RETURN_ALL );\n\t\t\t\t$templateBit = $templateBits[ $location['app'] ][ $location['location'] ][ $location['group'] ][ $location['name'] ];\n\n\t\t\t\t$save['content'] = $templateBit['template_content'];\n\t\t\t\t$save['params'] = $templateBit['template_data'];\n\t\t\t\t$save['group'] = $widgetKey;\n\t\t\t\t$newTemplate = \\IPS\\cms\\Templates::add( $save );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$save = array( 'title' => $values['template_title'] );\n\n\t\t\t\t/* Page, css, js */\n\t\t\t\tif ( $type == 'js' or $type == 'css' )\n\t\t\t\t{\n\t\t\t\t\t$fileExt = ( $type == 'js' ) ? '.js' : ( $type == 'css' ? '.css' : NULL );\n\t\t\t\t\tif ( $fileExt AND ! preg_match( '#' . preg_quote( $fileExt, '#' ) . '$#', $values['template_title'] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$values['template_title'] .= $fileExt;\n\t\t\t\t\t}\n\n\t\t\t\t\t$save['title'] = $values['template_title'];\n\t\t\t\t\t$save['type'] = $type;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $type === 'page' AND $values['theme_template_group_type'] == 'existing' AND $values['template_group_existing'] == 'custom_wrappers' )\n\t\t\t\t{\n\t\t\t\t\t$save['params'] = '$html=NULL, $title=NULL';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $type === 'page' AND $values['theme_template_group_type'] == 'existing' AND $values['template_group_existing'] == 'page_builder' )\n\t\t\t\t{\n\t\t\t\t\t$save['params'] = '$page, $widgets';\n\t\t\t\t}\n\n\t\t\t\t$save['group'] = ( $values['theme_template_group_type'] == 'existing' ) ? $values['template_group_existing'] : $values['template_group_new'];\n\n\t\t\t\tif ( isset( $values['template_content'] ) )\n\t\t\t\t{\n\t\t\t\t\t$save['content'] = $values['template_content'];\n\t\t\t\t}\n\n\t\t\t\t$save['location'] = $type;\n\n\t\t\t\t$newTemplate = \\IPS\\cms\\Templates::add( $save );\n\t\t\t}\n\n\t\t\t/* Done */\n\t\t\tif( \\IPS\\Request::i()->isAjax() )\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->json( array(\n\t\t\t\t\t'id'\t\t=> $newTemplate->id,\n\t\t\t\t\t'title'\t\t=> $newTemplate->title,\n\t\t\t\t\t'params'\t=> $newTemplate->params,\n\t\t\t\t\t'desc'\t\t=> $newTemplate->description,\n\t\t\t\t\t'container'\t=> $newTemplate->container,\n\t\t\t\t\t'location'\t=> $newTemplate->location\n\t\t\t\t)\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->redirect( \\IPS\\Http\\Url::internal( 'app=cms&module=pages&controller=templates' ), 'saved' );\n\t\t\t}\n\t\t}\n\t\n\t\t/* Display */\n\t\t$title = \\strip_tags( \\IPS\\Member::loggedIn()->language()->get( 'content_template_add_template_' . $type ) );\n\t\t\\IPS\\Output::i()->output = \\IPS\\Theme::i()->getTemplate( 'global', 'core' )->block( $title, $form, FALSE );\n\t\t\\IPS\\Output::i()->title = $title;\n\t}", "public function createTemplate($template)\n {\n $name = hash('sha256', $template, false);\n $key = $this->getCache()->getCacheKey($name, true);\n\n $loader = new ArrayLoader([$name => $template]);\n\n $current = $this->getLoader();\n $this->setLoader($loader);\n\n try {\n return $this->loadTemplate($name, $key);\n }\n finally {\n $this->setLoader($current);\n }\n }", "function Template($TplName=null,$TplArgs=[]) {\n return new \\Web\\Template($TplName, $TplArgs);\n }", "public function create()\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules($this->_validation_rules);\n \n $email_template->is_default = 0;\n \n // Go through all the known fields and get the post values\n foreach($this->_validation_rules as $key => $field)\n {\n $email_template->$field['field'] = $this->input->post($field['field']);\n }\n \n if($this->form_validation->run())\n {\n foreach($_POST as $key => $value)\n {\n $data[$key] = $this->input->post($key);\n }\n unset($data['btnAction']);\n if($this->email_templates_m->insert($data))\n {\n $this->session->set_flashdata('success', sprintf(lang('templates.tmpl_create_success'), $data['name']));\n }\n else\n {\n $this->session->set_flashdata('error', sprintf(lang('templates.tmpl_create_error'), $data['name']));\n }\n redirect('admin/templates');\n }\n \n $this->template->set('email_template', $email_template)\n\t\t\t\t\t\t->title(lang('templates.create_title'))\n ->append_metadata( $this->load->view('fragments/wysiwyg', $this->data, TRUE) )\n ->build('admin/form');\n }", "public function template()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/template', [\n\t\t\t'templates_availables' => $this->templates_availables,\n\t\t]);\n\t}", "public function create()\n {\n $templateList = Template::listFor( CustomerOrder::class );\n\n return view('customer_order_templates.create', compact('templateList'));\n }", "abstract public function createTemplateEntity();", "public function actionCreate()\n {\n $model = $searchModel = new Templates();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $dataProvider->pagination->pageSize = 20;\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->created_by = Yii::$app->user->id;\n $model->created_at = $model->updated_at = time();\n $companyId = Company::getCompanyIdBySubdomain();\n\n if ($companyId == 'main') {\n $model->company_id = 0;\n } else {\n $model->company_id = $companyId;\n }\n\n if ($model->save()) {\n if (Templates::find()->where(['id' => $model->id])->exists())\n return $this->redirect(['view', 'id' => $model->id]);\n else\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('index', [\n 'firstRecord' => $model,\n 'disabledAttribute' => false,\n 'dataProvider' => $dataProvider,\n 'filteredColumns' => [],\n 'searchModel' => $searchModel,\n ]);\n }", "public function actionCreateFromTemplate($templateId = null)\n {\n $model = new WidgetContent();\n\n try {\n if ($model->load($_POST) && $model->save()) {\n return $this->redirect(Url::previous());\n } elseif (!\\Yii::$app->request->isPost) {\n $model->load($_GET);\n }\n } catch (\\Exception $e) {\n $msg = (isset($e->errorInfo[2])) ? $e->errorInfo[2] : $e->getMessage();\n $model->addError('_exception', $msg);\n }\n\n return $this->render('create', ['model' => $model]);\n }", "public function create(SeedTemplateInterface $seed);", "public function new_template()\n\t{\n\t\tee()->load->library('table');\n\t\tee()->cp->add_to_head('<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">');\n\t\tee()->cp->add_to_head('<link rel=\"stylesheet\" href=\"'.$this->theme_url.'css/app.css\" type=\"text/css\" media=\"screen\">');\n\t\tee()->cp->add_to_foot('<script type=\"text/javascript\">var $token = 1;</script>');\n\t\tee()->cp->add_to_foot('<script src=\"'.$this->theme_url.'js/app.js\" type=\"text/javascript\" charset=\"utf-8\"></script>');\n\t\tee()->cp->add_to_foot('<script src=\"'.$this->theme_url.'js/draganddrop.js\" type=\"text/javascript\" charset=\"utf-8\"></script>');\n\n\t\t$this->_data['action_url'] = ee('CP/URL')->make('addons/settings/json_ld/savetemplate');\n\n\t\t$this->_data['templates'] = ee()->jsonld->templates();\n\n\t\t// Get types\n\t\t$this->_data['types'] = ee()->jsonld->types();\n\n\t\treturn ee('View')->make('json_ld:new')->render($this->_data);\n\n\t}", "public function createTemplate()\n {\n $template_id = $this->app->input->get('template_id');\n $association_id = $this->app->input->get('association_id');\n $association_type = $this->app->input->get('association_type');\n\n $template = $this->getTemplate($template_id);\n\n $current_date = date(\"Y-m-d 00:00:00\");\n\n if (count($template) > 0)\n {\n $event_model = new Event;\n\n foreach ($template as $event)\n {\n unset($event['id']);\n\n $event['association_id'] = $association_id;\n $event['association_type'] = $association_type;\n $event['type'] = \"task\";\n\n $event['due_date'] = DateHelper::formatDBDate(date(\"Y-m-d\",strtotime($current_date.\" +\".$event['day'].\" days\")),false);\n $event['due_date_hour'] = \"00:00:00\";\n\n if (!$event_model->store($event))\n {\n return false;\n }\n }\n }\n\n return true;\n }", "public function createPageUsingTemplateObject()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\n\t\t$form = $this->initTemplateSelectionForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$a_page = $_POST[\"page\"];\n\t\t\t$this->object->createWikiPage($a_page, (int) $_POST[\"page_templ\"]);\n\n\t\t\t// redirect to newly created page\n\t\t\t$ilCtrl->setParameterByClass(\"ilwikipagegui\", \"page\", ilWikiUtil::makeUrlTitle(($a_page)));\n\t\t\t$ilCtrl->redirectByClass(\"ilwikipagegui\", \"edit\");\n\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t\t$ilCtrl->redirect($this, \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "public function createDataSetTemplate()\n\t{\n\t\tif (!$this->system->user->hasAdminPermissions('data_set_templates', 'create_data_set_template')) {\n\t\t\treturn Redirect::route('admin.data-set-templates');\n\t\t}\n\t\tif ($this->input) {\n\t\t\t$data_set_template = \\DataSetTemplatesHelper::extractDataSetTemplatesFromInput($this->input)->first();\n\t\t\tif (DataSetTemplatesRepository::write($data_set_template)) {\n\t\t\t\t$this->system->messages->add(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'success' => array(\n\t\t\t\t\t\t\t'You successfully created the Data Set Template \"' . $data_set_template->name() . '\".',\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)->flash();\n\t\t\t\treturn Redirect::route('admin.data-set-templates');\n\t\t\t}\n\t\t\t$this->system->messages->add(DataSetTemplatesRepository::messages()->toArray());\n\t\t} else {\n\t\t\t$data_set_template = DataSetTemplatesRepository::newModel();\n\t\t}\n\t\t$messages = $this->system->messages->get();\n\t\treturn View::make(\n\t\t\t'data::data_set_templates.create',\n\t\t\tcompact('messages', 'data_set_template')\n\t\t);\n\t}", "public function createInvoiceTemplate(array $data)\n {\n $this->apiEndPoint = 'v2/invoicing/templates';\n\n $this->options['json'] = $data;\n\n $this->verb = 'post';\n\n return $this->doPayPalRequest();\n }", "public function createTemplate(Request $request)\n {\n if(!$request->_name || !$request->_subject || !$request->_email_template)\n {\n return 'no main content';\n }\n\n // save the email template\n // create the email object\n $passID = Email::makeNewEmail($this->user, $request, false);\n\n return redirect('/use/'.base64_encode($passID->id));\n }", "private function createTemplate($user_uuid) {\n return $template = Template::create([\n 'user_uuid' => $user_uuid,\n 'title' => Str::random(40)\n ]);\n }", "public function createMessageTemplate($messageTemplateId, $request)\n {\n return $this->start()->uri(\"/api/message/template\")\n ->urlSegment($messageTemplateId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function create()\n {\n $json = [\n 'status' => false,\n 'message' => 'You cannot create post',\n ];\n\n if($this->isUserAuth()){\n $template = new Template();\n\n $template->data['post_id'] = 0;\n\n $json = [\n 'status' => true,\n 'html' => $template->fetch('add_post_form'),\n ];\n }\n\n $this->jsonAnswer($json);\n }", "public function create()\n {\n return view('styleTemplates.create');\n }", "public function template();", "protected function getPageTemplate()\n {\n return new Template();\n }", "public function store() {\n $template = Template::create(Request::all());\n return $template;\n }", "public function createTemplate($displaytext, $name, $ostypeid,$volumeid='') {\n\t\t$data = array (\n\t\t\t\t\"apiKey\" => $this->apiKey,\n\t\t\t\t\"command\" => \"createTemplate\",\n\t\t\t\t\"response\" => \"json\",\n\t\t\t\t\"displaytext\" => $displaytext,\n\t\t\t\t\"name\" => $name,\n\t\t\t\t\"ostypeid\" => $ostypeid,\n\t\t \"passwordenabled\"=>'true',\n\t\t \"ispublic\"=>'true',\n\t\t \"volumeid\"=>$volumeid\n\t\t);\n\t\t$url = $this->getSignatureUrl ( $data );\n\t\treturn $this->curlGet ( $url );\n\t}", "public function create(Template $Template)\n {\n $response = $this->mailjet->post(Resources::$Template,\n ['body' => $Template->format()]);\n if (!$response->success()) {\n $this->throwError(\"TemplateManager:create() failed\", $response);\n }\n\n return $response->getData();\n }", "public function AddTemplate($template, $name=NULL){\n if(!isset($name)){\n $name = 'Tid'.(sizeof($this->template)+1);\n }\n $this->template[$name] = $template; // $this->envir->loadTemplate($template);\n if(sizeof($this->template)==1){\n $this->mystart_template = $name;\n }\n return $name;\n }", "public function create(array $data)\n {\n if (isset($data['content'])) {\n $data['content'] = base64_encode($data['content']);\n }\n \n if (isset($data['archive'])) {\n $data['archive'] = base64_encode($data['archive']);\n }\n \n $client = new MailWizzApi_Http_Client(array(\n 'method' => MailWizzApi_Http_Client::METHOD_POST,\n 'url' => $this->config->getApiUrl('templates'),\n 'paramsPost' => array(\n 'template' => $data\n ),\n ));\n \n return $response = $client->request();\n }", "public function setTemplate(string $template_name);", "public function create_new () {\n\t\t$dialog = new CocoaDialog($this->cocoa_dialog);\n\t\t$templates = array();\n\t\t\n\t\t// Find items in standard project templates\n\t\t$contents = directory_contents($this->standard_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->standard_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Find items in user project templates\n\t\t$contents = directory_contents($this->user_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->user_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\n\t\t// Prompt to select template\n\t\tif ($selection = $dialog->standard_dropdown(\"New Project\", \"Choose a project template to start from.\", $items, false, false, false, false)) {\n\t\t\t//print($selection);\n\t\t\t\n\t\t\t// Prompt to save\n\t\t\tif ($path = $dialog->save_file(\"Save Project\", \"Choose a location to save the new project.\", null, null, null)) {\n\t\t\t\t$this->copy_template($templates[$selection], $path);\n\t\t\t}\n\t\t}\n\t}", "public function resourceTemplateCreate(Event $event){\n\n $request = $event->getParam('request');\n $operation = $request->getOperation();\n $em = $this->getServiceLocator()->get('Omeka\\EntityManager');\n\n\n if ($operation == 'create') {\n $resource_template = $event->getParam('entity');\n $teams = $em->getRepository('Teams\\Entity\\Team');\n foreach ($request->getContent()['o-module-teams:Team'] as $team_id):\n $team = $teams->findOneBy(['id'=>$team_id]);\n $trt = new TeamResourceTemplate($team,$resource_template);\n $em->persist($trt);\n endforeach;\n $em->flush();\n }\n\n }", "public function actionCreate()\n {\n $model = new PrintTemplate();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', __('Your changes have been saved successfully.'));\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n $model->validate(['margin_top', 'margin_bottom', 'margin_left', 'margin_right', 'wrapper']);\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "private function createTemplate($config)\n {\n $template = Request::init();\n if (isset($config[\"user\"])) {\n $template->authenticateWith($config[\"user\"], $config[\"password\"])\n ->addOnCurlOption(CURLOPT_SSLVERSION, 3)\n ->withoutStrictSSL()\n ->followRedirects(true);\n }\n return $template;\n }", "public function create(Request $request)\n {\n EmailTemplate::create($request->all());\n return redirect('email/template/view');\n }", "function template($template=\"simple\"){\n\n\t\t// THE PHYSICAL TEMPLATE SHOULD BE IN THE RESPECTIVE \n\t\t// TEMPLATE/TYPE/$template.php\n\t\t$this->template = $template;\n\t}", "public function actionCreate()\n {\n $model = new NotificationsTemplate();\n\n if ($model->load(\\Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'key' => $model->key]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createTemplate() {\n\n //save new user\n $project = new $this->projects;\n\n //data\n $project->project_id = -time();\n $project->project_title = request('project_title');\n $project->project_clientid = 0;\n $project->project_creatorid = auth()->id();\n $project->project_description = request('project_description');\n $project->project_categoryid = request('project_categoryid');\n $project->project_date_start = null;\n $project->project_type = 'template';\n\n $project->project_billing_type = (in_array(request('project_billing_type'), ['hourly', 'fixed'])) ? request('project_billing_type') : 'hourly';\n $project->project_billing_rate = (is_numeric(request('project_billing_rate'))) ? request('project_billing_rate') : 0;\n $project->project_billing_estimated_hours = (is_numeric(request('project_billing_estimated_hours'))) ? request('project_billing_estimated_hours') : 0;\n $project->project_billing_costs_estimate = (is_numeric(request('project_billing_costs_estimate'))) ? request('project_billing_costs_estimate') : 0;\n\n //project permissions (make sure same in 'update method')\n $project->clientperm_tasks_view = (request('clientperm_tasks_view') == 'on') ? 'yes' : 'no';\n $project->clientperm_tasks_collaborate = (request('clientperm_tasks_collaborate') == 'on') ? 'yes' : 'no';\n $project->clientperm_tasks_create = (request('clientperm_tasks_create') == 'on') ? 'yes' : 'no';\n $project->clientperm_timesheets_view = (request('clientperm_timesheets_view') == 'on') ? 'yes' : 'no';\n $project->clientperm_expenses_view = (request('clientperm_expenses_view') == 'on') ? 'yes' : 'no';\n $project->assignedperm_tasks_collaborate = (request('assignedperm_tasks_collaborate') == 'on') ? 'yes' : 'no';\n\n //apply custom fields data\n $this->applyCustomFields($project);\n\n //save and return id\n if ($project->save()) {\n return $project->project_id;\n } else {\n Log::error(\"record could not be created - database error\", ['process' => '[ProjectRepository]', config('app.debug_ref'), 'function' => __function__, 'file' => basename(__FILE__), 'line' => __line__, 'path' => __file__]);\n return false;\n }\n }", "public function createTemplate(Template $Template)\n {\n $response = $this->post(\n Resources::$Template,\n ['body' => $Template->format()]\n );\n if (!$response->success()) {\n $this->throwError('MailjetService:createTemplate() failed', $response);\n }\n return $response->getData();\n }", "function createXTemplate() {\n if(!isset($this->xTemplate)) {\n if(isset($this->xTemplatePath)) {\n\n $this->xTemplate = new XTemplate($this->xTemplatePath);\n $this->xTemplate->assign(\"APP\", $this->local_app_strings);\n if(isset($this->local_mod_strings))$this->xTemplate->assign(\"MOD\", $this->local_mod_strings);\n $this->xTemplate->assign(\"THEME\", $this->local_theme);\n $this->xTemplate->assign(\"IMAGE_PATH\", $this->local_image_path);\n $this->xTemplate->assign(\"MODULE_NAME\", $this->local_current_module);\n } else {\n $GLOBALS['log']->error(\"NO XTEMPLATEPATH DEFINED CANNOT CREATE XTEMPLATE\");\n }\n }\n}", "public function createEmailTemplate($emailTemplateId, $request)\n {\n return $this->start()->uri(\"/api/email/template\")\n ->urlSegment($emailTemplateId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function createTemplate($body)\n {\n list($response) = $this->createTemplateWithHttpInfo($body);\n return $response;\n }", "public function create()\n {\n $documentCategoryRepo = $this->documentCategoryRepository;\n return view('configurations.templates.add', compact('documentCategoryRepo'));\n }", "static public function create($uri, $template, $data = array()) {\n\n if(!is_string($template) or empty($template)) {\n throw new Exception('Please pass a valid template name as second argument');\n }\n\n // try to create the new directory\n $uri = static::createDirectory($uri);\n\n // create the path for the textfile\n $file = textfile($uri, $template);\n\n // try to store the data in the text file\n if(!data::write($file, $data, 'kd')) {\n throw new Exception('The page file could not be created');\n }\n\n // get the new page object\n $page = page($uri);\n\n if(!is_a($page, 'Page')) {\n throw new Exception('The new page object could not be found');\n }\n\n // let's create a model if one is defined\n if(isset(static::$models[$template])) {\n $model = static::$models[$template];\n $page = new $model($page->parent(), $page->dirname());\n }\n\n kirby::instance()->cache()->flush();\n\n return $page;\n\n }", "protected function createTemplate(MibboList $list, $type)\n {\n $datas = [\n 'name' => 'Gazette St-Michel (' . date('d/m/Y') . ')',\n 'html' => $this->createHtmlForNewsLetter($list),\n 'folder' => $this->MailingListInfo[$type]['templateFolder']\n ];\n $result = $this->mailChimp->post('templates', $datas);\n return $result;\n }", "public function testCreateDynamicTemplate()\n {\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::createDynamicTemplate());\n\n $template = $sw->createDynamicTemplate(new SmartwaiverTemplateConfig(), new SmartwaiverTemplateData(), 300);\n $this->assertInstanceOf(SmartwaiverDynamicTemplate::class, $template);\n\n $this->checkPostRequests($container, ['/v4/dynamic/templates'], [\n '{\"dynamic\":{\"expiration\":300,\"template\":{},\"data\":{}}}'\n ]);\n }", "public function create()\n {\n $this->template .= 'create';\n\n return $this->renderOutput();\n }", "public function addTemplate() {\n\t\t\n\t\t$aArgs = func_get_args();\n\t\t\n\t\t$sTemplate = array_shift( $aArgs );\n\t\t\n\t\t$this->_aTemplates[ $sTemplate ] = $aArgs;\n\t\t\n\t\treturn $this;\n\t}", "public static function make($template, $variables = [])\n {\n return new self($template, $variables);\n }", "public function addTemplate( $template )\n {\n \n $this->templates[] = $template;\n \n }", "public static function create($templateName){\n\t\tif (DB_READ_ONLY_MODE==1) return true;\t\n\t\t\n\t\t$templateName = generate::cleanFileName($templateName);\n\t\t$destination = TEMPLATES_PATH.$templateName.'/';\n\t\t\n\t\t$counter = 2;\n\t\twhile (is_dir($destination)) {\n\n\t\t\t$destination = TEMPLATES_PATH.$templateName.\"-{$counter}/\";\n\t\t\t$counter = $counter+1;\n\t\t}\t\t\n\t\t\n\t\tif(!is_dir($destination)){\n\t\t\tbaseFile::createDir($destination);\n\t\t\tforeach (self::$baseFolders as $folder){\n\t\t\t\tbaseFile::createDir($destination.$folder);\n\t\t\t}\n\t\t\tforeach (self::$baseTpl as $tpl){\n\t\t\t\tbaseFile::saveFile($destination.$tpl, '');\n\t\t\t}\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function create()\n {\n return view('assets/template_tambah');\n }", "public function create()\n {\n return (new EmailTemplate())->loadDefaultValues();\n }", "public function template() {\n\t\tif( !$this->template ) {\n\t\t\t$this->template = new Template( $this->template_id );\n\t\t}//end if\n\t\treturn $this->template;\n\t}", "public function create(Content $content)\n {\n $form = new Form(new Template());\n $form->text('name', '模板名称')->default('')->required();\n $form->text('description', '模板描述')->default('');\n $form->file('file', '模板文件')->default('')->rules('mimes:zip')->required();\n return $form;\n// $content->header('模板');\n// $content->body(view('admin.template.add'));\n// return $content;\n\n }", "public function create()\n {\n $routePrefix = $this->routePrefix;\n\n /* Parameters passed to view:\n $routePrefix as string\n */\n return view($this->viewPrefix.'.create', compact('routePrefix'));\n }", "public function setTemplate(string $template);", "private function createArchiveTemplate() {\n $template = $this->getArchiveTemplate();\n $this->createTemplate($template, RepecInterface::TEMPLATE_ARCHIVE);\n }", "public function testPublishNewTemplate() {\n\t\t$manager = new MandrillTemplateManager();\n\t\t$manager->setHtml('<p>Read this now!</p>');\n\t\t$service = $this->getMock('Mandrill_Templates', array(), array(), '', false);\n\t\t$service->expects($this->once())->method('getList')->will($this->returnValue(array(array('name' => 'old template'))));\n\t\t$service->expects($this->once())->method('add')->with(\n\t\t\t$this->equalTo('my fav template'),\n\t\t\t$this->equalTo('[email protected]'),\n\t\t\t$this->equalTo('Mr C'),\n\t\t\t$this->equalTo('Amazing subject...'),\n\t\t\t$this->equalTo('<p>Read this now!</p>'),\n\t\t\t$this->equalTo(''),\n\t\t\t$this->equalTo(true));\n\t\t$service->expects($this->never())->method('update');\n\t\t$manager->setMandrillTemplatesService($service);\n\t\t$manager->publish('my_key', 'my fav template', '[email protected]', 'Mr C', 'Amazing subject...', true);\n\t}", "private function prepareTemplate() {\r\n $template = $this->iTemplateFactory->createTemplate();\r\n $template->_control = $this->linkGenerator;\r\n $this->setTemplate($template);\r\n }", "public function createNew();", "public function create() {\r\n require $this->views_folder . 'create.php';\r\n }", "public function store(TemplateRequest $request)\n {\n $request['template_content'] = $request->editor1;\n Template::create($request->all());\n session()->flash('success', 'Template successfully added');\n if ($request->save == \"save\") {\n\n return redirect('configurations/template');\n } else {\n return redirect('configurations/template/create');\n }\n }", "public function template()\n {\n\n include './views/template.php';\n\n }", "public function savetemplate()\n\t{\n\t\t// Get form data\n\t\t$template_name = ee()->input->get_post('template_name');\n\t\t$template = ee()->input->get_post('json-ld-template-final');\n\n\t\t// Write it to database\n\t\t$data = [\n\t\t\t'template_name' => $template_name,\n\t\t\t'template_text' => $template\n\t\t];\n\n\t\tee()->db->insert('exp_json_ld_templates', $data);\n\n\t\t// return index view\n\t\treturn $this->index();\n\t}", "public function makeTemplate($input) {\n\t\t$info = array(\n\t\t\t'{generator_name}' => $input['generator_name'],\n\t\t\t'{module_name_l}' => $this->clean($input['generator_name']),\n\t\t\t'{description}' => $input['description'],\n\t\t\t'{author}' => $input['author'],\n\t\t\t'{website}' => $input['website'],\n\t\t\t'{package}' => $input['package'],\n\t\t\t'{subpackage}' => $input['subpackage'],\n\t\t\t'{copyright}' => $input['copyright'],\n\t\t\t'{frontend}' => $input['frontend'],\n\t\t\t'{backend}' => $input['backend'],\n\t\t\t);\n\t\t$info['{validation_fields}'] = $this->makeValidation($input['fields']);\n\t\t$info['{details_fields}'] = $this->makeDetails($input['fields']);\n\t\t$info['{model_fields}'] = $this->makeModel($input['fields']);\n\t\t$info['{adminform_fields}'] = $this->makeAdminForms($input['fields']);\n\t\t// array of files to replace\n\t\t$filearray = array(\n\t\t\t'config/routes.php',\n\t\t\t'controllers/admin.php',\n\t\t\t'details.php',\n\t\t\t'events.php',\n\t\t\t'language/english/sample_lang.php',\n\t\t\t'models/sample_m.php',\n\t\t\t'plugin.php',\n\t\t\t'views/admin/form.php',\n\t\t\t'views/admin/index.php'\n\t\t\t);\n\t\t// conditional front end controller stuff\n\t\tif ($input['frontend'] == 'true') {\n\t\t\t$filearray[] = 'controllers/sample.php';\n\t\t\t$filearray[] = 'views/index.php';\n\t\t}\n\t\t$url = __DIR__ . '/../public/generated/';\n\t\t$this->cpdir(__DIR__ . '/../generator/module_full', __DIR__ . '/../public/generated/'.$info['{module_name_l}']);\n\t\t// where is the module generated\n\t\t$moduleurl = $url.$info['{module_name_l}'];\n\t\tfor ($i = 0; $i < count($filearray); $i++) {\n\t\t\t$filedestination = $moduleurl.'/'.$filearray[$i];\n\t\t\t// load the template = module_full/targetfile\n\t\t\t$current = file_get_contents($filedestination);\n\t\t\t// replace the template tags\n\t\t\t$current = $this->str_replace_assoc($info, $current);\n\t\t\t// put the contents in the new file\n\t\t\tfile_put_contents($filedestination, $current);\n\t\t}\n\t\t// rename the specific files that are name sensitive\n\t\trename($moduleurl.'/language/english/sample_lang.php', $moduleurl.'/language/english/'.$info['{module_name_l}'].'_lang.php');\n\t\trename($moduleurl.'/models/sample_m.php', $moduleurl.'/models/'.$info['{module_name_l}'].'_m.php');\n\t\tif ($input['frontend'] == 'true') {\n\t\t\t// rename the extra front end stuff if applicable\n\t\t\trename($moduleurl.'/controllers/sample.php', $moduleurl.'/controllers/'.$info['{module_name_l}'].'.php');\n\t\t\trename($moduleurl.'/css/sample.css', $moduleurl.'/css/'.$info['{module_name_l}'].'.css');\n\t\t}\n\t\t// comment out to disable zip compression\n\t\t$this->Zip($url.$info['{module_name_l}'], $url.$info['{module_name_l}'].'.zip');\n\t\treturn $info['{module_name_l}'].'.zip';\n\t}", "public static function addTemplate(Template $oTemplate) { \n\t\t$db = CdtDbManager::getConnection(); \n\n\t\t\n\t\t$ds_template = $oTemplate->getDs_template();\n\t\t\n\t\t$ds_path = $oTemplate->getDs_path();\n\t\t\n\t\t\n\t\t$nu_image = CdtFormatUtils::ifEmpty( $oTemplate->getNu_image(), 'null' );\n\t\t\n\t\t$img_header = $oTemplate->getImg_header();\n\t\t\n\t\t$img_footer = $oTemplate->getImg_footer();\n\t\t\n\t\t$tableName = BOL_TABLE_TEMPLATE;\n\t\t\n\t\t$sql = \"INSERT INTO $tableName (ds_template, ds_path, nu_image, img_footer, img_header) VALUES('$ds_template', '$ds_path', $nu_image, '$img_footer', '$img_header')\"; \n\n\t\t$result = $db->sql_query($sql);\n\t\tif (!$result)//hubo un error en la bbdd.\n\t\t\tthrow new DBException($db->sql_error());\n\n\t\t//seteamos el nuevo id.\n\t\t$cd = $db->sql_nextid();\n $oTemplate->setCd_template( $cd );\n\t}", "public function create() {\n $this->createPersonHeader();\n $this->createRecipientHeader();\n $this->createBody();\n $this->createText();\n $this->createFooter();\n }", "function set_template($template_name) {\n\t\t$this->template = $template_name;\n\t}", "public function initTemplate() {}", "function get_template()\n {\n }", "public static function create(Template $template, $in_php = false)\n\t{\n\t\treturn new static($template, $in_php);\n\t}", "protected function instantiateTemplate() {\n\t\t$baseTemplate = '\\\\'. \\Autoload::TEMPLATE_NAMESPACE .'\\\\Base';\n\t\t$templateName = '\\\\'. \\Autoload::TEMPLATE_NAMESPACE .'\\\\'. $this->getDocument()->getTemplateName();\n\t\tif( $templateName != null && class_exists( $templateName ) )\n\t\t\treturn new $templateName( $this, $this->getRequestHandler(), $this->getDocument() );\n\t\telseif( class_exists( $baseTemplate ) )\n\t\t\treturn new $baseTemplate( $this, $this->getRequestHandler(), $this->getDocument() );\n\t\telse\n\t\t\tthrow new Exception( \"Template '\". $templateName .\"' could not be found.\" );\n\t\treturn null;\n\t}", "public function createTemplate($name, array $params = array())\n {\n if (sizeof($params) > 0) {\n extract($params, EXTR_OVERWRITE);\n }\n \n ob_start();\n ob_implicit_flush(false);\n require ($this->getViewBasePath().'/'.$name.'.php');\n return ob_get_clean();\n }", "public function ClassTemplate(){\n\t\t$this->template = new Template;\n\t}", "public function template($value) {\n return $this->setProperty('template', $value);\n }", "public function template($value) {\n return $this->setProperty('template', $value);\n }", "abstract public function getTemplate();", "public function createAction(Request $request)\n {\n $mailtemplate = new MailTemplate();\n $form = $this->createForm(new MailTemplateType(), $mailtemplate);\n if ($form->handleRequest($request)->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $em->persist($mailtemplate);\n $em->flush();\n\n return $this->redirect($this->generateUrl('mailtemplate_show', array('id' => $mailtemplate->getId())));\n }\n\n return array(\n 'mailtemplate' => $mailtemplate,\n 'form' => $form->createView(),\n );\n }", "public static function makeViewModelFromTemplate($template);", "public function addTemplate($name, $template)\n\t{\n\t\tglobal $conf;\n\t\t$error = 0;\n\t\t$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt_template';\n\t\t$sql .= ' (name, template, entity) VALUES (\"'.$this->db->escape($name).'\"';\n\t\t$sql .= ', \"'.$this->db->escape($template).'\", '.$conf->entity.')';\n\t\t$resql = $this->db->query($sql);\n\t\tif (!$resql) {\n\t\t\t$error++;\n\t\t\t$this->errors[] = $this->db->lasterror;\n\t\t}\n\t\treturn $error;\n\t}", "protected function jobTemplateCreateRequest($project_id, $job_template_create_parameters, $x_phrase_app_otp = null)\n {\n // verify the required parameter 'project_id' is set\n if ($project_id === null || (is_array($project_id) && count($project_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project_id when calling jobTemplateCreate'\n );\n }\n // verify the required parameter 'job_template_create_parameters' is set\n if ($job_template_create_parameters === null || (is_array($job_template_create_parameters) && count($job_template_create_parameters) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_template_create_parameters when calling jobTemplateCreate'\n );\n }\n\n $resourcePath = '/projects/{project_id}/job_templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_phrase_app_otp !== null) {\n $headerParams['X-PhraseApp-OTP'] = ObjectSerializer::toHeaderValue($x_phrase_app_otp);\n }\n\n // path params\n if ($project_id !== null) {\n $resourcePath = str_replace(\n '{' . 'project_id' . '}',\n ObjectSerializer::toPathValue($project_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($job_template_create_parameters)) {\n $_tempBody = $job_template_create_parameters;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getTemplate() {}", "public function createTemplate()\n {\n $mock = $this->getMockBuilder('Dhii\\Output\\TemplateInterface')\n ->setMethods(['render'])\n ->getMockForAbstractClass();\n\n return $mock;\n }" ]
[ "0.7934624", "0.7468909", "0.73898196", "0.73898196", "0.7327321", "0.7305498", "0.7277324", "0.7277324", "0.70306325", "0.7004789", "0.69514495", "0.69496715", "0.68879205", "0.6834849", "0.6811877", "0.68095434", "0.6790795", "0.6785001", "0.6769074", "0.6746271", "0.67219967", "0.6694416", "0.6673846", "0.6656306", "0.6638159", "0.6622445", "0.66092044", "0.65938216", "0.65653014", "0.65578103", "0.6524042", "0.6522734", "0.6506995", "0.64944094", "0.6493873", "0.6483221", "0.6462916", "0.6452246", "0.6449832", "0.6415416", "0.6380368", "0.6366072", "0.6349606", "0.6325028", "0.63101965", "0.6278798", "0.62729037", "0.62256324", "0.6221489", "0.62189925", "0.6215965", "0.62137425", "0.6212014", "0.6175435", "0.6167058", "0.61614084", "0.61573315", "0.6131174", "0.61296666", "0.60866106", "0.60864854", "0.6074376", "0.60501724", "0.6041005", "0.6039763", "0.60321814", "0.60305566", "0.6022913", "0.60161704", "0.6010402", "0.59985214", "0.59745187", "0.5971059", "0.5960794", "0.59376556", "0.59371614", "0.5927223", "0.59262973", "0.59193", "0.5883859", "0.586748", "0.5850259", "0.58489996", "0.5848284", "0.584735", "0.5841732", "0.5837676", "0.5832087", "0.58293355", "0.5823205", "0.58179486", "0.5815532", "0.5815532", "0.5797849", "0.5787416", "0.5783007", "0.57824117", "0.57646334", "0.5764331", "0.5762657" ]
0.60079676
70
Make a new alert instance.
public static function make(SessionInterface $session, string $type, ...$args): MessageInterface { $class = Type::clasname($type); if (!class_exists($class)) { throw new Exception("Alert type '$class' class not found "); } return new $class($session, ...$args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(Alert $alert)\n {\n $this->alert = $alert;\n }", "protected function _createAlertItem()\n {\n $alert = $this->_helper->createAlert(\n array(\n 'email' => NoShipmentsAlert_Helper_Data::PATH_EMAIL,\n 'identity' => NoShipmentsAlert_Helper_Data::PATH_IDENTITY,\n 'alert_template' => NoShipmentsAlert_Helper_Data::PATH_ALERT_TEMPLATE,\n 'alert_time' => NoShipmentsAlert_Helper_Data::PATH_ALERT_TIME,\n 'alert_type' => NoShipmentsAlert_Helper_Data::ALERT_TYPE,\n 'store_id' => $this->_storeId\n )\n );\n\n return $alert;\n }", "public static function create()\n {\n list(\n $message,\n $callbackService,\n $callbackMethod,\n $callbackParams\n ) = array_pad( func_get_args(), 4, null);\n\n static::addToEventQueue( array(\n 'type' => \"alert\",\n 'properties' => array(\n 'message' => $message\n ),\n 'service' => $callbackService,\n 'method' => $callbackMethod,\n 'params' => $callbackParams ?? []\n ));\n }", "public function __construct($alert)\n {\n $this->alert = $alert->getId();\n $this->product = $alert->getProduct();\n $this->notifications = $alert->getNotifications();\n $this->added = $alert->getAdded();\n $this->processed = $alert->getProcessed();\n\n $this->archived = new \\DateTime;\n }", "function alert()\n {\n return app('alert');\n }", "public static function alert() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_ALERT, $args);\n\t}", "public function setAlert($alert)\n {\n $this->alert = $alert;\n\n return $this;\n }", "function CPTALERT() {\n\treturn CPTAlert::getInstance();\n}", "public function create()\n {\n return view('alerts.create');\n }", "function &alert( )\n {\n alert( $this->__toString() );\n return $this;\n }", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n\t ->getStateMachine()\n ->getTransition()\n ->abortTransition()\n ->isTransitionAborted()\n // EventInterface\n ->getName()\n ->setName()\n ->getTarget()\n ->setTarget()\n ->getParams()\n ->setParams()\n ->getParam()\n ->setParam()\n ->stopPropagation()\n ->isPropagationStopped();\n\n return $mock->new();\n }", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }", "public function store(CreateAlertRequest $request)\n {\n $input = $request->all();\n\n $alert = $this->alertRepository->create($input);\n\n Flash::success('Alert saved successfully.');\n\n return redirect(route('alerts.index'));\n }", "public static function alert(string $message, array $detail = []): self\n {\n $instance = new self();\n $instance->title = '📢';\n $instance->message = $message;\n $instance->detail = $detail;\n return $instance;\n }", "public function create()\n {\n if (auth()->user()->can('createAlerts')) {\n return view('alertas.create');\n }else{\n abort(403, 'El usuario no se encuentra autorizado para crear alertas');\n }\n }", "public function actionCreateAlertUser($idAlert, $idUser, $action)\n {\n $date = new DateTime('now');\n $newAlertUser = new \\Business\\AlertUser();\n $newAlertUser->idAlert = $idAlert;\n $newAlertUser->idUser = $idUser;\n $newAlertUser->creationDate = $date->format('Y-m-d H:i:s');\n $newAlertUser->action = $action;\n\n if ($newAlertUser->save()) {\n print_r(\"OK! Saved.\");\n } else {\n echo '<pre>';\n print_r($newAlertUser->attributes);\n }\n }", "public function __construct($alert, $broadcastId, $userId, $people, $from, $subject, $message)\n {\n $this->alert = $alert;\n $this->broadcastId = $broadcastId;\n $this->userId = $userId;\n $this->people = $people;\n $this->from = $from;\n $this->subject = $subject;\n $this->message = $message;\n\n }", "public function store(Requests\\StoreAlert $request)\n {\n $this->authorize('create', Alert::class);\n\n $input = $request->all();\n\n $alert = $this->alerts->create(['name' => $input['name']]);\n\n $this->set($alert, $input, [\n 'is_active',\n 'show_url',\n 'slug',\n 'url',\n 'intro',\n 'body',\n 'starts_at',\n 'ends_at',\n ]);\n\n $alert->save();\n\n $this->service()->cache();\n\n return response()->json($alert, 201);\n }", "public static function alertIsPresent()\n {\n return new static(\n function (WebDriver $driver) {\n try {\n // Unlike the Java code, we get a WebDriverAlert object regardless\n // of whether there is an alert. Calling getText() will throw\n // an exception if it is not really there.\n $alert = $driver->switchTo()->alert();\n $alert->getText();\n\n return $alert;\n } catch (NoSuchAlertException $e) {\n return null;\n }\n }\n );\n }", "public function setAlert(Alert $alert): self\n {\n if ($alert->getStatusId() !== $this) {\n $alert->setStatusId($this);\n }\n\n $this->alert = $alert;\n\n return $this;\n }", "function alert($message = null, $title = '')\n {\n $notifier = app('alert');\n if (!is_null($message)) {\n return $notifier->message($message, $title);\n }\n return $notifier;\n }", "public function newInstance();", "public function newInstance();", "public function actionCreate()\n {\n $model = new Alerts();\n\n $date = Yii::$app->request->post('Alerts');\n\n $date = isset($date['date']) ? strtotime($date['date']) : 0;\n\n //print_r(Yii::$app->request->post());exit;\n if ($model->load(Yii::$app->request->post()) ) {\n $model->doctor_id_from = Yii::$app->user->id;\n $model->date = $date;\n if (!$model->save()) {\n print_r($model->getErrors());\n }\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "protected function getAlertHandler()\n {\n return new AlertSessionHandler(\n $this->app['session.store'],\n 'styde/alerts'\n );\n }", "public static function factory($exceptions = TRUE)\n\t{\n\t\treturn new Email($exceptions);\n\t}", "public function Create()\n {\n parent::Create();\n\n //Properties\n $this->RegisterPropertyInteger('InputTriggerID', 0);\n $this->RegisterPropertyString('NotificationLevels', '[]');\n $this->RegisterPropertyBoolean('TriggerOnChangeOnly', false);\n $this->RegisterPropertyBoolean('AdvancedResponse', false);\n $this->RegisterPropertyString('AdvancedResponseActions', '[]');\n\n //Profiles\n if (!IPS_VariableProfileExists('BN.Actions')) {\n IPS_CreateVariableProfile('BN.Actions', 1);\n IPS_SetVariableProfileIcon('BN.Actions', 'Information');\n IPS_SetVariableProfileValues('BN.Actions', 0, 0, 0);\n }\n\n //Variables\n $this->RegisterVariableInteger('NotificationLevel', $this->Translate('Notification Level'), '');\n $this->RegisterVariableBoolean('Active', $this->Translate('Notifications active'), '~Switch');\n $this->RegisterVariableInteger('ResponseAction', $this->Translate('Response Action'), 'BN.Actions');\n\n //Actions\n $this->EnableAction('ResponseAction');\n\n //Timer\n $this->RegisterTimer('IncreaseTimer', 0, 'BN_IncreaseLevel($_IPS[\\'TARGET\\']);');\n\n $this->EnableAction('Active');\n }", "public static function fromArray(Bag|array $bag, array $alert = null): Alert\n {\n if (is_array($bag)) {\n [$bag, $alert] = [app(Bag::class), $bag];\n }\n\n return new static($bag, null, $alert['message'], $alert['types'], [], $alert['dismissible'] ?? false);\n }", "abstract public function sendAlert( );", "function alert($message, array $context = array());", "public function create()\n {\n $this->sesClient->verifyEmailIdentity(\n [\n 'EmailAddress' => $this->identity->getIdentity(),\n ]\n );\n }", "public function __construct($newAlertId, $newAlertCode, $newAlertFrequency, $newAlertPoint, $newAlertOperator) {\n\t\ttry {\n\t\t\t$this->setAlertId($newAlertId);\n\t\t\t$this->setAlertCode($newAlertCode);\n\t\t\t$this->setAlertFrequency($newAlertFrequency);\n\t\t\t$this->setAlertPoint($newAlertPoint);\n\t\t\t$this->setAlertOperator($newAlertOperator);\n\t\t} catch(InvalidArgumentException $invalidArgument) {\n\t\t\t// rethrow the exception to the caller\n\t\t\tthrow(new InvalidArgumentException($invalidArgument->getMessage(), 0, $invalidArgument));\n\t\t} catch(RangeException $range) {\n\t\t\t// rethrow the exception to the caller\n\t\t\tthrow(new RangeException($range->getMessage(), 0, $range));\n\t\t} catch(Exception $exception) {\n\t\t\t//rethrow generic mysqli_sql_exception\n\t\t\tthrow(new Exception($exception->getMessage(), 0, $exception));\n\t\t}\n\t}", "public static function create($notification){\n }", "public function newInstance(): object;", "public function newEvent()\n\t{\n $this->to = $this->domain;\n $this->email = $this->info_mail;\n $this->subject = 'Neue Messe gemeldet';\n $this->view = 'emails.user.new_event';\n\t\t\n\t\t$this->data = [\n\t\t\t'contact'\t\t=> \\Input::get('contact'),\n\t\t\t'email'\t\t\t=> \\Input::get('email'),\n\t\t\t'name'\t\t\t=> \\Input::get('name'),\n\t\t\t'location'\t\t=> \\Input::get('location'),\n\t\t\t'start_date'\t=> \\Input::get('start_date'),\n\t\t\t'end_date'\t\t=> \\Input::has('end_date') ? \\Input::get('end_date') : \\Input::get('start_date'),\n\t\t\t'region'\t\t=> \\Input::get('region'),\n\t\t\t'organizer'\t\t=> \\Input::get('organizer')\n\t\t];\n\n\t\treturn $this;\n\t}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "function alert(Array $messageBag = [])\n {\n $notifier = app('airo.alert');\n \n if (!is_null($messageBag)) {\n return $notifier->success($messageBag);\n }\n return $notifier;\n }", "public function store(AlertFormRequest $request)\n {\n $data = $request->getData($request);\n\n Alert::create($data);\n\n return redirect()->route('alert.index')->withSuccess('You have successfully created a Category!');\n }", "private function create()\n {\n $events = [\n Webhook::EVENT_CONVERSATION_CREATED,\n Webhook::EVENT_CONVERSATION_UPDATED,\n Webhook::EVENT_MESSAGE_CREATED,\n Webhook::EVENT_MESSAGE_UPDATED,\n ];\n\n $chosenEvents = $this->choice(\n 'What kind of event you want to create',\n $events,\n $defaultIndex = null,\n $maxAttempts = null,\n $allowMultipleSelections = true\n );\n\n $webhookUrl = $this->ask('Please enter the webhook URL'); \n\n $webhook = new Webhook();\n $webhook->events = $chosenEvents;\n $webhook->channelId = $this->whatsAppChannelId;\n $webhook->url = $webhookUrl;\n\n try {\n $response = $this->messageBirdClient->conversationWebhooks->create($webhook);\n } catch (\\Exception $e) {\n $this->error($e->getMessage());\n }\n }", "public function store(CoinPriceAlertRequest $request)\n {\n $validatedData = $request->validated();\n $newAlert = $request->user()->coinPriceAlerts()->create($validatedData);\n return response()->json([\n 'status' => 'Success',\n 'id' => $newAlert->id\n ], 201);\n }", "public function alert($srtMsg) {\n\n\t\t$this->response->alert($srtMsg);\n\t}", "public function createEvent(Actions $emailAction){\n $event = new Events();\n $event->type = self::$typeMap[$emailAction->type];\n $event->subtype = 'email';\n $event->associationId = $emailAction->associationId;\n $event->associationType = X2Model::getModelName($emailAction->associationType);\n $event->timestamp = time();\n $event->lastUpdated = $event->timestamp;\n $event->user = $emailAction->assignedTo;\n if($event->save())\n $this->log(Yii::t('app','Created activity feed event for the email.'));\n return $event;\n }", "public function show(Alerts $alert)\n {\n //\n }", "public function createInstance()\n {\n $mock = $this->getMockForTrait(static::TEST_SUBJECT_CLASSNAME);\n $mock->method('_createInvalidArgumentException')\n ->will($this->returnCallback(function ($message = null) {\n return $this->createInvalidArgumentException($message);\n }));\n $mock->method('__')\n ->will($this->returnArgument(0));\n\n return $mock;\n }", "public static function factory(): Speak\n {\n return new static();\n }", "protected function _addAlert($game)\n\t{\n\t\t$this->_alerts[] = $game;\n\t\treturn $this;\n\t}", "public function setAlertForm();", "static function factory($driver = null, $params = null)\n {\n if (is_null($driver)) {\n $driver = empty($GLOBALS['conf']['alarms']['driver']) ? 'sql' : $GLOBALS['conf']['alarms']['driver'];\n }\n\n $driver = basename($driver);\n\n if (is_null($params)) {\n $params = Horde::getDriverConfig('alarms', $driver);\n }\n\n $class = 'Horde_Alarm_' . $driver;\n if (class_exists($class)) {\n $alarm = new $class($params);\n $result = $alarm->initialize();\n if (is_a($result, 'PEAR_Error')) {\n $alarm = new Horde_Alarm($params, sprintf(_(\"The alarm backend is not currently available: %s\"), $result->getMessage()));\n } else {\n $alarm->gc();\n }\n } else {\n $alarm = new Horde_Alarm($params, sprintf(_(\"Unable to load the definition of %s.\"), $class));\n }\n\n return $alarm;\n }", "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public static function alert($message, $context = array()){\n\t\treturn \\Monolog\\Logger::alert($message, $context);\n\t}", "public function __construct(Alert $alertRepository)\n {\n parent::__construct();\n $this->alertRepository = $alertRepository;\n }", "public static function createAlert($id,$text,$type = ALERT_TYPE_INFO,$dismissible = FALSE,$saveDismiss = FALSE){\r\n\t\t$cookieName = \"registeredAlert\" . $id;\r\n\r\n\t\tif($dismissible == false){\r\n\t\t\techo '<div id=\"registeredalert' . $id . '\" class=\"alert alert-' . $type . '\">' . $text . '</div>';\r\n\t\t} else {\r\n\t\t\tif($saveDismiss == false || ($saveDismiss == true && !isset($_COOKIE[$cookieName]))){\r\n\t\t\t\t$d = $saveDismiss == true ? ' onClick=\"saveDismiss(\\'' . $id . '\\');\"' : \"\";\r\n\t\t\t\techo '<div id=\"registeredalert' . $id . '\" class=\"text-left alert alert-dismissible alert-' . $type . '\"><button id=\"registeredalertclose' . $id . '\" type=\"button\" class=\"close\" data-dismiss=\"alert\"' . $d . '>&times;</button>' . $text . '</div>';\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function triggerAlert(AlertInterface $alert);", "public static function make($payload)\n {\n return new static($payload);\n }", "public function create($payload)\n {\n return $this->notification->create($payload);\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "public function create(){}", "public function createInstance()\n {\n $mock = $this->getMockBuilder(static::TEST_SUBJECT_CLASSNAME)\n ->setMethods(\n [\n 'setup',\n 'run',\n ]\n )\n ->getMockForAbstractClass();\n\n return $mock;\n }", "public function alert($message, array $context = array())\n {\n return $this->addRecord(self::ALERT, $message, $context);\n }", "public static function create() {\n\t\t$entry = new GuestbookEntry();\n\t\t$entry->Date = SS_DateTime::now()->getValue();\n\t\t$entry->IpAddress = $_SERVER['REMOTE_ADDR'];\n\t\t$entry->Host = gethostbyaddr($entry->IpAddress);\n\t\treturn $entry;\n\t}", "public function createEvent()\n {\n return new Event();\n }", "public function createInstance()\n {\n $mock = $this->getMockBuilder(static::TEST_SUBJECT_CLASSNAME)\n ->getMockForTrait();\n $mock->method('__')\n ->will($this->returnArgument(0));\n $mock->method('_createInvalidArgumentException')\n ->will($this->returnCallback(function ($message) {\n return new InvalidArgumentException($message);\n }));\n\n return $mock;\n }", "public function create(): ExchangeInterface;", "public function create(ActionEventInterface $actionEvent);", "public function makeException()\n {\n $this->thrownException = ResponseException::create($this);\n }", "public function alert($msg) {\n $this->callMethod( 'alert', array($msg) );\n }", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "public function create()\r\n {\r\n $this->isExistsSchoolSubject()\r\n ->isNameAlpha()\r\n ->setResult()\r\n ->addSchoolSubject()\r\n ->sendResult();\r\n }", "public function alert($message, array $context = array())\n {\n }", "public function makeNew()\n\t{\n\t\treturn new static($this->view);\n\t}", "static function create(): self;", "public function createAlertLoop(LoopInterface $loop)\n {\n $className = \"Loopio\\\\Alertable\\\\React{$this->reactVersion}Alert{$this->alertVersion}Loop\";\n return new $className($loop);\n// return new Alertable\\Loop($reactor);\n }", "public function create() {}", "public function create()\n {}", "public static function newInstance() {\n $class = self::class;\n $void_log = new $class();\n return $void_log;\n }", "function set_alert($message, $type = 'primary') {\n $_SESSION['alert']['message'] = $message;\n $_SESSION['alert']['type'] = $type;\n}", "public function create()\n {\n echo 'create a apple pie'.PHP_EOL;\n }", "function newService($action = \"\")\n {\n $this->closeDialogs();\n $serv = preg_replace('/^new_/', '', $action);\n $this->plugins[$serv]->is_account = TRUE;\n $this->dialogObject = $this->plugins[$serv];\n $this->current = $serv;\n $this->dialog = TRUE;\n }", "public function construct() {\n $this->initiate(\"skin_ticket\");\n\n $code_ticket = $this->ticket_switch();\n\n return $code_ticket;\n }", "public function actionCreateAlert($commentDescription,$statut, $idSubCampaign, $idEcart)\n{\n $date = new DateTime('now');\n\n $newAlert = new \\Business\\Alert();\n $newAlert->creationDate = $date->format('Y-m-d H:i:s');\n $newAlert->statut = $statut;\n $newAlert->idSubCampaign = $idSubCampaign;\n $newAlert->idEcart = $idEcart;\n\n if ($newAlert->save()) {\n $comment = new Business\\CommentAlert();\n $comment->creationDate = $date->format('Y-m-d H:i:s');\n $comment->description = $commentDescription;\n $comment->idAlert = $newAlert->id;\n if (!$comment->save()){\n echo \"error while saving the comment\";\n print_r($comment->getErrors());\n }\n print_r(\"OK! Saved.\");\n } else {\n echo \"error while saving the new Alert\";\n print_r($newAlert->getErrors());\n }\n}", "public function new()\n {\n //\n }", "public function new()\n {\n //\n }", "public function process(Alert $alert, $date) {\n $alert->store();\n\n // Log a creation entry.\n $log = new AlertLog();\n $log['alert_id'] = $alert['id'];\n $log['action'] = AlertLog::A_CREATE;\n $log->store();\n\n $this->client->update($alert);\n }", "public function creating(Storage $storage)\n {\n Mail::send(new NewMaterialStock($storage));\n }", "public function create() {\n\t \n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "protected function registerAlertContainer()\n {\n $this->app->singleton('alert', function ($app) {\n $this->loadConfigurationOptions();\n\n $alert = new Alert(\n $this->getAlertHandler(),\n $this->getTheme()\n );\n\n if ($this->options['translate_texts']) {\n $alert->setLang($app['translator']);\n }\n\n return $alert;\n });\n\n $this->app->alias('alert', Alert::class);\n }", "public function new()\n\t{\n\t\t//\n\t}" ]
[ "0.6744093", "0.66267544", "0.6574323", "0.63371533", "0.6265096", "0.6061547", "0.5973898", "0.586049", "0.579216", "0.57731014", "0.5713225", "0.569577", "0.5636536", "0.5634339", "0.5629033", "0.547038", "0.5393361", "0.53906095", "0.5359729", "0.53453267", "0.53170687", "0.5301903", "0.5301903", "0.5241403", "0.5236312", "0.52354693", "0.522529", "0.52142256", "0.5205263", "0.5190801", "0.512735", "0.51251215", "0.5100413", "0.5087399", "0.5083701", "0.5082566", "0.5082566", "0.5082566", "0.5067759", "0.5044404", "0.50318", "0.5012398", "0.50002503", "0.49904892", "0.49869087", "0.49815497", "0.49806535", "0.49770212", "0.49742326", "0.49735165", "0.49659225", "0.4961934", "0.49561366", "0.4938788", "0.4930978", "0.49309698", "0.49282467", "0.4919134", "0.48930317", "0.48733518", "0.48715132", "0.48699173", "0.48694265", "0.4843983", "0.4838168", "0.48359618", "0.48197117", "0.48171028", "0.48160237", "0.48154473", "0.48131853", "0.48112956", "0.48109964", "0.4809207", "0.48064747", "0.4801751", "0.47977978", "0.47943285", "0.4789549", "0.47775668", "0.47775042", "0.47696757", "0.47683382", "0.47683382", "0.4755365", "0.47384456", "0.47319376", "0.4730736", "0.4730736", "0.4730736", "0.4730736", "0.4730736", "0.4730736", "0.4730736", "0.4730736", "0.4730736", "0.4730736", "0.4730736", "0.47228432", "0.47203663" ]
0.47986537
76
function to clear user inputs
function clearUserInputs($data){ $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function clearInput()\n {\n $this->newPassword = '';\n $this->newPasswordConfirmation = '';\n $this->currentPassword = '';\n }", "function clear_input_data()\r\n{\r\n if (isset($_SESSION['input'])) {\r\n $_SESSION['input'] = [];\r\n }\r\n}", "public function resetInput(){\n $this->userId = null;\n $this->name = null;\n $this->role = null;\n }", "function clear ();", "public function clear( );", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "private function clearInputs($input){\n $input=trim($input);\n $input=htmlspecialchars($input);\n $input=mysqli_real_escape_string($this->connection,$input);\n return $input;\n }", "private function resetInput()\n {\t\t\n //Que id es para las acciones\n $this->selected_id = null;\n $this->cob_solicitud = null;\n $this->cob_comproban = null;\n $this->cob_serie = null;\n $this->cob_numero = null;\n $this->con_subtotal = null;\n $this->cob_igv = null;\n $this->cob_total = null;\n \n }", "function clear() {}", "function clear() {}", "function clear(): void;", "public function clear()\n {\n $this->inputFieldsGroup->clear();\n $this->inputFilesGroup->clear();\n $this->inputImagesGroup->clear();\n $this->inputConditionsGroup->clear();\n }", "private function resetInputFields(){\n $this->name = '';\n $this->content = '';\n $this->todo_id = '';\n }", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "private function resetInputFields()\n {\n $this->agency_id = '';\n $this->state_id = '';\n $this->name = '';\n $this->logo = '';\n $this->email = '';\n $this->phone = '';\n $this->fax = '';\n $this->address = '';\n $this->facebook = '';\n $this->instagram = '';\n $this->youtube = '';\n $this->viber = '';\n $this->whatsapp = '';\n $this->url = '';\n }", "function clearState() ;", "public function resetInputFields(){\n $this->title = '';\n $this->content = '';\n }", "private function resetInputFields(){\n $this->title = '';\n $this->original_url = '';\n $this->platform_id = '';\n }", "function clear($input)\n{\n return stripslashes(nl2br($input));\n}", "private function resetInputFields()\n {\n $this->name = '';\n $this->code = '';\n $this->agency_id = '';\n\n $this->phone = '';\n $this->fax = '';\n\n $this->email = '';\n $this->address = '';\n $this->country = '';\n }", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear () {\n \n }", "private function resetInputFields(){\n $this->title = '';\n $this->body = '';\n $this->page_id = '';\n }", "public function clearState() {}", "private function resetInputFields(){\n $this->teacher_id = '';\n $this->lending_id = '';\n $this->note = '';\n $this->device_id = '';\n $this->org_id_1 = '';\n $this->org_id_2 = '';\n $this->lendingDate = '';\n $this->returnDate = '';\n }", "protected function _clearAndOutput() {}", "public function reset() {\n\t\t\t$this->__construct($this->input);\n\t\t}", "public function reset() {\n $this->data = array(); \n $this->input = array();\n $this->missing = array();\n $this->invalid = array();\n $this->errors = array();\n $this->error = false;\n }", "protected function clear() {}", "public function reset()\n {\n $this->values[self::_WORLDCUP_QUERY_REPLY] = null;\n $this->values[self::_WORLDCUP_SUBMIT_REPLY] = null;\n }", "private function resetInputFields(){\n $this->name = '';\n }", "public function clear()\n {\n }", "private function resetInputFields(){\n $this->nom = '';\n $this->departements_id = '';\n $this->arrondissement_id = '';\n }", "public function clear() {\n\t}", "public function clearSearch(): void {}", "function clearall() {\n}", "function clear_all(){\r\n\r\n if (isset($_POST['clear'])){\r\n global $connection;\r\n\r\n // Clear all entries\r\n $query = \"DELETE FROM games\";\r\n $result = mysqli_query($connection, $query);\r\n }\r\n }", "protected static function clearState() {}", "public function clearSelection();", "public function clear()\r\n {\r\n //no action because always isEmpty is true\r\n }", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "function reset();", "function reset();", "function reset();", "function reset();", "public function clear(){\n if(empty($this->pad)){\n msg('Your pad is empty.');\n closeNode();\n }else{\n msg('Are you sure you want to clear your pad ? (yes/no)');\n bindNode('clearPad');\n }\n }", "public function clear()\n\t{\n\t\t$this->stmt = null;\n\t\t$this->str = null;\n\t}", "public function reset()\n {\n $this->values[self::_REQUEST] = null;\n $this->values[self::_CHANGE] = null;\n }", "public static function clear(){\n self::$answers = [];\n }", "public function reset(){}", "public function clearAll();", "public function clearAll();", "public function clear()\n {\n $this->contents = '';\n }", "public function reset(): void;", "function clearEverything()\r\n{\r\n $_SESSION['part'] = 0;\r\n unset($_SESSION['eq']);\r\n unset($_SESSION['lastAns']);\r\n}", "function reset()\n\t{\n\t $this->inputs = array();\n\t return $this;\n\t}", "public function reset()\n {\n $this->values[self::PHONE] = null;\n $this->values[self::PASSWORD] = null;\n $this->values[self::EQUIPMENT] = null;\n $this->values[self::LOGIN_TYPE] = null;\n }", "protected function clear()\n {\n $this->error = '';\n $this->success = false;\n }" ]
[ "0.7763142", "0.73304564", "0.7041645", "0.6961925", "0.6926291", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.687763", "0.685385", "0.68463683", "0.68372303", "0.68326604", "0.6818209", "0.6755135", "0.6740978", "0.6716376", "0.6716376", "0.6716376", "0.6716376", "0.6716376", "0.6716376", "0.66869265", "0.66417044", "0.6636726", "0.6612559", "0.65857047", "0.6568719", "0.6509638", "0.6509638", "0.6509638", "0.6509638", "0.6502559", "0.6497976", "0.64732116", "0.6432088", "0.6427869", "0.63996613", "0.6387161", "0.63847786", "0.63832045", "0.6359069", "0.6351872", "0.63434786", "0.6332459", "0.63093", "0.62928265", "0.628885", "0.6274868", "0.6269616", "0.62549156", "0.6230751", "0.6230751", "0.6230751", "0.6230751", "0.6230751", "0.6230751", "0.6230751", "0.6230751", "0.6230751", "0.6230751", "0.6230751", "0.6230751", "0.6203568", "0.6203568", "0.6203568", "0.6203568", "0.6203336", "0.6200761", "0.61975944", "0.6169647", "0.6120818", "0.61114764", "0.61114764", "0.6105748", "0.608674", "0.6084822", "0.6084673", "0.6057221", "0.6048401" ]
0.71296114
2
Load data fixtures with the passed EntityManager
public function load(ObjectManager $manager) { //* $faker= Faker\Factory::create(); for ($i=0;$i<5;$i++){ $group = new Group(); $group->setName($faker->company); $group->setRoles(array($this->getRandomRole())); $manager->persist($group); } $manager->flush(); //*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function loadData(ObjectManager $em);", "public function load(ObjectManager $manager)\n {\n // Fixtures are split into separate files\n }", "private function myLoadFixtures()\n {\n $em = $this->getDatabaseManager();\n\n // load fixtures\n $client = static::createClient();\n $classes = array(\n // classes implementing Doctrine\\Common\\DataFixtures\\FixtureInterface\n 'Demofony2\\AppBundle\\DataFixtures\\ORM\\FixturesLoader',\n );\n\n $this->loadFixtures($classes);\n }", "public function load(ObjectManager $manager)\n {\n $entities = Fixtures::load($this->getFixtures(), $manager);\n }", "private function loadGenerated(ObjectManager $em)\n {\n for ($i = 100; $i <= 130; $i++) {\n $fixture = new AlumniExperiences();\n\n $ref_aid = $this->getReference('alumni-anon-'.$i);\n\n $fixture\n ->setAlumni($em->merge($ref_aid))\n ->setOrganization('PT. '.$i)\n ->setDescription('Pekerjaan '.$i);\n\n $em->persist($fixture);\n }\n\n $em->flush();\n }", "protected function loadData(ObjectManager $em)\n {\n }", "public function load(ObjectManager $manager)\n {\n /**\n * Ingredients fixtures\n */\n\n // Ingredients List\n// $ingredientsList = array(\n// 'Cereals' => ['シリアル', 'cereals.jpg', 0],\n// 'Dairy' => ['乳製品', 'dairy.jpg', 0],\n// 'Fruits' => ['果物', 'fruits.jpg', 0],\n// 'Meat' => ['肉', 'meat.jpg', 0],\n// 'Nuts, seeds & oils' => ['ナツ、油', 'nuts-seeds-oils.jpg', 0],\n// 'Other ingredients' => ['その他', 'other-ingredients.jpg', 0],\n// 'Seafood' => ['シーフード', 'seafood.jpg', 0],\n// 'Spices & herbs' => ['スパイス&ハーブ', 'spices-and-herbs.jpg', 0],\n// 'Sugar products' => ['砂糖', 'sugar-products.jpg', 0],\n// 'Vegetables' => ['野菜', 'vegetables.jpg', 0]\n// );\n//\n// foreach ($ingredientsList as $key => $ingredient) {\n// $ingredientDb = new Ingredient();\n// $ingredientDb->setName($key);\n// $ingredientDb->setNameJa($ingredient[0]);\n// $ingredientDb->setImage($ingredient[1]);\n// $ingredientDb->setParent($ingredient[2]);\n//\n// $manager->persist($ingredientDb);\n// $manager->flush();\n// }\n\n// $parentPath = \"web/images/ingredients\";\n// $parentDir = new DirectoryIterator(dirname($parentPath.\"/*\"));\n// $filetypes = array(\"jpg\", \"png\");\n//\n// foreach ($parentDir as $fileParentInfo) {\n// if (!$fileParentInfo->isDot() && $fileParentInfo->isFile()) {\n//\n// $fullName = str_replace('-',' ', ucfirst(substr($fileParentInfo->getFilename(), 0, -4)));\n// $ingredientDb = new Ingredient();\n// $ingredientDb->setName($fullName);\n//\n// $ingredientDb->setImage($fileParentInfo->getFilename());\n// $ingredientDb->setParent(0);\n// $manager->persist($ingredientDb);\n// $manager->flush();\n//\n// $childPath = $parentPath.'/'.$fullName.'/*';\n// $currentId = $ingredientDb->getId();\n// $childDir = new DirectoryIterator(dirname($childPath));\n//\n// foreach ($childDir as $fileinfo) {\n// if (!$fileinfo->isDot() && $fileinfo->isFile() && in_array(strtolower($fileinfo->getExtension()), $filetypes)) {\n// var_dump($fileinfo->getFilename());\n//\n// $childFullName = str_replace('-',' ', ucfirst(substr($fileinfo->getFilename(), 0, -4)));\n// $ingredientDb = new Ingredient();\n// $ingredientDb->setName($childFullName);\n// $ingredientDb->setImage($fullName.'/'.$fileinfo->getFilename());\n// $ingredientDb->setParent($currentId);\n//\n// $manager->persist($ingredientDb);\n// $manager->flush();\n//\n// }\n// }\n// }\n// }\n\n\n// $dir = new DirectoryIterator(dirname(\"web/images/ingredients/vegetables/*\"));\n//\n//\n//\n// foreach ($dir as $fileinfo) {\n// if (!$fileinfo->isDot() && $fileinfo->isFile() && in_array(strtolower($fileinfo->getExtension()), $filetypes)) {\n//\n// $fullName = str_replace('-',' ', ucfirst(substr($fileinfo->getFilename(), 0, -4)));\n// $ingredientDb = new Ingredient();\n// $ingredientDb->setName($fullName);\n//// $ingredientDb->setNameJa($ingredient[0]);\n// $ingredientDb->setImage($fileinfo->getFilename());\n// $ingredientDb->setParent(10);\n////\n// $manager->persist($ingredientDb);\n// $manager->flush();\n//\n// }\n// }\n\n }", "public function load(ObjectManager $manager)\n {\n// $band->setName('Obituary' . rand(1, 100));\n// $band->setSubGenre('Death Metal');\n//\n// $manager->persist($band);\n// $manager->flush();\n \n Fixtures::load(__DIR__.'/fixtures.yml', $manager, [ 'providers' => [$this] ]);\n \n }", "public function load(ObjectManager $em)\n {\n $faker = FakerFactory::create();\n $admin = $this->getReference('user_admin');\n\n for ($i = 0 ; $i < 30 ; $i++) {\n $article = new Article();\n\n $article->setTitle($faker->sentence(4));\n $article->setAuthor($admin);\n $article->setContent('<p>'.$faker->text(500).'</p>');\n $article->setVisible(0 == $i % 2);\n $article->setCreated(new \\DateTime('-'.($i * 4).' day'));\n\n $em->persist($article);\n }\n\n $em->flush();\n }", "public function load(ObjectManager $manager)\n {\n // Array of data for the fixture\n $usersData = array(\n array(\n 'username' => 'superman',\n 'email' => '[email protected]',\n 'password' => 'sup',\n 'roles' => array('ROLE_ADMIN'),\n ),\n array(\n 'username' => 'batman',\n 'email' => '[email protected]',\n 'password' => 'bat',\n 'roles' => array('ROLE_ADMIN'),\n ),\n array(\n 'username' => 'spiderman',\n 'email' => '[email protected]',\n 'password' => 'spi',\n// 'roles' => array(),\n 'roles' => array('ROLE_USER'),\n ),\n array(\n 'username' => 'Martine',\n 'email' => '[email protected]',\n 'password' => 'mar',\n 'roles' => array(),\n ),\n array(\n 'username' => 'Jean',\n 'email' => '[email protected]',\n 'password' => 'jea',\n 'roles' => array(),\n ),\n array(\n 'username' => 'Marc',\n 'email' => '[email protected]',\n 'password' => 'mar',\n 'roles' => array(),\n ),\n array(\n 'username' => 'David',\n 'email' => '[email protected]',\n 'password' => 'dav',\n 'roles' => array(),\n ),\n\n );\n\n // Accessing the user manager service\n $userManager = $this->container->get('fos_user.user_manager');\n\n foreach ($usersData as $i => $userData)\n {\n $user = $userManager->createUser();\n $user->setUsername($userData['username']);\n $user->setEmail($userData['email']);\n $user->setPlainPassword($userData['password']);\n $user->setEnabled(true);\n $user->setRoles($userData['roles']);\n\n $manager->persist($user);\n $this->addReference(sprintf('user-%s', $i), $user);\n }\n $manager->flush();\n }", "public function loadData(ObjectManager $manager)\n {\n // $manager->persist($product);\n $this->createMany(50, \"abonne\", function($num){\n //\"abonne\" s'il est en clé étrangère dans une autre table\n //$num, quel numéro de boucle\n $prenom = $this->faker->firstName;\n $email = $prenom . \".\" . $this->faker->lastName . \"@yopmail.com\";\n return (new Abonne)->setPrenom($prenom)\n ->setEmail($email);\n });\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n for ($i=1; $i <= 100 ; $i++) { \n \t$article = new Article();\n \t$article->setTitre(\"Titre de l'article n°$i\")\n \t\t\t->setContenu(\"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repudiandae eum et vel inventore harum omnis minus. Minima neque perspiciatis, doloremque quia obcaecati harum, quae ut ipsa illo ad autem facilis beatae doloribus delectus veniam. Alias quibusdam praesentium saepe nisi repellat.\n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci ab magnam dolor excepturi quidem blanditiis, consectetur reiciendis similique, voluptates incidunt odio accusantium quas.\n Officia sed, aliquid provident sapiente odio voluptate praesentium neque nobis, culpa animi consequatur ducimus atque repudiandae incidunt aperiam sint! Cum tempora hic velit.\n Dolorum pariatur facere vel consequuntur dignissimos a mollitia sint porro sequi, sed possimus temporibus eum. Ipsum facere quis eius harum, voluptates odit iusto.\n Mollitia, tempore, odio. Itaque sunt ducimus earum nostrum dolorum ratione saepe pariatur ipsum, in ad atque id, corporis, cum ea, omnis hic amet?\n Provident, iure quia nam minus praesentium velit hic placeat soluta ab recusandae, temporibus at aspernatur nisi magnam doloremque. Autem tempore inventore, unde architecto!\")\n \t\t\t->setDate(new \\DateTime());\n\n \t\t\t$manager->persist($article);\n }\n\n $manager->flush();\n }", "protected function reloadDataFixtures()\n {\n $em = $this->getEntityManager();\n $loader = new Loader;\n foreach ($this->dataFixturePaths as $path) {\n $loader->loadFromDirectory($path);\n }\n $purger = new ORMPurger($em);\n $executor = new ORMExecutor($em, $purger);\n $executor->execute($loader->getFixtures());\n $this->fixturesReloaded = true;\n }", "public function testLoadAllFixtures(): void\n {\n $this->loadFixtures();\n $article = $this->getTableLocator()->get('Articles')->get(1);\n $this->assertSame(1, $article->id);\n $category = $this->getTableLocator()->get('Categories')->get(1);\n $this->assertSame(1, $category->id);\n }", "public function testFixtureLoadOnDemand(): void\n {\n $this->loadFixtures('Categories');\n }", "public function load(ObjectManager $manager)\n {\n //FOR LOAD METHOD WITHOUT DROP TABLE \"symfony console doctrine:fixtures:load --append\"\n $contenu_fichier_json = file_get_contents(__DIR__.'/datas.json');\n $datas = json_decode($contenu_fichier_json, true);\n\n foreach($datas['tools'] as $tools ){\n $user = new User();\n $user->setUsername($this->faker->userName)\n ->setEmail($this->faker->email)\n ->setRoles(User::ROLE_USER)\n ->setPassword($this->encoder->encodePassword($user, \"Hub3E2021!\"));\n $manager->persist($user);\n\n $newTools = new Tools();\n $newTools->setName($tools[\"name\"])\n ->setDescription($tools[\"description\"])\n ->setRelation($user);\n $manager->persist($newTools);\n }\n $simpleUser = new User();\n $simpleUser->setUsername(\"user\")\n ->setEmail(\"[email protected]\")\n ->setRoles(User::ROLE_USER)\n ->setPassword($this->encoder->encodePassword($simpleUser, \"Hub3E2021!\"));\n $manager->persist($simpleUser);\n\n $user = new User();\n $user->setUsername(\"admin\")\n ->setEmail(\"[email protected]\")\n ->setRoles(User::ROLE_ADMIN)\n ->setPassword($this->encoder->encodePassword($user, \"Hub3E2021!\"));\n $manager->persist($user);\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n #\n #\n //Fixtures::load(__DIR__.'/fixtures.yml', $manager);\n\n #\n # Same as above but with an extra 3th argument for the formatter providers\n # providers -> passing in this will add all providers to the yml file\n Fixtures::load(\n __DIR__.'/fixtures.yml',\n $manager,\n ['providers' => [$this] ]\n );\n\n\n\n #\n # Load yml file trough nativeloader\n #\n// $loader = new \\Nelmio\\Alice\\Fixtures\\Loader();\n// $objects = $loader->load(__DIR__.'/fixtures.yml', $manager);\n//\n// $persister = new \\Nelmio\\Alice\\Persister\\Doctrine($manager);\n// $persister->persist($objects);\n\n #\n # Loop a few times to create random entries\n #\n// // create 20 products! Bam!\n// for ($i = 0; $i < 20; $i++) {\n//\n// $genius = new Genius();\n// $genius->setName('Octopus'.rand(1, 100));\n// $genius->setSubFamily('Family'.rand(1, 100));\n// $genius->setSpeciesCount(rand(1, 100));\n// $genius->setFunFact('Funfact: '.rand(1, 100));\n// $genius->setLastUpdateAt( new \\DateTime(\"now\") );\n//\n// $manager->persist($genius);\n// $manager->flush();\n\n\n }", "public function load(ObjectManager $manager)\n {\n $userManager = $this->container->get('fos_user.user_manager');\n\n $user = $userManager->createUser();\n $user->setEmail('[email protected]');\n $user->setUsername('admin');\n $user->setname('admin');\n $user->setPlainPassword('admin');\n $user->setEnabled(true);\n $user->addRole('ROLE_ADMIN');\n $this->addReference('user-admin', $user);\n $userManager->updateUser($user);\n\n // Fixture article !\n for ($i = 0; $i < 8; $i++) {\n $Article = new Article();\n $Article->setTitle('Titre' . $i);\n $Article->setContent('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.');\n $Article->setPrice('1399');\n $Article->setMainPicture('fixture0.jpeg');\n $Article->setGalleryPicture(['fixture1.jpeg','fixture2.jpeg','fixture3.jpeg','fixture4.jpeg','fixture5.jpeg','fixture6.jpeg']);\n $manager->persist($Article);\n }\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // Instance de la classe Faker avec un paramètre pour obtenir les données dans la langue souhaitée ->\n $faker = \\Faker\\Factory::create('fr_FR');\n\n // Création d'un tableau regroupant tous les faux utilisateurs ->\n $users = [];\n\n /*-------------------------------\n | CREATION D'UTILISATEURS |\n -------------------------------*/\n\n for ($m = 0; $m <= 10; $m++) {\n $user = new User();\n $user->setEmail($faker->email())\n ->setUsername($faker->name())\n ->setPassword($this->encoder->encodePassword($user, 'password'));\n\n $manager->persist($user);\n\n // Envoi de l'utilisateur vers le tableau ->\n $users[] = $user;\n } // EO for\n\n /*-------------------------------------------------------------------\n | CREATION DE CATEGORIES, D'ARTICLES, DE COMMENTAIRES ET DE LIKES |\n -------------------------------------------------------------------*/\n\n // Création de 3 fakes catégories ->\n for ($i = 1; $i <= 3; $i++) {\n $category = new Category();\n $category->setTitle($faker->sentence())\n ->setDescription($faker->paragraph());\n\n // Pour préparer la persistance des données ->\n $manager->persist($category);\n\n // Création de fakes articles à l'intérieur de ces catégories (entre 4 et 6) ->\n for ($j = 1; $j <= mt_rand(4, 6); $j++) {\n $article = new Article();\n $article->setTitle($faker->sentence())\n ->setContent($faker->paragraphs(5, true))\n ->setImage($faker->imageUrl(640, 480, 'Article illustration'))\n ->setCreatedAt($faker->dateTimeBetween('-6 months'))\n ->setCategory($category);\n\n $manager->persist($article);\n\n // Création de fakes commentaires pour ces articles (entre 4 et 10) ->\n for ($k = 1; $k <= mt_rand(4, 10); $k++) {\n $comment = new Comment();\n\n // Pour le createdAt du commentaire (forcément compris entre la date de création de l'article et aujourd'hui) ->\n $days = (new \\DateTime())->diff($article->getCreatedAt())->days;\n\n $comment->setAuthor($faker->name())\n ->setContent($faker->paragraphs(2, true))\n ->setCreatedAt($faker->dateTimeBetween('-' . $days . ' days'))\n ->setArticle($article);\n\n $manager->persist($comment);\n } // EO for\n\n // Création de fakes likes pour ces articles (entre 0 et 10) ->\n for ($l = 1; $l <= mt_rand(0, 10); $l++) {\n $like = new ArticleLike();\n $like->setArticle($article)\n ->setUser($faker->randomElement($users));\n\n $manager->persist($like);\n } // EO for\n\n } // EO for\n\n } // EO for\n\n /*-----------------------------\n | ENVOI DES FAUSSES DONNÉES |\n -----------------------------*/\n\n $manager->flush();\n\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n //création de faux articles avec faker sans mettre de 'use'\n $faker = \\Faker\\Factory::create('fr_FR');\n for ($i=0; $i < 10; $i++) { \n $article = new Article();\n $article->setTitle($faker->word(2, true))\n ->setContent($faker->paragraphs(2, true))\n ->setImage($faker->imageUrl(300, 250))\n ->setCreatedAt($faker->dateTimeBetween('-6 month'));\n\n //sauvegarder article (objet) dans un tableau\n $manager->persist($article);\n }\n \n //envoie en bdd\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n foreach( AbstractDataFixtures::CATEGORIES as $cat => $sub){\n $slugger = new AsciiSlugger();\n $mainCat = new Category();\n $mainCat\n ->setName($cat)\n ->setSlug($slugger->slug($cat));\n \n $manager->persist($mainCat);\n \n foreach ($sub as $subcats) {\n $subCat = new Category();\n $subCat\n ->setName($subcats)\n ->setSlug($slugger->slug($subcats))\n ->setParent($mainCat);\n \n $manager->persist($subCat);\n\n // mise en memoire les entité pour pouvoir y acceder dans d'autres fixtures\n // addReference : 2 parametres\n // identifiant unique de la référence\n // entité liée à la référence\n $this->addReference(\"subcategory-$subcats\", $subCat);\n }\n }\n \n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n $this->manager = $manager;\n $this->faker = Faker\\Factory::create('fr_FR');\n\n // Executes the loadData function implemented by the user\n $this->loadData($manager);\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n $faker = \\Faker\\Factory::create('fr_FR');\n $user = [];\n for($i=0; $i < 10; $i++){\n $user = new User();\n $user->setFirstname($faker->firstname());\n $user->setLastname($faker->lastname());\n $user->setEmail($faker->email());\n $user->setPassword($faker->password());\n $user->setCreatedAt(new\\DateTime());\n $user->setBirthday(new\\DateTime());\n $manager->persist($user);\n $users[]= $user;\n\n }\n\n $category =[];\n for($i=0; $i < 3; $i++){\n $category = new Category();\n $category->setTitle($faker->text(50));\n $category->setDescription($faker->text(250));\n $category->setImage($faker->imageUrl());\n $manager->persist($category);\n $categories[] = $category;\n }\n $articles = [];\n for($i=0; $i < 6; $i++){\n $article =new Article();\n $article->setTitle($faker->text(50));\n $article->setContent($faker->text(1000));\n $article->setImage($faker->imageUrl());\n $article->setCreatedAt(new\\DateTimeImmutable());\n $article->addCategory($categories[$faker->numberBetween(0,2)]);\n $article->setAuthor($users[$faker->numberBetween(0,9)]);\n $manager->persist($article);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n $faker = \\Faker\\Factory::create();\n\n $category = new Category();\n $category->setName($faker->sentence());\n $category->setDescription(\n $faker->realText($maxNbChars = 150, $indexSize = 2)\n );\n $manager->persist($category);\n $user = new User();\n $user->setUsername('username');\n $user->setEmail($faker->email());\n $user->setPassword($this->encoder->encodePassword($user, 'demo'));\n $user->setToken($faker->md5());\n $user->setIsValidated($faker->boolean());\n $user->setAvatar('avatarDefault.png');\n $user->setSubscribedAT($faker->dateTime());\n $user->setRoles(['ROLE_USER']);\n $manager->persist($user);\n for ($i = 1; $i <=10; $i++) {\n $trick = new Trick();\n $trick->setUser($user);\n $trick->setCategory($category);\n $trick->setName($faker->sentence());\n $content = '<p>'.join($faker->paragraphs(3), '</p><p>').'</p><p>';\n $trick->setDescription($content);\n $trick->setCreatedAt($faker->dateTime());\n $trick->setUpdatedAt($faker->dateTime());\n $manager->persist($trick);\n for ($j=1; $j<=5; $j++) {\n $comment = new Comment();\n $comment->setTrick($trick);\n $comment->setUser($user);\n $comment->setContent($faker->paragraph());\n $comment->setCommentedAt($faker->dateTime());\n $manager->persist($comment);\n }\n for ($k=1; $k<=3; $k++) {\n $image = new Illustration();\n $image->setTrick($trick);\n $image->setName($faker->name());\n $image->setUrl(\"fixtures$k.jpeg\");\n $manager->persist($image);\n }\n for ($m=1; $m<=3; $m++) {\n $media = new Video();\n $media->setTrick($trick);\n $media->setPlatform(\"youtube\");\n $media->setUrl('<iframe width=\"853\" height=\"480\" src=\"https://www.youtube.com/embed/V9xuy-rVj9w\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>');\n $manager->persist($media);\n }\n }\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // TODO : Lorsque les fonctions de location seront créer refaire cette fixture en prenant en compte les état des véhicule (loué ou disponible)\n\n $faker = Factory::create('fr_FR');\n\n $users = $this->userRepository->findAll();\n $vehicle = $this->vehicleRepository->findBy(['state' => true]);\n\n\n for ($i = 0; $i <= 10; $i++) {\n $rental = new Rental();\n $rental->setClient($faker->randomElement($users));\n $rental->setVehicle($faker->randomElement($vehicle));\n $rental->setStartRentalDate(new DateTime());\n $rental->setEstimatedReturnDate(new DateTime());\n $rental->setRealReturnDate(new DateTime());\n $rental->setPrice($faker->randomFloat(2, 20, 220));\n\n $manager->persist($rental);\n }\n\n $manager->flush();\n\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n $faker = Factory::create('fr_FR');\n\n for($i=0;$i<15;$i++)\n {\n $post=new Post();\n $title=$faker->sentence($nbWords=5, $variableNbWords = true);\n $post->setTitle($title)\n ->setContent($faker->text($maxNbChars = 10000));\n\n $manager->persist($post);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n $faker = Factory::create('fr_FR');\n \n $user = new User();\n $user->setFirstname('Matthieu')\n ->setLastname('Poncet')\n ->setEmail('[email protected]')\n ->setPassword($this->passwordHasher->hashPassword($user,'123456'))\n ->setCreatedAt(new \\DateTime($faker->date('Y-m-d h:i')))\n ->setValid(true)\n ->setRoles(['ROLE_ADMIN']);\n\n $manager->persist($user);\n\n\n for ($i=0; $i < 10; $i++) { \n $category = new Category();\n $category->setTitle($faker->sentence(3))\n ->setDescription($faker->realText(600))\n ->setPicture('https://picsum.photos/300/200?id='.uniqid())\n ->setSlug($faker->slug(4));\n\n $manager->persist($category);\n for ($j=0; $j < 10; $j++) { \n $article = new Article();\n $article->setTitle($faker->sentence(3))\n ->setSubtitle($faker->sentence(10))\n ->setContent($faker->realText(600))\n ->setCreateAt(new \\DateTime($faker->date('Y-m-d H:i')))\n ->setPublishedAt(new \\DateTime($faker->date('Y-m-d H:i')))\n ->setPicture('https://picsum.photos/300/200?id='.uniqid())\n ->setValid(true)\n ->setAuthor($user)\n ->addCategory($category)\n ->setSlug($faker->slug(4));\n \n $manager->persist($article); \n }\n\n }\n\n\n $manager->flush();\n }", "private function loadItems(ObjectManager $em, $items)\n {\n foreach ($items as $ref => $item) {\n $fixture = new AlumniExperiences();\n\n $ref_aid = $this->getReference('alumni-'.$item['aid']);\n\n $fixture\n ->setAlumni($em->merge($ref_aid))\n ->setOrganization($item['organization']);\n\n if (array_key_exists('description', $item)) {\n $fixture->setDescription($item['description']);\n }\n\n if (array_key_exists('job_position', $item)) {\n $fixture->setJobPosition($item['job_position']);\n }\n\n if (array_key_exists('year_in', $item)) {\n $fixture->setYearIn($item['year_in']);\n }\n\n if (array_key_exists('year_out', $item)) {\n $fixture->setYearOut($item['year_out']);\n }\n\n $em->persist($fixture);\n }\n $em->flush();\n }", "public function load(ObjectManager $manager)\n {\n $this->manager = $manager;\n $this->faker = Faker::create();\n\n $this->loadData($manager);\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n $faker = Factory::create('fr_FR');\n\n\n for ($i = 0; $i < 8; $i++) {\n $patient = new Patient();\n\n // $chrono = 1;\n\n $patient->setFirstName($faker->firstName())\n ->setLastName($faker->lastName)\n ->setBirthdate($faker->dateTimeBetween('-30 years', '-15 years'));\n\n $user = new User();\n $user->setUsername(strtolower(substr($patient->getFirstName(), 0, 1)) . '.' . strtolower($patient->getLastName()))\n ->setPatient($patient)\n ->setPassword($this->encoder->encodePassword($user, $patient->getBirthdate()->format('Y-m-d'))); // format mot de passe 2002-07-21\n\n $manager->persist($patient);\n $manager->persist($user);\n\n /*for ($c = 0; $c < mt_rand(0, 4); $c++) {\n $exercice = new Exercice();\n $exercice->setName(strtoupper($faker->randomLetter))\n ->setNumberOf($faker->numberBetween(5, 20))\n ->setPatient($patient)\n ->setChrono($chrono);\n\n $chrono++;\n\n $manager->persist($exercice);\n }*/\n }\n\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n $faker = \\Faker\\Factory::create();\n \n for($i=0; $i<5; $i++)\n { \n $categorie = new Categorie();\n $categorie ->setTitre ($faker->sentence())\n ->setResumer ($faker->paragraph());\n \n $manager ->persist($categorie);\n \n for($j=0; $j<10; $j++)\n {\n $article = new Article();\n $article ->setTitle($faker->sentence())\n ->setContent($faker->paragraph($nbSentences = 10, $variableNbSentences = true))\n ->setImage($faker->imageUrl($width=400, $height=200))\n ->setCreatedAt(new \\DateTime())\n ->setCategorie ($categorie);\n \n $manager->persist($article);\n \n for($k=0; $k<10; $k++)\n {\n $commentaire = new commentaire();\n $commentaire ->setAuteur($faker->userName())\n ->setCommentaire($faker->paragraph())\n ->setCreatedAt(new \\DateTime())\n ->setArticle ($article);\n\n $manager->persist($commentaire);\n\n }\n }\n }\n\n $manager->flush(); \n \n }", "protected function loadData(ObjectManager $manager)\n {\n for ($y = 0; $y < 15; $y++) {\n $this->createMany(User::class, 100, function (User $user, int $i) use ($y) {\n if ($y === 0 && $i === 0) {\n // Create default user\n $user\n ->setEmail('[email protected]')\n ->setFirstName('Default')\n ->setLastName('User')\n ->setAge($this->faker->numberBetween(15, 100))\n ->setSex($this->faker->randomElement(GenderEnum::getAvailableTypes()))\n ->setAboutMe($this->faker->text)\n ->setPassword($this->encoder->encodePassword($user, 'test'))\n ->setRoles(['ROLE_USER']);\n return;\n }\n\n // Create random users\n $user\n ->setEmail(($y + 1) . $i . $this->faker->email)\n ->setFirstName($this->faker->firstName)\n ->setLastName($this->faker->lastName)\n ->setAge($this->faker->numberBetween(7, 120))\n ->setSex($this->faker->randomElement(GenderEnum::getAvailableTypes()))\n ->setAboutMe($this->faker->text)\n ->setPassword($this->encoder->encodePassword($user, $user->getEmail()))\n ->setRoles(['ROLE_USER']);\n }, $y);\n\n $manager->flush();\n }\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n $faker = Factory::create('fr_FR');\n\n for ($i = 0; $i < 10; $i++) {\n $post = new Post();\n $post->setTitle($faker->sentence($nbWords = 2, $variableNbWords = true))\n ->setContent($faker->sentence($nbWords = 10, $variableNbWords = true))\n ->setAuthor($faker->name())\n ->setCreatedAt($faker->dateTimeBetween('-6 months'));\n\n $manager->persist($post);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n $faker = Faker\\Factory::create('fr_FR');\n //users \n // on créé 10 personnes\n for ($i = 0; $i < 10; $i++) {\n $user = new Users();\n $user->setName($faker->name);\n $manager->persist($user);\n\n $question = new Questions();\n $question->setTitle($faker->title);\n $question->setContent($faker->realText);\n $question->setUser($user);\n $manager->persist($question);\n\n $answer = new Answers();\n $answer->setContent($faker->realText);\n $answer->setStatus($faker->boolean);\n $answer->setQuestion($question);\n $manager->persist($answer);\n }\n\n //answers\n $manager->flush();\n }", "public function load(ObjectManager $em)\n {\n $faker = Faker\\Factory::create('fr_FR');\n\n for ($i = 0; $i < DataParameters::NB_PRODUCT; $i++)\n {\n $product = new Product();\n $product->setName($faker->word(1, true));\n $product->setDescription($faker->sentences(7, true));\n $em->persist($product);\n\n $this->setReference('product_id_' . $i, $product);\n }\n $em->flush();\n\n }", "public function load(ObjectManager $manager)\n {\n $content1 = new Content();\n $content1->setName(\"Test_Content_1\");\n $content1->setPath(\"https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd\");\n $content1->setOrdinance(1);\n $manager->persist($content1);\n\n $content2 = new Content();\n $content2->setName(\"Test_Content_2\");\n $content2->setPath(\"https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd\");\n $content2->setOrdinance(2);\n $manager->persist($content2);\n\n $content3 = new Content();\n $content3->setName(\"Test_Content_3\");\n $content3->setPath(\"https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd\");\n $content3->setOrdinance(3);\n $manager->persist($content3);\n\n $content4 = new Content();\n $content4->setName(\"Test_Content_4\");\n $content4->setPath(\"https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd\");\n $content4->setOrdinance(4);\n $manager->persist($content4);\n\n $content5 = new Content();\n $content5->setName(\"Test_Content_5\");\n $content5->setPath(\"https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd\");\n $content5->setOrdinance(5);\n $manager->persist($content5);\n\n $manager->flush();\n }", "protected function loadData(ObjectManager $manager)\n {\n }", "public function load(ObjectManager $manager)\n {\n $date = new \\DateTime();\n\n\n for ($i = 0; $i < 20; $i++) {\n $article = new Article();\n $article->setTitle('article ' . $i);\n $article->setContent($this->generer_lipsum(300, 'words'));\n $article->setAuthor('Bibi');\n $article->setDate( $date );\n $article->setCategory('catégorie ' . mt_rand(1, 5));\n $article->setViewCount(mt_rand(1, 1000));\n\n $manager->persist($article);\n }\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n for ($i = 100; $i <= 105; $i++)\n {\n $jobs_sensio_labs = new Job();\n $jobs_sensio_labs->setCategory($manager->merge($this->getReference(\"category-programming\")));\n $jobs_sensio_labs->setType(\"full-time\");\n $jobs_sensio_labs->setCompany(\"Sensio Labs\" . $i);\n $jobs_sensio_labs->setLogo(\"sensio-labs.gif\");\n $jobs_sensio_labs->setUrl(\"http://www.sensiolabs.com/\");\n $jobs_sensio_labs->setPosition(\"Web Developer\");\n $jobs_sensio_labs->setLocation(\"Paris, France\");\n $jobs_sensio_labs->setDescription(\"You've already developed websites with symfony and you want to work with Open-Source technologies. You have a minimum of 3 years experience in web development with PHP or Java and you wish to participate to development of Web 2.0 sites using the best frameworks available.\");\n $jobs_sensio_labs->setHowToApply(\"Send your resume to fabien[a]sensio.com\");\n $jobs_sensio_labs->setIsPublic(true);\n $jobs_sensio_labs->setIsActivated(true);\n $jobs_sensio_labs->setEmail(\"[email protected]\");\n $jobs_sensio_labs->setExpiresAt(new \\DateTime(\"+30 days\"));\n\n $manager->persist($jobs_sensio_labs);\n }\n\n for ($i = 100; $i <= 130; $i++)\n {\n $job_extreme_sensio = new Job();\n $job_extreme_sensio->setCategory($manager->merge($this->getReference('category-design')));\n $job_extreme_sensio->setType('part-time');\n $job_extreme_sensio->setCompany('Extreme Sensio ' . $i);\n $job_extreme_sensio->setLogo('extreme-sensio.gif');\n $job_extreme_sensio->setUrl('http://www.extreme-sensio.com/');\n $job_extreme_sensio->setPosition('Web Designer');\n $job_extreme_sensio->setLocation('Paris, France');\n $job_extreme_sensio->setDescription('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in.');\n $job_extreme_sensio->setHowToApply('Send your resume to fabien.potencier [at] sensio.com');\n $job_extreme_sensio->setIsPublic(true);\n $job_extreme_sensio->setIsActivated(true);\n $job_extreme_sensio->setEmail('[email protected]');\n $job_extreme_sensio->setExpiresAt(new \\DateTime('+30 days'));\n\n $manager->persist($job_extreme_sensio);\n }\n\n $manager->flush();\n }", "function load(ObjectManager $manager)\n\t{\n\t\t$entities = [\n\t\t\tEntity::createDefault(1, 18, 0), // 1\n\t\t\tEntity::createDefault(2, 5, 1), // 2\n\t\t\tEntity::createDefault(6, 15, 1), // 3\n\t\t\tEntity::createDefault(16, 17, 1), // 4\n\t\t\tEntity::createDefault(3, 4, 2), // 5\n\t\t\tEntity::createDefault(7, 8, 2), // 6\n\t\t\tEntity::createDefault(9, 10, 2), // 7\n\t\t\tEntity::createDefault(11, 14, 2), // 8\n\t\t\tEntity::createDefault(12, 13, 3), // 9\n\t\t];\n\t\tforeach ($entities as $entity) {\n\t\t\t$manager->persist($entity);\n\t\t}\n\t\t$manager->flush();\n\t}", "public function load(ObjectManager $manager)\n {\n $employees = array(\n array(\"remi\", \"rebeil\", \"blabla\", \"https://www.youtube.com/watch?v=HeNURpr3vaw\"),\n array(\"christophe\", \"lacassagne\", \"blathrhe\", \"https://www.youtube.com/watch?v=Ua4XhSoEQZ0\"),\n array(\"delphine\", \"janton\", \"zdfsdf\", \"https://www.youtube.com/watch?v=DD7hm67cfbc\"),\n );\n\n foreach ($employees as $employee) {\n $employeeObj = new Employees();\n $employeeObj->setFirstName($employee[0]);\n $employeeObj->setLastName($employee[1]);\n $employeeObj->setVideoDescription($employee[2]);\n $employeeObj->setVideoUrl($employee[3]);\n\n $manager->persist($employeeObj);\n unset($employeeObj);\n }\n $manager->flush();\n $manager->clear();\n }", "public function load(ObjectManager $manager)\r\n {\r\n\r\n $faker = Faker::create();\r\n foreach (range(1,20) as $key => $value){\r\n $tag = new Tag();\r\n $tag->setNome($faker->city);\r\n $this->addCustomers($tag);\r\n $this->addCampaigns($tag);\r\n $manager->persist($tag);\r\n }\r\n\r\n $manager->flush();\r\n }", "public function load(ObjectManager $manager)\n {\n // TODO: Implement load() method.\n //load medecin\n for($i=1;$i<20;$i++){\n $medecin= new Medecin();\n $medecin->setNomComplet('medecin'.$i);\n $medecin->setMatricule('mat'.$i);\n $manager->persist($medecin);\n }\n //load patient\n for($i=1;$i<20;$i++){\n $patient= new Patient();\n $patient->setNomComplet('patient'.$i);\n $patient->setDateNaissance(new \\DateTime());\n $patient->setNumDossier('dossier'.' '.$i);\n $manager->persist($patient);\n }\n $user = new User();\n $user->setEmail('[email protected]');\n $user->setUsername('admin');\n $user->setPlainPassword('admin');\n $user->setEnabled(true);\n $manager->persist($user);\n\n //events\n $schedule = new Schedule();\n $schedule->setTitle('Yoga class');\n $today = new \\DateTime();\n $endate= new \\DateTime(\"tomorrow\");\n $schedule->setStart($today);\n $schedule->setEnd($endate);\n $manager->persist($schedule);\n $schedule = new Schedule();\n $schedule->setTitle('German class');\n $tomorrow = new \\DateTime('tomorrow');\n $schedule->setStart($tomorrow);\n $schedule->setEnd($tomorrow);\n $manager->persist($schedule);\n $schedule = new Schedule();\n $schedule->setTitle('rendez vous');\n $tomorrow = new \\DateTime('tomorrow');\n $schedule->setStart($tomorrow);\n $schedule->setEnd($tomorrow);\n $manager->persist($schedule);\n\n //load crenneau medecin\n/* for($i=1;$i<20;$i++){\n $crenneauMedecin=new CreneauxMedecin();\n $crenneauMedecin->setCodeCrenneaux('creMedecin n°'.$i);\n $crenneauMedecin->setMedecin($manager->getRepository('AppBundle:Medecin')->findOneBy(array('nomComplet'=>'medecin'.$i)));\n $crenneauMedecin->setHeureDebut(new \\DateTime());\n $crenneauMedecin->setHeureFin(new \\DateTime());\n $manager->persist($crenneauMedecin);\n\n }*/\n $manager->flush();\n }", "public function createData(EntityManager $em);", "protected function createFixtures()\n {\n // Due to a dubious bug(?) in doctrine - product types need to be loaded first.\n $typeFixtures = new LoadProductTypes();\n $typeFixtures->load($this->entityManager);\n $this->productType = $this->getProductTypeRepository()->find(self::PRODUCT_TYPE_ID);\n $this->addonProductType = $this->getProductTypeRepository()->find(self::PRODUCT_TYPE_ADDON_ID);\n\n $countries = new LoadCountries();\n $countries->load($this->entityManager);\n\n $this->contactTestData = new ContactTestData($this->container);\n\n $loadCurrencies = new LoadCurrencies();\n $loadCurrencies->load($this->entityManager);\n\n $this->currency = $this->getCurrencyRepository()->findByCode($this->defaultCurrencyCode);\n\n $unitFixtures = new LoadUnits();\n $unitFixtures->load($this->entityManager);\n $this->orderUnit = $this->getProductUnitRepository()->find(self::ORDER_UNIT_ID);\n\n $this->contentUnit = $this->getProductUnitRepository()->find(self::CONTENT_UNIT_ID);\n\n $taxClasses = new LoadTaxClasses();\n $taxClasses->load($this->entityManager);\n $this->taxClass = $this->getTaxClassRepository()->find(self::TAX_CLASS_ID);\n\n $countryTaxes = new LoadCountryTaxes();\n $countryTaxes->load($this->entityManager);\n\n $collectionTypes = new LoadCollectionTypes();\n $collectionTypes->load($this->entityManager);\n\n $mediaTypes = new LoadMediaTypes();\n $mediaTypes->load($this->entityManager);\n\n $attributeTypes = new LoadAttributeTypes();\n $attributeTypes->load($this->entityManager);\n $this->attributeType = $this->getAttributeTypeRepository()->find(self::ATTRIBUTE_TYPE_ID);\n\n $statusFixtures = new LoadProductStatuses();\n $statusFixtures->load($this->entityManager);\n $this->productStatus = $this->getProductStatusRepository()->find(Status::ACTIVE);\n $this->productStatusChanged = $this->getProductStatusRepository()->find(Status::CHANGED);\n $this->productStatusImported = $this->getProductStatusRepository()->find(Status::IMPORTED);\n $this->productStatusSubmitted = $this->getProductStatusRepository()->find(Status::SUBMITTED);\n\n $deliveryStatusFixtures = new LoadDeliveryStatuses();\n $deliveryStatusFixtures->load($this->entityManager);\n }", "public function load()\n {\n $this\n ->objectManager\n ->createQuery('DELETE FROM ' . Member::class)\n ->execute()\n ;\n Fixtures::load(\n __DIR__ . '/../../fixtures/members.yml',\n $this->objectManager\n );\n }", "public function load(ObjectManager $manager)\n {\n $faker = Factory::create();\n\n foreach (['ile-mysterieuse', 'dale' ] as $bookRef) {\n $book = $this->getReference($bookRef);\n $exemplaire = new Exemplaire();\n\n $exemplaire->setLivre($book);\n\n $exemplaire->setDateAcquis($faker->dateTime)\n ->setCode($faker->ean8)\n ->setCout(5000)\n ->setEtat(\"parfait\");\n\n $exemplaire->getLivre()->addExemplaire($exemplaire);\n\n $manager->persist($exemplaire);\n $manager->persist($book);\n $manager->flush();\n\n $this->addReference(\"exemplaire-$bookRef\", $exemplaire);\n }\n\n\n }", "public function load(ObjectManager $manager) {\n for ($i = 0; $i < 2; $i++) {\n $jobFaker = Faker\\Factory::create();\n\n // Employeer\n $employeer = new Employeers();\n $employeer->setUsername(\"empleador_$i\");\n $employeer->setEmail(\"[email protected]\");\n $employeer->setPassword(\"4Vientos\");\n\n $employeer->setVCIF(\"82102288A\");\n $employeer->setVName($jobFaker->company);\n $employeer->setVLogo($jobFaker->imageUrl($width = 640, $height = 480));\n $employeer->setVDescription($jobFaker->sentence);\n $employeer->setVContactName($jobFaker->name);\n $employeer->setVContactPhone($jobFaker->phoneNumber);\n $employeer->setVContactMail($jobFaker->companyEmail);\n $employeer->setVLocation($jobFaker->address);\n $employeer->setNNumberOfWorkers($jobFaker->numberBetween(0, 255));\n $employeer->setCreationUser(\"InitialFixture\");\n $employeer->setCreationDate(new \\DateTime(\"2018-6-1\"));\n $employeer->setModificationUser(\"InitialFixture\");\n $employeer->setModificationDate(new \\DateTime(\"2018-6-1\"));\n\n $manager->persist($employeer);\n\n // Poemas\n \n $poema = new poemas();\n $poema->setUser();\n $poema->setTexto($texto);\n $poema->setCategory();\n \n // Offer\n $offer = new Offers();\n $offer->setVOfferCode(\"ACTIVE\");\n $offer->setVOfferType('full-time');\n $offer->setDActivationDate(new \\DateTime(\"2019-1-1\"));\n $offer->setDDueDate(new \\DateTime(\"2019-2-$i\"));\n $offer->setVPosition(\"Developer\");\n $offer->setLtextDuties($jobFaker->paragraph);\n $offer->setLtextDescription($jobFaker->paragraph);\n $offer->setVSalaray(\"1200\");\n $offer->setLtextExperienceRequirements($jobFaker->paragraph);\n $offer->setVLocation($jobFaker->city . ', ' . $jobFaker->country);\n\n $offer->setEmployeer($employeer);\n\n $offer->setCreationUser(\"InitialFixture\");\n $offer->setCreationDate(new \\DateTime(\"2018-6-1\"));\n $offer->setModificationUser(\"InitialFixture\");\n $offer->setModificationDate(new \\DateTime(\"2018-6-1\"));\n\n $manager->persist($offer);\n }\n\n // Creating 2 FormedStudents\n for ($i = 0; $i < 2; $i++) {\n $studentFaker = Faker\\Factory::create();\n\n $formedStudent = new FormerStudents();\n $formedStudent->setUsername(\"exalumno_$i\");\n $formedStudent->setEmail(\"[email protected]\");\n $formedStudent->setPassword(\"4Vientos\");\n\n $formedStudent->setVNIF($studentFaker->randomNumber(6));\n $formedStudent->setVName($studentFaker->firstName);\n $formedStudent->setVSurnames($studentFaker->lastName);\n $formedStudent->setVAddress($studentFaker->streetAddress);\n $formedStudent->setDBirthDate($studentFaker->dateTime);\n $formedStudent->setBVehicle($studentFaker->boolean);\n\n $formedStudent->setCreationUser(\"InitialFixture\");\n $formedStudent->setCreationDate(new \\DateTime(\"2018-8-1\"));\n $formedStudent->setModificationUser(\"InitialFixture\");\n $formedStudent->setModificationDate(new \\DateTime(\"2018-6-1\"));\n $manager->persist($formedStudent);\n }\n\n \n\n\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n\n $faker = Faker\\Factory::create('en_US');\n\n // Creating admin user\n $admin = new User();\n $admin->setEmail('[email protected]');\n $admin->setRoles(['ROLE_ADMIN']);\n $admin->setPassword($this->passwordEncoder->encodePassword(\n $admin,\n 'adminpassword'\n ));\n\n $manager->persist($admin);\n\n // Creating cluber user : run team\n $cluber = new User();\n $cluber->setEmail('[email protected]');\n $cluber->setRoles(['ROLE_CLUBER']);\n $cluber->setPassword($this->passwordEncoder->encodePassword(\n $cluber,\n 'clubpassword'\n ));\n $manager->persist($cluber);\n\n // Creating cluber user : swim team\n $cluber2 = new User();\n $cluber2->setEmail('[email protected]');\n $cluber2->setRoles(['ROLE_CLUBER']);\n $cluber2->setPassword($this->passwordEncoder->encodePassword(\n $cluber2,\n 'clubpassword'\n ));\n $manager->persist($cluber2);\n\n // Fixtures for profil -(//\n $profilClub = new ProfilClub();\n $profilClub->setNameClub('Run Team');\n $profilClub->setCityClub('Lille');\n $profilClub->setLogoClub('avatar2.jpg');\n $profilClub->setDescriptionClub('Petite equipe Lilloise');\n $profilClub->addUser($cluber);\n $manager->persist($profilClub);\n\n $profilClub2 = new ProfilClub();\n $profilClub2->setNameClub('Swim Team');\n $profilClub2->setCityClub('Douai');\n $profilClub2->setLogoClub(\n 'https://image.shutterstock.com/image-vector/swimming-club-logo-design-swimmer-600w-255149764.jpg'\n );\n $profilClub2->setDescriptionClub('Club de natation');\n $profilClub2->addUser($cluber2);\n $manager->persist($profilClub2);\n\n // Fixtures for profil Solo//\n $profilSolo = new ProfilSolo();\n $profilSolo->setLastname('Doe');\n $profilSolo->setFirstname('Jonh');\n $profilSolo->setBirthdate(new DateTime(141220));\n $profilSolo->setDescription('J\\'ai perdu la mémoire ! Mais j\\'aime nager en crawl.');\n $profilSolo->setGender(0);\n $profilSolo->setAvatar('https://randomuser.me/api/portraits/men/97.jpg');\n $profilSolo->setEmergencyContactName('Pascale Dino');\n $profilSolo->setLevel(1);\n $profilSolo->setSportFrequency(2);\n $profilSolo->setPhone('0000000000');\n $profilSolo->setEmergencyPhone('0000000000');\n $profilSolo->setProfilClub($profilClub2);\n $manager->persist($profilSolo);\n\n // Fixtures for profil Solo2//\n $profilSolo2= new ProfilSolo();\n $profilSolo2->setLastname('Franz');\n $profilSolo2->setFirstname('Albert');\n $profilSolo2->setBirthdate(new DateTime(141220));\n $profilSolo2->setDescription('Je suis Albert');\n $profilSolo2->setGender(0);\n $profilSolo2->setAvatar('https://randomuser.me/api/portraits/men/97.jpg');\n $profilSolo2->setEmergencyContactName('Pascale Dino');\n $profilSolo2->setLevel(1);\n $profilSolo2->setSportFrequency(2);\n $profilSolo2->setPhone('0000000000');\n $profilSolo2->setEmergencyPhone('0000000000');\n $profilSolo2->setProfilClub($profilClub2);\n $manager->persist($profilSolo2);\n\n\n // Creating lambda user\n $user = new User();\n $user->setProfilSolo($profilSolo);\n $user->setEmail('[email protected]');\n $user->setRoles(['ROLE_USER']);\n $user->setPassword($this->passwordEncoder->encodePassword(\n $user,\n 'userpassword'\n ));\n\n \n $manager->persist($user);\n\n /* $users[] = $user;*/\n \n // Creating lambda user2\n $user2 = new User();\n $user2->setProfilSolo($profilSolo2);\n $user2->setEmail('[email protected]');\n $user2->setRoles(['ROLE_USER']);\n $user2->setPassword($this->passwordEncoder->encodePassword(\n $user2,\n 'userpassword'\n ));\n $manager->persist($user2);\n\n // Fixtures for sportCategory//\n $sportCategory = new SportCategory();\n $sportCategory->setNameCategory('Running');\n $manager->persist($sportCategory);\n\n // Fixtures for sport//\n $sport= new Sport();\n $sport->setSportName('Course à pied');\n $sport->setSportCategory($sportCategory);\n $manager->persist($sport);\n\n // Fixtures for event page//\n $event = new Event();\n $event->setNameEvent('Entrainement de course ');\n $event->setLevelEvent(1);\n $event->setDateEvent($faker->dateTimeThisMonth);\n $event->setTimeEvent($faker->dateTimeThisMonth);\n $event->setDescription('Courses dans la nature');\n $event->setParticipantLimit('10');\n $event->setPlaceEvent('23 place des ecoliers 59000 Lille');\n $event->setSport($sport);\n $event->setCreatorClub($profilClub);\n $manager->persist($event);\n\n // Fixtures for GeneralChatClub\n $messageClub = new GeneralChatClub();\n $messageClub->setProfilClub($profilClub2);\n $messageClub->setDateMessage(new DateTime('now'));\n $messageClub->setContentMessage('Bonjour, je suis un club de natation');\n $manager->persist($messageClub);\n\n \n //participation\n /*for ($j = 0; $j < mt_rand(0, 10); $j++) {\n $participationLike = new ParticipationLike();\n\n $participationLike->setEvent($event)\n ->setUser($faker->randomElement($users));\n $manager->persist($participationLike);\n\n\n $manager->flush();\n }*/\n\n $messageClub2 = new GeneralChatClub();\n $messageClub2->setProfilClub($profilClub);\n $messageClub2->setDateMessage(new DateTime('now'));\n $messageClub2->setContentMessage('Bonjour, je suis un club de run');\n $manager->persist($messageClub2);\n\n $messageSolo = new GeneralChatClub();\n $messageSolo->setProfilClub($profilClub2);\n $messageSolo->setProfilSolo($profilSolo);\n $messageSolo->setDateMessage(new DateTime('now'));\n $messageSolo->setContentMessage('Bonjour, je suis John.');\n $manager->persist($messageSolo);\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n $exampleSet = array();\n\n shuffle(self::$tweets);\n shuffle(self::$growls);\n shuffle(self::$hisses);\n\n shuffle(self::$feathersDescriptions);\n shuffle(self::$furDescriptions);\n shuffle(self::$scaleDescriptions);\n\n shuffle(self::$names);\n\n $this->loadMammals($exampleSet);\n $this->loadReptiles($exampleSet);\n $this->loadBirds($exampleSet);\n\n foreach ($exampleSet as $example)\n {\n $manager->persist($example);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n $person1 = new Person();\n $person1->setPseudo('MOI')\n ->setLastname('Pikachu')\n ->setLevel(100)\n ->setGuild('Pokemon')\n ->setRank($this->getReference(RankFixtures::RANK_ONE))\n ->setImage('')\n ->setUser($this->getReference(UserFixtures::USER_ONE));\n\n $manager->persist($person1);\n $manager->flush();\n\n $person2 = new Person();\n $person2->setPseudo('KAL-EL')\n ->setLastname('Kent')\n ->setFirstname('Clark')\n ->setLevel(90)\n ->setGuild('Alien')\n ->setRank($this->getReference(RankFixtures::RANK_TWO))\n ->setImage('')\n ->setUser($this->getReference(UserFixtures::USER_TWO));\n\n $manager->persist($person2);\n $manager->flush();\n\n $person3 = new Person();\n $person3->setPseudo('One-PunchMan')\n ->setLastname('Saitama')\n ->setLevel(90)\n ->setGuild('Human')\n ->setRank($this->getReference(RankFixtures::RANK_TWO))\n ->setImage('')\n ->setUser($this->getReference(UserFixtures::USER_THREE));\n\n $manager->persist($person3);\n $manager->flush();\n\n $person4 = new Person();\n $person4->setPseudo('Mugiwara')\n ->setName('Monkey.D')\n ->setFirstname('Luffy')\n ->setLevel(80)\n ->setGuild('Pirate')\n ->setRank($this->getReference(RankFixtures::RANK_FOUR))\n ->setImage('')\n ->setUser($this->getReference(UserFixtures::USER_FOUR));\n\n $manager->persist($person4);\n $manager->flush();\n\n }", "public function load(ObjectManager $manager)\n {\n $user = new User();\n $user\n ->setUsername('admin')\n ->setEmail('[email protected]')\n ->setIsActive(true)\n ;\n $password = $this->encoder->encodePassword($user, '20E!xI&$Zx');\n $user->setPassword($password);\n\n $manager->persist($user);\n\n\n $user = new User();\n $user\n ->setUsername('pete')\n ->setEmail('[email protected]')\n ->setIsActive(true)\n ;\n $password = $this->encoder->encodePassword($user, 'shuoop');\n $user->setPassword($password);\n\n $manager->persist($user);\n\n // Create some customers\n for ($i = 0; $i < 25; $i++) {\n $cust = new Customer();\n $cust\n ->setAccountRef('CUST000' . $i)\n ->setName($this->faker->company)\n ->setTelephone($this->faker->phoneNumber)\n ->setEmail($this->faker->companyEmail)\n ->setContactName($this->faker->name)\n ->setAddress($this->address())\n ;\n $manager->persist($cust);\n }\n\n // Create some vehicles\n for ($i = 0; $i < 15; $i++) {\n $vehicle = new Vehicle();\n $vehicle\n ->setRegistration(strtoupper($this->vehicleReg()))\n ->setModel(ucfirst($this->faker->word))\n ->setMake(ucfirst($this->faker->word))\n ->setVehicleType($manager->getReference(VehicleType::class, $this->vehicleTypes()[array_rand($this->vehicleTypes())]))\n ->setDepth($this->faker->randomFloat(2, 0, 100))\n ->setWidth($this->faker->randomFloat(2, 0, 100))\n ->setHeight($this->faker->randomFloat(2, 0, 100))\n ;\n $manager->persist($vehicle);\n }\n\n // Create some drivers\n for ($i = 0; $i < 15; $i++) {\n $driver = new Driver();\n $driver\n ->setName($this->faker->name)\n ->setTelephone($this->faker->phoneNumber)\n ->setEmail($this->faker->freeEmail)\n ->setTradingName($driver->getName())\n ->setAddress($this->address())\n ->setSubcontractor(false)\n ;\n $manager->persist($driver);\n }\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n for ($i = 0; $i < 20; $i++) {\n $article = new Article();\n $article->setTitle('product '.$i)\n ->setSlug(\"product-\".$i)\n ->setContent(\"Contenu du produit...\")\n ->setPicture(\"\")\n ->setIsPublished(true)\n ->setPublishedAt(new \\DateTime('now'))\n ->setUpdatedAt(new \\DateTime('now'))\n ;\n $manager->persist($article);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n\n $parent = new Parents();\n $parent->setPrenom(\"Soiei\");\n $parent->setNom(\"SIe\");\n $parent->setEmail(\"SIseos\");\n $parent->setAdr(\"SOskaoisa\");\n $parent->setMethodeContact(\"OISoeie\");\n $parent->setTel(\"S0Keiosk\");\n $parent->setResponsable(\"OSkes\");\n\n $parents=new ArrayCollection();\n $parents->add($parent);\n\n // create 20 products! Bam!\n for ($i = 0; $i < 3; $i++) {\n $eleve = new Eleve();\n $parent->setEleve($eleve);\n\n $eleve->setNom('NomEns '.$i);\n $eleve->setPrenom('PrenomEns '.$i);\n $eleve->setUsername('setUsername '.$i);\n $eleve->setPassword('setPassword '.$i);\n $eleve->setEmail('setEmail '.$i);\n $eleve->setAdresse('setAdresse '.$i);\n $eleve->setRoles(['ROLE_ELEVE']);\n $eleve->setImageName(\"tester.jpg\");\n $eleve->setDateNaissance(new \\DateTime());\n $eleve->setTelephone(\"2205826\".$i);\n $eleve->setSex(\"H\");\n $eleve->addParent($parent);\n\n\n $manager->persist($eleve);\n $this->addReference('eleve'.$i, $eleve);\n\n }\n\n $manager->flush();\n }", "protected function _loadFixture($fixture)\n {\n $this->db->query(file_get_contents(\n NL_TEST_DIR.\"/tests/migration/fixtures/$fixture.sql\"\n ));\n }", "public function load(ObjectManager $manager)\r\n {\r\n $disciplinas = $manager->getRepository('BackendBundle:Disciplinas')->findAll();\r\n\r\n foreach ($disciplinas as $disciplina) {\r\n $deportesTinn = new CampeonatoDisciplina();\r\n $deportesTinn->setMaximo(50); \r\n $deportesTinn->setMinimo(50);\r\n $deportesTinn->setInicio(new \\DateTime('2016-11-21'));\r\n $deportesTinn->setFin(new \\DateTime('2016-12-16'));\r\n $deportesTinn->setDisciplina($disciplina);\r\n $deportesTinn->setCampeonato($this->getReference('campeonato'));\r\n $deportesTinn->setAbierto(50);\r\n $deportesTinn->setEntrenador(1);\r\n $deportesTinn->setAsistente(1);\r\n $deportesTinn->setDelegado(1);\r\n $deportesTinn->setMedico(1);\r\n $deportesTinn->setLogistico(1);\r\n $manager->persist($deportesTinn);\r\n $manager->flush(); \r\n }\r\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n $empresa1=new Empresas();\n $empresa1->setNombre(\"Vodafone\");\n $empresa1->setDireccion('C/La piruleta 34');\n $empresa1->setFechaRegistro(new \\DateTime('2019-05-04'));\n $manager->persist($empresa1);\n\n $empresa2=new Empresas();\n $empresa2->setNombre(\"Apple\");\n $empresa2->setDireccion('C/Inventada 24');\n $empresa2->setFechaRegistro(new \\DateTime('1980-03-10'));\n $manager->persist($empresa2);\n\n $empresa3=new Empresas();\n $empresa3->setNombre(\"Xiaomi\");\n $empresa3->setDireccion('C/Inexistente 1');\n $empresa3->setFechaRegistro(new \\DateTime('2010-06-12'));\n $manager->persist($empresa3);\n\n $empresa4=new Empresas();\n $empresa4->setNombre(\"Acer\");\n $empresa4->setDireccion('Avda. El Brillante 9');\n $empresa4->setFechaRegistro(new \\DateTime('2004-08-22'));\n $manager->persist($empresa4);\n\n $empresa5=new Empresas();\n $empresa5->setNombre(\"Philips\");\n $empresa5->setDireccion('C/No se 7');\n $empresa5->setFechaRegistro(new \\DateTime('1995-06-02'));\n $manager->persist($empresa5);\n\n\n $empleado1=new Empleados();\n $empleado1->setNombre('Manuel');\n $empleado1->setApellidos('Jimenez Rodriguez');\n $empleado1->setEstadoCivil('soltero');\n $empleado1->setActivo(true);\n $empleado1->setImagen(null);\n $empleado1->setEmpresa($empresa1);\n $empleado1->setNumeroHijos(0);\n $empleado1->setFechaNacimiento(new \\DateTime('2020-01-01'));\n $manager->persist($empleado1);\n\n $empleado2=new Empleados();\n $empleado2->setNombre('Gonzalo');\n $empleado2->setApellidos('Sanchez Lopez');\n $empleado2->setEstadoCivil('divorciado');\n $empleado2->setActivo(true);\n $empleado2->setImagen(null);\n $empleado2->setEmpresa($empresa1);\n $empleado2->setNumeroHijos(1);\n $empleado2->setFechaNacimiento(new \\DateTime('1940-05-10'));\n $manager->persist($empleado2);\n\n $empleado3=new Empleados();\n $empleado3->setNombre('Maria');\n $empleado3->setApellidos('Fernandez Alamo');\n $empleado3->setEstadoCivil('casado');\n $empleado3->setActivo(true);\n $empleado3->setImagen(null);\n $empleado3->setEmpresa($empresa1);\n $empleado3->setNumeroHijos(3);\n $empleado3->setFechaNacimiento(new \\DateTime('1990-01-01'));\n $manager->persist($empleado3);\n\n $empleado4=new Empleados();\n $empleado4->setNombre('Ana');\n $empleado4->setApellidos('Cabezas Rodriguez');\n $empleado4->setEstadoCivil('viudo');\n $empleado4->setActivo(true);\n $empleado4->setImagen(null);\n $empleado4->setEmpresa($empresa2);\n $empleado4->setNumeroHijos(0);\n $empleado4->setFechaNacimiento(new \\DateTime('1993-04-10'));\n $manager->persist($empleado4);\n\n $empleado5=new Empleados();\n $empleado5->setNombre('Raul');\n $empleado5->setApellidos('Prieto Martinez');\n $empleado5->setEstadoCivil('soltero');\n $empleado5->setActivo(true);\n $empleado5->setImagen(null);\n $empleado5->setEmpresa($empresa3);\n $empleado5->setNumeroHijos(0);\n $empleado5->setFechaNacimiento(new \\DateTime('2001-05-12'));\n $manager->persist($empleado5);\n\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n $entry1 = new Entry();\n $entry1->setAvgSpeed(10.0);\n $dateInput = \"2014-01-01\";\n $date = $date = new DateTime();\n $date->setTimestamp(strtotime($dateInput));\n $entry1->setDate($date);\n $entry1->setDistance(12);\n $entry1->setTime(1.2);\n $entry1->setUserId(2);\n $manager->persist($entry1);\n\n $entry2 = new Entry();\n $entry2->setAvgSpeed(2.0);\n $dateInput = \"2013-01-01\";\n $date = $date = new DateTime();\n $date->setTimestamp(strtotime($dateInput));\n $entry2->setDate($date);\n $entry2->setDistance(10);\n $entry2->setTime(5);\n $entry2->setUserId(2);\n $manager->persist($entry2);\n\n\n print(\"Creating some entries\");\n $manager->flush();\n\n }", "public function load(ObjectManager $manager): void\n {\n for ($i = 1; $i < 16; $i++) {\n $task = new Task();\n $task\n ->setTitle('task'.$i)\n ->setContent(\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius at ligula nec sollicitudin.'\n )\n ->setCreatedAt(new DateTime())\n ;\n if ($i < 6) {\n $task->setAuthor(null);\n } elseif ($i > 5 && $i < 11) {\n $task->setAuthor(\n $this->getReference(UserFixtures::AUTHOR_REFERENCE_PREFIX.'1')\n );\n } elseif ($i > 10) {\n $task->setAuthor(\n $this->getReference(UserFixtures::AUTHOR_REFERENCE_PREFIX.'2')\n );\n }\n\n $manager->persist($task);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n /* for($i = 1; $i <= 10; $i++){\n $eleve = new Eleve();\n\n $eleve->setNom(\"Nom n° {$i} \")\n ->setPrenom(\"Prenom n° {$i} \")\n ->setDateNaissanceAt(new \\DateTime())\n ->setMoyenne($i)\n ->setAppreciation(\"Appreciation n° {$i} \")\n ;\n \n $manager->persist($eleve);\n } */\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n\n $images = [\n 'ballon.jpg',\n 'hamac.jpg',\n 'ventilo.jpg',\n 'parasol.jpg',\n 'ete.jpg',\n 'mer-ete.jpg',\n 'ete-plage.jpg'\n\n ];\n\n //Recuperation du Faker\n $generator = Factory::create('fr_FR');\n // Populateur d'Entités (se base sur /src/Entity)\n $populator = new Populator($generator, $manager);\n\n //Creation des categories\n $populator->addEntity(Category::class, 10);\n $populator->addEntity(Tag::class, 20);\n $populator->addEntity(User::class, 20);\n $populator->addEntity(Product::class, 30, [\n 'price' => function () use ($generator) {\n return $generator->randomFloat(2, 0, 9999999, 99);\n },\n 'imageName' => function() use ($images) {\n return $images[rand(0, sizeof($images)-1)];\n }\n\n\n ]);\n\n // Flush\n $populator->execute();\n }", "public function load(ObjectManager $manager)\n {\n $faker = \\Faker\\Factory::create();\n $projets = $manager->getRepository(Projet::class)->findAll();\n $devis = $manager->getRepository(Devis::class)->findAll();\n\n $facture = new Facture();\n $facture->setIdProjet( $projets[array_rand($projets)]);\n $facture->setAutresCharges($faker->randomFloat());\n $facture->setDevis($devis[array_rand($devis)]);\n $facture->setNbrHeures($faker->randomDigitNotNull);\n $facture->setNomFacture($faker->randomLetter);\n $facture->setPrixHT($faker->randomFloat());\n $facture->setPrixTTC($faker->randomFloat());\n $facture->setTauxH($faker->randomDigitNotNull);\n $manager->persist($facture);\n\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n $p1 = new Post();\n $p1->setTitle('Donec mollis turpis orci');\n $p1->setBody('Ut molestie lectus porttitor vel. Aenean sagittis sed mi vitae suscipit. Maecenas eu odio risus. Cras ut libero in diam faucibus condimentum in sit amet sem. Nullam ac varius libero, ac suscipit nisl. Vivamus ullamcorper tortor in lacus lacinia, a porttitor quam iaculis. Vestibulum nec tincidunt sapien, nec maximus diam. Aliquam lobortis sit amet lacus sed maximus. Fusce posuere eget enim nec mollis. Nam vel leo posuere, consectetur sapien sit amet, pulvinar justo.');\n $p1->setAuthor($this->getAuthor($manager, 'David'));\n\n $p2 = new Post();\n $p2->setTitle('Sed pharetra blandit velit id laoreet');\n $p2->setBody('Nulla sodales justo eleifend ipsum efficitur vehicula. In vel pretium libero. Vestibulum dignissim tortor eu efficitur faucibus. Nullam dictum dictum orci, ut consequat mauris volutpat quis. Nam blandit porta orci, aliquet mollis elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean maximus nibh vel purus mollis, eget egestas ipsum viverra. Ut eu maximus enim, vitae luctus magna. In vitae facilisis magna. Nulla ut condimentum metus, ut condimentum odio. Etiam euismod massa id nibh scelerisque, sit amet condimentum enim malesuada.');\n $p2->setAuthor($this->getAuthor($manager, 'Eddie'));\n\n $p3 = new Post();\n $p3->setTitle('Nullam dignissim ipsum sed faucibus finibus');\n $p3->setBody('Maecenas in dui ex. Integer luctus dui metus, eu elementum elit aliquet non. Vestibulum mollis ullamcorper risus. Donec pharetra, mauris at malesuada faucibus, orci odio vehicula risus, id euismod tortor mauris sed libero. Nam libero risus, pharetra quis tortor ut, dapibus luctus dolor. Etiam consequat fermentum lectus. Phasellus id tempus purus, sed ullamcorper dolor. In id justo nibh.');\n $p3->setAuthor($this->getAuthor($manager, 'Eddie'));\n\n $manager->persist($p1);\n $manager->persist($p2);\n $manager->persist($p3);\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n $p1 = new Personne();\n $p1->setNom(\"Milo\");\n $manager->persist($p1);\n\n $p2 = new Personne();\n $p2->setNom(\"Tya\");\n $manager->persist($p2);\n\n $p3 = new Personne();\n $p3->setNom(\"Lili\");\n $manager->persist($p3);\n\n $continent1=new Continent();\n $continent1->setLibelle(\"Europe\");\n $manager->persist($continent1);\n\n $continent2=new Continent();\n $continent2->setLibelle(\"Asie\");\n $manager->persist($continent2);\n\n $continent3=new Continent();\n $continent3->setLibelle(\"Afrique\");\n $manager->persist($continent3);\n\n $continent4=new Continent();\n $continent4->setLibelle(\"Océanie\");\n $manager->persist($continent4);\n\n $continent5=new Continent();\n $continent5->setLibelle(\"Amérique\");\n $manager->persist($continent5);\n\n $c1 = new Famille();\n $c1 ->setDescription(\"Animaux vertébrés nourissant leurs petis avec du lait\")\n ->setLibelle(\"Mammifères\")\n ;\n $manager->persist($c1);\n\n $c2 = new Famille();\n $c2 ->setDescription(\"Animaux vertébrés qui rampent\")\n ->setLibelle(\"Reptiles\")\n ;\n $manager->persist($c2);\n\n $c3 = new Famille();\n $c3 ->setDescription(\"Animaux invertébrés du monde aquatique\")\n ->setLibelle(\"Poissons\")\n ;\n $manager->persist($c3);\n\n\n $a1= new Animal();\n $a1->setNom(\"Chien\")\n ->setDescription(\"Un animal domestique\")\n ->setImage(\"chien.png\")\n ->setPoids(10)\n ->setDangereux(false)\n ->setFamille($c1)\n ->addContinent($continent1)\n ->addContinent($continent2)\n ->addContinent($continent3)\n ->addContinent($continent4)\n ->addContinent($continent5)\n\n ;\n $manager->persist($a1);\n\n $a2= new Animal();\n $a2->setNom(\"Cochon\")\n ->setDescription(\"Un animal d'élevage\")\n ->setImage(\"cochon.png\")\n ->setPoids(300)\n ->setDangereux(false)\n ->setFamille($c1)\n ->addContinent($continent1)\n ->addContinent($continent5)\n\n\n ;\n $manager->persist($a2);\n\n $a3= new Animal();\n $a3->setNom(\"Serpent\")\n ->setDescription(\"Un animal dangereux\")\n ->setImage(\"serpent.png\")\n ->setPoids(5)\n ->setDangereux(true)\n ->setFamille($c2)\n ->addContinent($continent2)\n ->addContinent($continent3)\n ->addContinent($continent4)\n\n ;\n $manager->persist($a3);\n\n $a4= new Animal();\n $a4->setNom(\"Crocodile\")\n ->setDescription(\"Un animal très dangereux\")\n ->setImage(\"croco.png\")\n ->setPoids(500)\n ->setDangereux(true)\n ->setFamille($c2)\n ->addContinent($continent3)\n ->addContinent($continent4)\n ;\n $manager->persist($a4);\n\n $a5= new Animal();\n $a5->setNom(\"Requin\")\n ->setDescription(\"Un animal marin très dangereux\")\n ->setImage(\"requin.png\")\n ->setPoids(800)\n ->setDangereux(true)\n ->setFamille($c3)\n ->addContinent($continent4)\n ->addContinent($continent5)\n ;\n $manager->persist($a5);\n\n $d1 = new Dispose();\n $d1 ->setPersonne($p1)\n ->setAnimal($a1)\n ->setNb(30);\n $manager->persist($d1);\n\n $d2 = new Dispose();\n $d2 ->setPersonne($p1)\n ->setAnimal($a2)\n ->setNb(10);\n $manager->persist($d2);\n\n $d3 = new Dispose();\n $d3 ->setPersonne($p1)\n ->setAnimal($a3)\n ->setNb(2);\n $manager->persist($d3);\n \n $d4 = new Dispose();\n $d4 ->setPersonne($p2)\n ->setAnimal($a3)\n ->setNb(5);\n $manager->persist($d4);\n\n $d5 = new Dispose();\n $d5 ->setPersonne($p2)\n ->setAnimal($a4)\n ->setNb(2);\n $manager->persist($d5);\n\n $d6 = new Dispose();\n $d6 ->setPersonne($p3)\n ->setAnimal($a5)\n ->setNb(20);\n $manager->persist($d6);\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n $faker = Factory::create('fr_FR');\n\n for ($i = 0; $i < 30; $i++){\n $adherent = new Adherent();\n for ($i = 0; $i < 2; $i++){\n $sexe = new Sexe();\n $sexe->setNom($faker->lastName);\n $manager->persist($sexe);\n }\n for ($j = 0; $j < 2; $j++){\n $filiere = new Filiere();\n $filiere->setNom($faker->lastName);\n $manager->persist($filiere);\n }\n for ($i = 0; $i < 5; $i++){\n $poste = new Poste();\n $poste->setNom($faker->lastName);\n $manager->persist($poste);\n }\n $adherent\n ->setNom($faker->name)\n ->setPrenom($faker->lastName)\n ->setSexe($sexe)\n ->setPoste($poste)\n ->setFiliere($filiere)\n ->setMatricule('20G0062'.$i)\n ->setMdp('password');\n $manager->persist($adherent);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n $translator = $this->container->get(\"translator\");\n\n /* These are the standard data of the system */\n $standardInserts = [\n [\n 'layoutId' => 0,\n 'title' => $translator->trans('Listing'),\n 'updated' => new \\DateTime(),\n 'entered' => new \\DateTime(),\n 'status' => 'enabled',\n 'price' => 0.00,\n 'catId' => '',\n 'editable' => 'n',\n ],\n ];\n\n $repository = $manager->getRepository('ListingBundle:ListingTemplate');\n\n foreach ($standardInserts as $listingTemplateInsert) {\n $query = $repository->findOneBy([\n 'title' => $listingTemplateInsert['title'],\n ]);\n\n $listingTemplate = new ListingTemplate();\n\n /* checks if the ListingTemplate already exist so they can be updated or added */\n if ($query) {\n $listingTemplate = $query;\n }\n\n $listingTemplate->setLayoutId($listingTemplateInsert['layoutId']);\n $listingTemplate->setTitle($listingTemplateInsert['title']);\n $listingTemplate->setUpdated($listingTemplateInsert['updated']);\n $listingTemplate->setEntered($listingTemplateInsert['entered']);\n $listingTemplate->setStatus($listingTemplateInsert['status']);\n $listingTemplate->setPrice($listingTemplateInsert['price']);\n $listingTemplate->setCatId($listingTemplateInsert['catId']);\n $listingTemplate->setEditable($listingTemplateInsert['editable']);\n\n $manager->persist($listingTemplate);\n }\n\n $manager->flush();\n }", "function load(ObjectManager $manager)\n {\n\n $data = $this->getData();\n\n foreach ($data as $userData) {\n $user = new User();\n\n $user->setUsername($userData['username']);\n $user->setEmail($userData['email']);\n $user->setPlainPassword($userData['plainPassword']);\n $user->setEnabled($userData['enabled']);\n $user->setSuperAdmin($userData['superAdmin']);\n $manager->persist($user);\n $manager->flush();\n $this->setReference($userData['reference'], $user);\n }\n\n// $manager->flush();\n//\n// $admin = new User();\n// $admin->setUsername('admin');\n// $admin->setEmail('[email protected]');\n// $admin->setPlainPassword('admin');\n// $admin->setEnabled(true);\n// $admin->setSuperAdmin(true);\n// $manager->persist($admin);\n//\n// $user1 = new User();\n// $user1->setUsername('user1');\n// $user1->setEmail('[email protected]');\n// $user1->setPlainPassword('user1');\n// $user1->setEnabled(true);\n// $user1->setSuperAdmin(false);\n// $manager->persist($user1);\n//\n// $manager->flush();\n//\n// $this->setReference('user_admin', $admin);\n// $this->setReference('user_user1', $user1);\n }", "protected function getFixtures()\n {\n return array(\n // __DIR__ . '/../../Resources/fixtures/majora_entitys.yml',\n );\n }", "public function load(ObjectManager $manager)\n {\n $ushuaia = new Localidad();\n $ushuaia->setNombre('Ushuaia');\n $ushuaia->setCodigoPostal('9410');\n $rioGrande = new Localidad();\n $rioGrande->setNombre('Río Grande');\n $rioGrande->setCodigoPostal('9420');\n\n $manager->persist($ushuaia);\n $manager->persist($rioGrande);\n $manager->flush();\n\n // Los objetos $ushuaia y $riogrande pueden ser referenciados por otros\n // fixtures que tengan un orden más alto, vía 'ushuaia' y 'riogrande'.\n $this->addReference('ushuaia', $ushuaia);\n $this->addReference('riogrande', $rioGrande);\n\n }", "protected function setUp()\n {\n self::bootKernel();\n\n $this->em = static::$kernel->getContainer()\n ->get('doctrine')\n ->getManager();\n $schemaTool = new SchemaTool($this->em);\n $metadata = $this->em->getMetadataFactory()->getAllMetadata();\n\n // Drop and recreate tables for all entities\n $schemaTool->dropSchema($metadata);\n $schemaTool->createSchema($metadata);\n $users = new LoadUserData();\n $users->setContainer(static::$kernel->getContainer());\n $users->load($this->em);\n }", "public function load(ObjectManager $manager)\n {\n $seed = [];\n for ($i = 0; $i < 20; $i += 2) {\n $seed[$i] = $this->faker->dateTimeBetween('-1 month', 'yesterday');\n $seed[$i+1] = $this->faker->dateTimeInInterval($seed[$i], '+10 hours');\n }\n\n sort($seed);\n\n for ($i = 0; $i < 20; $i += 2) {\n $interval = new TimeInterval();\n /** @var Task $task */\n $task = $this->getReference('Task-' . random_int(1, 5));\n if ($task->getCreatedAt() > $seed[$i]) {\n $task->setCreatedAt($this->faker->dateTimeInInterval($seed[$i], '-2 days'));\n }\n\n $interval->setStartsAt($seed[$i])\n ->setEndsAt($seed[$i+1])\n ->setTask($task)\n ;\n\n $manager->persist($interval);\n }\n $manager->flush();\n }", "public function load(ObjectManager $em)\n {\n\n /* Create lucie.ginette with teacher role and student role */\n $testUser1 = new User();\n $testUser1->setLogin(\"lucie.ginette\");\n $testUser1->setFirstName(\"Lucie\");\n $testUser1->setLastName(\"GINETTE\");\n $testUser1->setMail(\"[email protected]\");\n $testUser1->setAuthType('internal');\n $testUser1->setSalt(md5(time()));\n $encoder = $this->container->get('security.encoder_factory')->getEncoder($testUser1);\n $testUser1->setPassword($encoder->encodePassword('1234', $testUser1->getSalt()));\n $testUser1->setStudentRole(new StudentRole());\n $testUser1->setTeacherRole(new TeacherRole());\n\n /* Create marc.thomas with admin role */\n $testUser2 = new User();\n $testUser2->setLogin(\"marc.thomas\");\n $testUser2->setFirstName(\"Marc\");\n $testUser2->setLastName(\"THOMAS\");\n $testUser2->setMail(\"[email protected]\");\n $testUser2->setAuthType('internal');\n $testUser2->setSalt(md5(time()));\n $encoder = $this->container->get('security.encoder_factory')->getEncoder($testUser2);\n $testUser2->setPassword($encoder->encodePassword('5678', $testUser2->getSalt()));\n $testUser2->setAdminRole(new AdminRole());\n\n /* Creation of 10 generic sample students */\n for ($i = 0; $i < 10; $i++) {\n $testUser = new User();\n $testUser->setLogin('student.' . $i);\n $testUser->setFirstName('StudentFirstName ' . $i);\n $testUser->setLastName('StudentLastName ' . $i);\n $testUser->setMail('student.' . $i . '@lms.local');\n $testUser->setAuthType('internal');\n $testUser->setSalt(md5(time()));\n $encoder = $this->container->get('security.encoder_factory')->getEncoder($testUser);\n $testUser->setPassword($encoder->encodePassword('student' . $i, $testUser->getSalt()));\n $testUser->setStudentRole(new StudentRole());\n $em->persist($testUser);\n }\n\n $em->persist($testUser1);\n $em->persist($testUser2);\n $em->flush();\n }", "public function load(ObjectManager $manager)\n {\n for ($i = 0; $i < 5; $i++) {\n $equipo = new Equipos();\n $equipo->setNombre('Equipo '.$i);\n $manager->persist($equipo);\n for ($x = 0; $x < 23; $x++) {\n $jugador = new Jugadores();\n $jugador->setNombre(\"Nombre \".$x);\n $jugador->setApellido(\"Apellido \".$x);\n $jugador->setEquipos($equipo);\n $manager->persist($jugador);\n }\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n for ($i = 1; $i < 6; $i++) {\n $task = new Task();\n $task->setName($this->faker->jobTitle)\n ->setDescription($this->faker->text());\n\n $this->addReference('Task-' . $i, $task);\n $manager->persist($task);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n // configurer la langue\n //$faker = Factory::create('fr_FR');\n //for ($p=0; $p < 3; $p++) { \n //$users = new User();\n //$harsh = $this->encoder->encodePassword($users, 'password');\n // users\n //$users->setPrenom($faker->firstname);\n //$users->setNom($faker->lastname);\n //$users->setPassword($harsh);\n //$users->setEmail($faker->email);\n //$users->setProfil($this->getReference(ProfilFixtures::PROFIL));\n //$users->setProfil($this->getReference($p));\n\n // persist\n //$manager->persist($users);\n //}\n\n //$manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // TODO: Implement load() method.\n $participant1 = new Participant();\n $participant1->setNom('BAUDRY');\n $participant1->setPrenom('Quentin');\n $participant1->setPseudo('qbaudry');\n $participant1->setTelephone('0123456789');\n $participant1->setMail('[email protected]');\n $participant1->setRoles(['ROLE_USER']);\n $participant1->setActif(false);\n $password = $this->encoder->encodePassword($participant1, '123');\n $participant1->setPassword($password);\n $site = $this->getReference(SiteFixture::SITE_REFERENCE1);\n $participant1->setSite($site);\n\n $participant2 = new Participant();\n $participant2->setNom('TENAUD');\n $participant2->setPrenom('Willy');\n $participant2->setPseudo('wtenaud');\n $participant2->setTelephone('0123456789');\n $participant2->setMail('[email protected]');\n $participant2->setRoles(['ROLE_USER']);\n $participant2->setActif(true);\n $password = $this->encoder->encodePassword($participant2, '123');\n $participant2->setPassword($password);\n $site = $this->getReference(SiteFixture::SITE_REFERENCE4);\n $participant2->setSite($site);\n\n $participant3 = new Participant();\n $participant3->setNom('LELODET');\n $participant3->setPrenom('Bastien');\n $participant3->setPseudo('blelodet');\n $participant3->setTelephone('0123456789');\n $participant3->setMail('[email protected]');\n $participant3->setRoles(['ROLE_USER']);\n $participant3->setActif(true);\n $password = $this->encoder->encodePassword($participant3, '123');\n $participant3->setPassword($password);\n $site = $this->getReference(SiteFixture::SITE_REFERENCE3);\n $participant3->setSite($site);\n\n $participant4 = new Participant();\n $participant4->setNom('SUPER');\n $participant4->setPrenom('Admin');\n $participant4->setPseudo('admin');\n $participant4->setTelephone('0123456789');\n $participant4->setMail('[email protected]');\n $participant4->setRoles(['ROLE_ADMIN']);\n $participant4->setActif(true);\n $password = $this->encoder->encodePassword($participant4, '123');\n $participant4->setPassword($password);\n $site = $this->getReference(SiteFixture::SITE_REFERENCE1);\n $participant4->setSite($site);\n\n $manager->persist($participant1);\n $manager->persist($participant2);\n $manager->persist($participant3);\n $manager->persist($participant4);\n\n $photo1 = new Profil();\n $photo1->setParticipant($participant1);\n $photo2 = new Profil();\n $photo2->setParticipant($participant2);\n $photo3 = new Profil();\n $photo3->setParticipant($participant3);\n $photo4 = new Profil();\n $photo4->setParticipant($participant4);\n\n $manager->persist($photo1);\n $manager->persist($photo2);\n $manager->persist($photo3);\n $manager->persist($photo4);\n\n $manager->flush();\n\n $this->addReference(self::PARTICIPANT_REFERENCE1, $participant1);\n $this->addReference(self::PARTICIPANT_REFERENCE2, $participant2);\n $this->addReference(self::PARTICIPANT_REFERENCE3, $participant3);\n $this->addReference(self::PARTICIPANT_REFERENCE4, $participant4);\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n $faker = Factory::create();\n $faker->seed(2);\n\n for ($i = 0; $i < 20; $i++) {\n $user = $this->getReference('users_user' . $faker->numberBetween(1, 24));\n $article = $this->getReference('articles_article' . $faker->numberBetween(0, 19));\n \n $share = new Shares();\n $share\n ->setArticles($article)\n ->setUser($user)\n ->setSharedAt($faker->dateTimeInInterval('-10 months', '+6 months'));\n $manager->persist($share);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n for($i=1; $i<= 50; $i++){\n //génération aléatoire de date\n $timestamp = mt_rand(1, time());\n $randomDate = date('Y-m-d H:i:s', $timestamp);\n //tableau d'auteurs\n $auteurs = ['Verlaine', 'Hugo', 'Voltaire', 'Philip K Dick', 'Zola', 'Dumas', 'Molière'];\n //génération de lorem\n $content = simplexml_load_file('http://www.lipsum.com/feed/xml?amount=1&what=paras&start=0')->lipsum;\n\n $user = new User();\n if($i===1){\n $roles = ['ROLE_ADMIN', 'ROLE_USER'];\n }else{\n $roles = ['ROLE_USER'];\n }\n $user->setUsername('user' .$i);\n $user->setEmail('user'.$i.'@gmail.com');\n $user->setRoles($roles);\n $plainPwd = 'mdp';\n $mdpEncoded = $this->encoder->encodePassword($user, $plainPwd);\n $user->setPassword($mdpEncoded);\n\n\n\n\n $categorie = new Categorie();\n $categorie->setLibelle('catégorie' . $i);\n $categorie->setDescription('description' . $i);\n $categorie->setDateCreation(new \\DateTime($randomDate));\n\n $message = new Message();\n $message->setSujet('sujet' .$i);\n $message->setContenu($content);\n $message->setEmail('email' .$i);\n $message->setNom($auteurs[array_rand($auteurs)]);\n $message->setDateenvoi(new \\DateTime($randomDate));\n\n $article = new Article();\n $article->setTitle('title' .$i);\n $article->setContent($content);\n $article->setAuthor($auteurs[array_rand($auteurs)]);\n $article->setDatePubli(new \\DateTime($randomDate));\n\n\n\n $manager->persist($categorie);\n $manager->persist($message);\n $manager->persist($article);\n $manager->persist($user);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\r\n {\r\n $data = [\r\n [\r\n 'fields' =>\r\n [\r\n 'familyStatus' => 'Single',\r\n ],\r\n 'reference' => 'family_status_1'\r\n ],\r\n [\r\n 'fields' =>\r\n [\r\n 'familyStatus' => 'Married',\r\n ],\r\n 'reference' => 'family_status_2'\r\n ],\r\n [\r\n 'fields' =>\r\n [\r\n 'familyStatus' => 'Divorced',\r\n ],\r\n 'reference' => 'family_status_3'\r\n ],\r\n [\r\n 'fields' =>\r\n [\r\n 'familyStatus' => 'Widowed',\r\n ],\r\n 'reference' => 'family_status_4'\r\n ],\r\n [\r\n 'fields' =>\r\n [\r\n 'familyStatus' => 'In active search',\r\n ],\r\n 'reference' => 'family_status_5'\r\n ],\r\n [\r\n 'fields' =>\r\n [\r\n 'familyStatus' => 'It\\'s Complicated',\r\n ],\r\n 'reference' => 'family_status_6'\r\n ],\r\n ];\r\n\r\n foreach ($data as $itemData) {\r\n $entity = $this->fillEntityFromArray($itemData['fields'], \\ApiBundle\\Entity\\FamilyStatuses::class);\r\n $manager->persist($entity);\r\n if(array_key_exists('reference', $itemData)){\r\n $this->addReference($itemData['reference'], $entity);\r\n }\r\n }\r\n $manager->flush();\r\n\r\n }", "public function load(ObjectManager $manager)\r\n {\r\n $suffix = 'A';\r\n for($i=0;$i<10;$i++)\r\n {\r\n $project = (new Project())\r\n ->setName('Project'.$suffix);\r\n $suffix++;\r\n\r\n $manager->persist($project);\r\n }\r\n\r\n $manager->flush();\r\n }", "public function load(ObjectManager $manager)\n {\n $actividades = $manager->createQuery('Select a FROM EquipoBundle:Actividad a')\n ->setMaxResults(20)\n ->getResult();\n\n foreach ($actividades as $actividad) {\n\n for ($j=1; $j<=5; $j++) {\n $anuncio = new Anuncio();\n\n $nombre = $this->getNombre();\n $anuncio->setNombre($nombre);\n $anuncio->setDescripcion($this->getDescripcion());\n $anuncio->setSlug(Util::slugify($nombre));\n $anuncio->setFecha(new \\DateTime('now - '.rand(1, 150).' days'));\n $anuncio->setActividad($actividad);\n\n $manager->persist($anuncio);\n\n }\n }\n $manager->flush();\n }", "public function setupFixtures()\n {\n if ($this->_fixtures === null) {\n $loadedFixtures = [];\n foreach ($this->fixtures() as $fixtureClass) {\n $loadedFixtures[$fixtureClass] = Yii::createObject($fixtureClass);\n }\n\n $this->_fixtures = $loadedFixtures;\n }\n }", "public function load(ObjectManager $om)\n {\n // auto save to db example\n // $members = Fixtures::load(__DIR__.'/members.yml', $om);\n\n $loader = new Loader();\n $members = $loader->load(__DIR__.'/members.yml');\n\n\n $manager = $this->container->get('member.manager');\n\n\n foreach ($members as $member) {\n $manager->updateMember($member, false);\n }\n\n $persister = new Doctrine($om);\n $persister->persist($members);\n }", "public function load(ObjectManager $manager)\n {\n $centers = Yaml::parseFile(__DIR__.'/centersData.yaml');\n\n // loop on 3 centers and set data\n for ($i = 0; $i < 3; $i++) {\n // Center\n $center = New Center();\n $center->setName($centers['name'][$i]);\n $center->setCode(124 + $i);\n $center->setPicture((124 + $i).'.jpg');\n $center->setDescription($centers['description'][$i]);\n\n $address = new Address();\n $address->setAddress($centers['address'][$i]);\n $address->setCity($centers['city'][$i]);\n $address->setZipCode($centers['zipCode'][$i]);\n\n $center->setAddress($address);\n\n $this->addReference(\"center\".$i, $center);\n\n $manager->persist($center);\n }\n\n $manager->flush();\n }", "function load(ObjectManager $manager)\n {\n $data = $this->getData();\n $i = 0;\n\n foreach ($data as $categoryName) {\n $category = new Category();\n $category->setTitle($categoryName);\n $manager->persist($category);\n $this->addReference('category_' . (++$i), $category);\n\n $subData = $this->getData($i);\n $j = 0;\n foreach ($subData as $subcategoryName) {\n $subCategory = new Category();\n $subCategory->setTitle($subcategoryName);\n $subCategory->setParent($category);\n $manager->persist($subCategory);\n $this->addReference('category_' . $i . '_' . (++$j), $subCategory);\n }\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n \t$admin = (new User('admin'))\n \t\t\t\t->setPlainPassword('123')\n \t\t\t\t->addRole(User::ROLE_ADMIN);\n// $tokenAdmin = $JWTTokenManager->create($admin);\n\n \t$customer = (new User('customer'))\n \t\t\t\t->setPlainPassword('123')\n \t\t\t\t->addRole(User::ROLE_CUSTOMER);\n// $tokenCustomer = $JWTTokenManager->create($customer);\n\n \t$manager->persist($admin);\n \t$manager->persist($customer);\n\n $coffeesData = [\n ['name' => 'ristretto', 'intensity' => 10, 'price' => 3, 'stock' => 20],\n ['name' => 'cubita', 'intensity' => 6, 'price' => 2, 'stock' => 50],\n ['name' => 'bustelo', 'intensity' => 9, 'price' => 6, 'stock' => 5],\n ['name' => 'serrano', 'intensity' => 10, 'price' => 3, 'stock' => 10]\n ];\n\n foreach ($coffeesData as $key => $value) {\n $coffee = (new Coffee())\n ->setName($value['name'])\n ->setIntensity($value['intensity'])\n ->setTextPrice($value['price'])\n ->setStock($value['stock']);\n $manager->persist($coffee);\n }\n\n $manager->flush();\n }", "public function load(ObjectManager $dbmanager)\n {\n $employee1 = Employee::createUser(\"johndoe\", \"password123\", \"John Doe\", \"[email protected]\", \"123-456-7890\");\n $employee2 = Employee::createUser(\"janedoe\", \"password123\", \"Jane Doe\", \"[email protected]\", null);\n $employee3 = Employee::createUser(\"billybob\", \"password123\", \"Billy Bob\", \"[email protected]\", \"198-765-4321\");\n $employee4 = Employee::createUser(\"kevinbacon\", \"password123\", \"Kevin Bacon\", \"[email protected]\", \"534-765-6524\");\n $employee5 = Employee::createUser(\"jamesbond\", \"password123\", \"James Bond\", \"[email protected]\", \"432-007-2353\");\n\n $dbmanager->persist($employee1);\n $dbmanager->persist($employee2);\n $dbmanager->persist($employee3);\n $dbmanager->persist($employee4);\n $dbmanager->persist($employee5);\n\n # Create a bunch of managers\n $manager1 = Manager::createUser(\"randyrhoads\", \"password123\", \"Randy Roads\", \"[email protected]\", \"333-231-4432\");\n $manager2 = Manager::createUser(\"dansmith\", \"password123\", \"Dan Smith\", null, \"883-233-4441\");\n\n $dbmanager->persist($manager1);\n $dbmanager->persist($manager2);\n\n # Create a bunch of shifts\n $begin = new \\DateTime('2017-10-01 08:00:00');\n $end = new \\DateTime('2017-11-01 08:00:00');\n\n # A shift for every day inbetween the above dates\n $interval = new \\DateInterval('P1D');\n $daterange = new \\DatePeriod($begin, $interval ,$end);\n\n $managers = [$manager1, $manager2];\n $employees = [$employee1, $employee2, $employee3, $employee4, $employee5, null];\n\n # Create three shifts for each day with random employees and random managers.\n # The null value in the employee list is to allow for empty shifts\n foreach($daterange as $date){\n $shiftEmployeesKeys = array_rand($employees, 3);\n $shiftManagerKey = array_rand($managers);\n\n foreach ($shiftEmployeesKeys as $employeeKey) {\n $startDateTime = clone $date;\n $endDateTime = clone $date;\n $endDateTime->modify('+8 hours');\n\n $shift = new Shift();\n $shift->setStartTime($startDateTime);\n $shift->setEndTime($endDateTime);\n $shift->setBreak(0.5);\n $shift->setEmployee($employees[$employeeKey]);\n $shift->setManager($managers[$shiftManagerKey]);\n $dbmanager->persist($shift);\n }\n }\n\n $dbmanager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // projects\n $preorder = new Project();\n $preorder->setName('preorder.it');\n $preorder->setSlug('preorder-it');\n $preorder->setUrl('http://preorder.it');\n $preorder->setDate(new \\DateTime('now'));\n $preorder->setDescription('Press-releases and reviews of the latest electronic novelties. The possibility to leave a pre-order.');\n $preorder->setUsers('<dl><dt>art-director and designer</dt><dd>Oleg Ulasyuk</dd></dl>');\n $preorder->setOnFrontPage(0);\n $preorder->setOrdernum(0);\n $preorder->addCategory($manager->merge($this->getReference('category-development')));\n $manager->persist($preorder);\n\n $eprice = new Project();\n $eprice->setName('eprice.kz');\n $eprice->setSlug('eprice-kz');\n $eprice->setUrl('http://eprice.kz');\n $eprice->setDate(new \\DateTime('now'));\n $eprice->setDescription('Comparison of the prices of mobile phones, computers, monitors, audio and video in Kazakhstan');\n $eprice->setOnFrontPage(1);\n $eprice->setOrdernum(1);\n $eprice->addCategory($manager->merge($this->getReference('category-development')));\n $manager->persist($eprice);\n\n $manager->flush();\n\n $this->addReference('project-preorder', $preorder);\n $this->addReference('project-eprice', $eprice);\n\n for ($i = 0; $i < 16; $i++) {\n $example = new Project();\n $example->setName('example.com_' . $i);\n $example->setSlug('example-com_' . $i);\n $example->setUrl('http://example.com');\n $example->setDate(new \\DateTime('now'));\n $example->setDescription('As described in RFC 2606, we maintain a number of domains such as EXAMPLE.COM and EXAMPLE.ORG for documentation purposes. These domains may be used as illustrative examples in documents without prior coordination with us. They are not available for registration.');\n $example->setOnFrontPage(0);\n $example->setOrdernum(2 + $i);\n $example->addCategory($manager->merge($this->getReference('category-development')));\n $manager->persist($example);\n }\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n $categories = $this->categoryRepository->findAll();\n $type = $this->typeRepository->findAll();\n\n for($i = 1; $i < 40; $i++){\n $product = new Product();\n $name = 'product' . $i;\n\n $product->setPrice(rand(3, 50));\n $product->setName($name);\n $product->setCategory($categories[array_rand($categories)]);\n $product->setSlug($this->slugify->slugify($name));\n $product->setDescription('whatever' . $i);\n $product->setProductType($type[array_rand($type)]);\n\n $manager->persist($product);\n }\n $manager->flush();\n }", "public function loadFixtures($path) : void\n {\n /** @var EntityManager $em */\n $em = $this->getApplicationServiceLocator()->get(EntityManager::class);\n $em->getConnection()->exec('SET foreign_key_checks = 0');\n $loader = new Loader();\n $loader->loadFromDirectory($path);\n $purger = new ORMPurger($em);\n $purger->setPurgeMode(ORMPurger::PURGE_MODE_TRUNCATE);\n $executor = new ORMExecutor($em, $purger);\n $executor->execute($loader->getFixtures());\n $em->getConnection()->exec('SET foreign_key_checks = 1');\n }", "public static function loadFixture()\n {\n //include __DIR__ .'/../_files/customer.php';\n include __DIR__ .'/../_files/order_fee_variation.php';\n\n }", "public function setUp()\n {\n $this->fixtures('articles');\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n // Créer 2 Catégories\n $category1 = (new Category())->setLabel(\"fruit\");\n $category2 = (new Category())->setLabel(\"exotic\");\n //setProduct\n $manager->persist($category1, $category2);\n\n // Créer 1 Images\n $picture = new Picture();\n $picture\n ->setUrl(\"https://dummyimage.com/200x100.png\")\n ->setDescription(\"iezfj\");\n $manager->persist($picture);\n \n // Créer 3 Produits\n $products = [\n \"Banana\" => 3,\n \"Apple\" => 2,\n \"Grapes\"=> 4\n ];\n\n $productEntity = [];\n\n foreach ($products as $k => $v) {\n $fruit = new Product();\n $fruit\n ->setTitle($k)\n ->setPrice($v)\n ->setRef(\"773894\")\n ->setDescription(\"tasty fruit\")\n ->setInStock(true)\n ->setStockQuantiy(42)\n ->setCategory($category1)\n ->addPicture($picture);\n \n $productEntity[] = $fruit;\n $manager->persist($fruit);\n }\n\n // Créer 1 Utilisateur\n $user = new User();\n $user\n ->setEmail(\"[email protected]\")\n ->setPassword(\"zeiopjJIO%ZEOIJ\")\n ->setCreatedAt(new \\DateTime())\n ->setFirstName(\"Joe\")\n ->setLastName(\"Crazy\");\n $manager->persist($user);\n \n // Créer 2 Lignes de commandes\n $orderLine = new OrderLine();\n $orderLine\n ->setQuantity(34);\n $manager->persist($orderLine);\n \n // Créer 1 Commande\n $order = new Order();\n $order\n ->setCreatedAt(new \\DateTime())\n ->setShippingAt(new \\DateTime(\"2021-08-19\"))\n ->setTotal(42,2)\n ->setValid(false)\n ->addOrderLine($orderLine)\n ->setUser($user);\n\n $manager->persist($order);\n\n\n //////\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n// $pegawai1 = new Pegawai();\n// $pegawai1->setNama('Pegawai 1');\n// $pegawai1->setUser(NewUserFixtures::USER_SUPER_ADMIN);\n// $pegawai1->setTempatLahir('Jakarta');\n// $pegawai1->setTanggalLahir(new DateTimeImmutable());\n// $pegawai1->setJenisKelamin(JenisKelaminFixtures::LAKI);\n// $pegawai1->setAgama(AgamaFixtures::AGAMA_1);\n// $pegawai1->setNik('9999999999999999');\n// $pegawai1->setNip9('999999999');\n// $pegawai1->setNip18('999999999999999999');\n// $manager->persist($pegawai1);\n//\n// $manager->flush();\n//\n// $this->addReference(self::PEGAWAI_1, $pegawai1);\n }", "public function load(ObjectManager $manager)\n {\n // Url\n $url = \"https://my.api.mockaroo.com/json_users_with_avatar.json\";\n // Appel de la fonction de récupération des données\n $datas = $this->makeRequest( $url );\n\n\n // Ensuite on interprète le jeu de données\n foreach ( $datas as $data )\n {\n // Nouvelle instance d'Actor\n $actor = new Actor();\n\n // Charger les données\n $actor->setFirstname( $data['firstname'] )\n ->setLastname( $data['lastname'] )\n ->setAge( $data['age'] )\n ->setImage( $data['image'] )\n ->setBiography( $data['biography'] );\n\n // Persistance en base\n $manager->persist( $actor );\n }\n\n // Méthode 2 : à la main\n // Nouvelle instance d'Actor\n $actor = new Actor();\n\n // Charger les données\n $actor->setFirstname( \"Pascal\" )\n ->setLastname( \"CALVAT\" )\n ->setAge( \"50\" )\n ->setImage( \"https://robohash.org/nostrumnonaut.jpg?size=50x50&set=set1\" )\n ->setBiography( \"Formation Symfony\" );\n\n // Persistance en base\n $manager->persist( $actor );\n\n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n $propriete = new propriete(); \n $propriete->setDescription('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \n aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in.');\n $propriete->setNomPropriete(\"villa bonheur\");\n $propriete->setTypepropriete(\"Appartement\");\n \n $propriete2 = new propriete(); \n $propriete2->setDescription('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \n aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in.');\n $propriete2->setNomPropriete(\"villa\");\n $propriete2->setTypepropriete(\"Maison\");\n \n $propriete3 = new propriete(); \n $propriete3->setDescription('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \n aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in.');\n $propriete3->setNomPropriete(\"villa bonheur\");\n $propriete3->setTypepropriete(\"Villa\");\n \n $propriete4 = new propriete(); \n $propriete4->setDescription('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \n aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in.');\n $propriete4->setNomPropriete(\"villa\");\n $propriete4->setTypepropriete(\"Villa\");\n \n /*GESTION DES CLES */\n $propriete->setAdresse($this->getReference('user_adrPropriete'));\n $propriete->setProprietaire($this->getReference('loca_proprio'));\n \n $propriete2->setAdresse($this->getReference('user_adrPropriete2'));\n $propriete2->setProprietaire($this->getReference('loca_proprio2'));\n \n $propriete3->setAdresse($this->getReference('user_adrPropriete'));\n $propriete3->setProprietaire($this->getReference('loca_proprio'));\n \n $propriete4->setAdresse($this->getReference('user_adrPropriete'));\n $propriete4->setProprietaire($this->getReference('loca_proprio2'));\n \n $manager->persist($propriete);$manager->persist($propriete2);\n $manager->persist($propriete3);$manager->persist($propriete4);\n $manager->flush();\n \n $this->addReference('loca_propriete', $propriete);\n $this->addReference('loca_propriete2', $propriete2);\n $this->addReference('loca_propriete3', $propriete3);\n $this->addReference('loca_propriete4', $propriete4);\n }", "public function load(ObjectManager $manager)\r\n {\r\n\r\n /**\r\n * Database `hackathon2019`\r\n */\r\n\r\n /** new user @fr */\r\n\r\n $user = new User();\r\n $user->setMail('[email protected]');\r\n $user->setMd5Password(md5('test'));\r\n $user->setNom('Roger');\r\n $user->setPrenom('Francois');\r\n $user->setPrivilege(1);\r\n\r\n $manager->persist($user);\r\n\r\n $manager->flush();\r\n\r\n /* `hackathon2019`.`regions` */\r\n $regions = array(\r\n array('ville_nom_simple' => 'saint genis pouilly','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'peronnas','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'miribel','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'divonne les bains','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'lagnieu','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'amberieu en bugey','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'ferney voltaire','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'viriat','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'oyonnax','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'montluel','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'belley','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'jassans riottier','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'meximieux','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'prevessin moens','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'trevoux','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bellegarde sur valserine','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bourg en bresse','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint denis les bourg','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'gex','ville_departement' => '01','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'soissons','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'chauny','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'laon','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'tergnier','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'hirson','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'guise','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'chateau thierry','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint quentin','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'villers cotterets','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'bohain en vermandois','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'gauchy','ville_departement' => '02','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'domerat','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'yzeure','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'gannat','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'montlucon','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bellerive sur allier','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint pourcain sur sioule','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'vichy','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'commentry','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'cusset','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'moulins','ville_departement' => '03','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'chateau arnoux saint auban','ville_departement' => '04','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'oraison','ville_departement' => '04','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'sisteron','ville_departement' => '04','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'manosque','ville_departement' => '04','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'digne les bains','ville_departement' => '04','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'embrun','ville_departement' => '05','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'gap','ville_departement' => '05','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'briancon','ville_departement' => '05','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la gaude','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'vence','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'grasse','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'peymeinade','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'beausoleil','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'roquefort les pins','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'biot','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'villefranche sur mer','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'valbonne','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'vallauris','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'contes','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'mouans sartoux','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'antibes','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'cannes','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'villeneuve loubet','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'pegomas','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'mougins','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'le cannet','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'carros','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la trinite','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'cagnes sur mer','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'menton','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint laurent du var','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'nice','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'roquebrune cap martin','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la colle sur loup','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'mandelieu la napoule','ville_departement' => '06','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint peray','ville_departement' => '07','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'le teil','ville_departement' => '07','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'guilherand granges','ville_departement' => '07','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'privas','ville_departement' => '07','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'tournon sur rhone','ville_departement' => '07','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'annonay','ville_departement' => '07','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bourg saint andeol','ville_departement' => '07','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'aubenas','ville_departement' => '07','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'givet','ville_departement' => '08','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'nouzonville','ville_departement' => '08','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'charleville mezieres','ville_departement' => '08','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'revin','ville_departement' => '08','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'rethel','ville_departement' => '08','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'bogny sur meuse','ville_departement' => '08','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'sedan','ville_departement' => '08','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saint girons','ville_departement' => '09','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'foix','ville_departement' => '09','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'lavelanet','ville_departement' => '09','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'pamiers','ville_departement' => '09','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint julien les villas','ville_departement' => '10','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'la chapelle saint luc','ville_departement' => '10','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'sainte savine','ville_departement' => '10','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'nogent sur seine','ville_departement' => '10','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'romilly sur seine','ville_departement' => '10','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saint andre les vergers','ville_departement' => '10','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'bar sur aube','ville_departement' => '10','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'troyes','ville_departement' => '10','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'carcassonne','ville_departement' => '11','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'castelnaudary','ville_departement' => '11','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'limoux','ville_departement' => '11','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'narbonne','ville_departement' => '11','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'sigean','ville_departement' => '11','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'port la nouvelle','ville_departement' => '11','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'lezignan corbieres','ville_departement' => '11','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'trebes','ville_departement' => '11','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'coursan','ville_departement' => '11','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'luc la primaube','ville_departement' => '12','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'onet le chateau','ville_departement' => '12','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'rodez','ville_departement' => '12','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint affrique','ville_departement' => '12','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'millau','ville_departement' => '12','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'villefranche de rouergue','ville_departement' => '12','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'decazeville','ville_departement' => '12','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'la roque d antheron','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'cassis','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'senas','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint remy de provence','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'eguilles','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'istres','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'noves','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'aix en provence','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'allauch','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la fare les oliviers','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint cannat','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'bouc bel air','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'peypin','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la bouilladisse','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint victoret','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'salon de provence','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'marseille','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'port saint louis du rhone','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'le puy sainte reparade','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'chateaurenard','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'mallemort','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'cabries','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint chamas','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint mitre les remparts','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'rognac','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'plan de cuques','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'arles','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'venelles','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'aubagne','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'martigues','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'port de bouc','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'gignac la nerthe','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'vitrolles','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'tarascon','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'septemes les vallons','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'sausset les pins','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'miramas','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'fuveau','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'roquevaire','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'fos sur mer','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'meyreuil','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'les pennes mirabeau','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'pelissanne','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la ciotat','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la penne sur huveaune','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'trets','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'gemenos','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'carry le rouet','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint martin de crau','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'ensues la redonne','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'marignane','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'simiane collongue','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'lancon provence','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'lambesc','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'carnoux en provence','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'eyguieres','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'velaux','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'gardanne','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'berre l etang','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'auriol','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'chateauneuf les martigues','ville_departement' => '13','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'blainville sur orne','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'ouistreham','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'vire','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'ifs','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'conde sur noireau','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'colombelles','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'lisieux','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'falaise','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'bayeux','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'mondeville','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'herouville saint clair','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'caen','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'dives sur mer','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'honfleur','ville_departement' => '14','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'aurillac','ville_departement' => '15','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint flour','ville_departement' => '15','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'arpajon sur cere','ville_departement' => '15','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'soyaux','ville_departement' => '16','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'la couronne','ville_departement' => '16','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint yrieix sur charente','ville_departement' => '16','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'gond pontouvre','ville_departement' => '16','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'ruelle sur touvre','ville_departement' => '16','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'cognac','ville_departement' => '16','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'angouleme','ville_departement' => '16','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'champniers','ville_departement' => '16','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'l isle d espagnac','ville_departement' => '16','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint pierre d oleron','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'surgeres','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'perigny','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saintes','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'nieul sur mer','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saujon','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'la rochelle','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'aytre','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'royan','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'dompierre sur mer','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint jean d angely','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'marennes','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'tonnay charente','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'rochefort','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'lagord','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'chatelaillon plage','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'puilboreau','ville_departement' => '17','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint doulchard','ville_departement' => '18','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint amand montrond','ville_departement' => '18','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'vierzon','ville_departement' => '18','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'mehun sur yevre','ville_departement' => '18','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint florent sur cher','ville_departement' => '18','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'bourges','ville_departement' => '18','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'aubigny sur nere','ville_departement' => '18','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'tulle','ville_departement' => '19','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'ussel','ville_departement' => '19','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'malemort sur correze','ville_departement' => '19','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'brive la gaillarde','ville_departement' => '19','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'quetigny','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'montbard','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'nuits saint georges','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'chenove','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'beaune','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'dijon','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'chatillon sur seine','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'fontaine les dijon','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'talant','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'marsannay la cote','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'genlis','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'auxonne','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'saint apollinaire','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'chevigny saint sauveur','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'longvic','ville_departement' => '21','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'ploufragan','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'perros guirec','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'paimpol','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'loudeac','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'saint brieuc','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'guingamp','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'pordic','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'lannion','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'langueux','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'tregueux','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'dinan','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'lamballe','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'pledran','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'plerin','ville_departement' => '22','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'gueret','ville_departement' => '23','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'la souterraine','ville_departement' => '23','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'boulazac','ville_departement' => '24','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'coulounieix chamiers','ville_departement' => '24','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'perigueux','ville_departement' => '24','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'sarlat la caneda','ville_departement' => '24','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'bergerac','ville_departement' => '24','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'trelissac','ville_departement' => '24','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'montpon menesterol','ville_departement' => '24','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint astier','ville_departement' => '24','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'terrasson lavilledieu','ville_departement' => '24','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'morteau','ville_departement' => '25','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'bethoncourt','ville_departement' => '25','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'valentigney','ville_departement' => '25','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'pontarlier','ville_departement' => '25','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'seloncourt','ville_departement' => '25','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'baume les dames','ville_departement' => '25','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'montbeliard','ville_departement' => '25','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'audincourt','ville_departement' => '25','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'besancon','ville_departement' => '25','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'nyons','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'romans sur isere','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'valence','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'crest','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'livron sur drome','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'montelimar','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'tain l hermitage','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint rambert d albon','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bourg les valence','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'loriol sur drome','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint paul trois chateaux','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'portes les valence','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'donzere','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'pierrelatte','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bourg de peage','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'chabeuil','ville_departement' => '26','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'gisors','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'louviers','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'bernay','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'pont audemer','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'vernon','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'les andelys','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'val de reuil','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'gaillon','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'evreux','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'verneuil sur avre','ville_departement' => '27','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'epernon','ville_departement' => '28','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'luce','ville_departement' => '28','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'chartres','ville_departement' => '28','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'dreux','ville_departement' => '28','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'vernouillet','ville_departement' => '28','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'chateaudun','ville_departement' => '28','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'mainvilliers','ville_departement' => '28','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'nogent le rotrou','ville_departement' => '28','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'luisant','ville_departement' => '28','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'le relecq kerhuon','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'guilers','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'lannilis','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'briec','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'quimperle','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'plougastel daoulas','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'saint pol de leon','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'plouguerneau','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'fouesnant','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'scaer','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'chateaulin','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'pont l abbe','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'guipavas','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'saint renan','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'concarneau','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'gouesnou','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'lesneven','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'landivisiau','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'tregunc','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'crozon','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'plabennec','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'morlaix','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'plouzane','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'rosporden','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'bannalec','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'ergue gaberic','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'quimper','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'penmarch','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'douarnenez','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'landerneau','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'moelan sur mer','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'ploneour lanvern','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'carhaix plouguer','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'brest','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'ploudalmezeau','ville_departement' => '29','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'le grau du roi','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'roquemaure','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'beaucaire','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'aigues mortes','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'manduel','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'les angles','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'pont saint esprit','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'rochefort du gard','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'la grand combe','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint gilles','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'nimes','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'bagnols sur ceze','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'milhaud','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'uzes','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'marguerittes','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'ales','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'vauvert','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'villeneuve les avignon','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint christol les ales','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'bellegarde','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'bouillargues','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'laudun l ardoise','ville_departement' => '30','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'beauzelle','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint gaudens','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'leguevin','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'colomiers','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'muret','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint lys','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'ramonville saint agne','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'cornebarrieu','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'fenouillet','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'castanet tolosan','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'tournefeuille','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'portet sur garonne','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'castelginest','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'la salvetat saint gilles','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'villemur sur tarn','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'pibrac','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'blagnac','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'toulouse','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'frouzins','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'auterive','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'escalquens','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'seysses','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'aussonne','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'villeneuve tolosane','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint jean','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'aucamville','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'l union','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'castelnau d estretefonds','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint orens de gameville','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'fonsorbes','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'cugnaux','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'balma','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint alban','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'launaguet','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'plaisance du touch','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'revel','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'grenade','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'fronton','ville_departement' => '31','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'l isle jourdain','ville_departement' => '32','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'auch','ville_departement' => '32','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'condom','ville_departement' => '32','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'fleurance','ville_departement' => '32','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint jean d illac','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'le bouscat','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'libourne','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'floirac','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'langon','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'gradignan','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'coutras','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'biganos','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'bordeaux','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'begles','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'parempuyre','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'audenge','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'bassens','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint aubin de medoc','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'le haillan','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'lesparre medoc','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'la teste de buch','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'eysines','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'pauillac','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'arcachon','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'gujan mestras','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint loubes','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'andernos les bains','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint medard en jalles','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'le teich','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'blanquefort','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'artigues pres bordeaux','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'ares','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'bruges','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'le pian medoc','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'martignas sur jalle','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'lormont','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'carbon blanc','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'villenave d ornon','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'mios','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'cestas','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'ambares et lagrave','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'leognan','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'talence','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'pessac','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'lanton','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'izon','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'merignac','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'le taillan medoc','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'cenon','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'salles','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'lege cap ferret','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint andre de cubzac','ville_departement' => '33','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'mauguio','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'perols','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'castelnau le lez','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'fabregues','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'baillargues','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'marsillargues','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'bedarieux','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'lattes','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint georges d orques','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'agde','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'beziers','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'balaruc les bains','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'meze','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'sete','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint jean de vedas','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'lodeve','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint clement de riviere','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'clapiers','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'pezenas','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'gignac','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint gely du fesc','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'pignan','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'castries','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'frontignan','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'marseillan','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'le cres','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'montpellier','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'villeneuve les maguelone','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'serignan','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'vendargues','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'cournonterral','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'lunel','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'grabels','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'la grande motte','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'vias','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'juvignac','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'clermont l herault','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'gigean','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'palavas les flots','ville_departement' => '34','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'bain de bretagne','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'rennes','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'redon','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'saint malo','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'dinard','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'cancale','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'saint gregoire','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'vern sur seiche','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'combourg','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'liffre','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'montfort sur meu','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'janze','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'bruz','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'thorigne fouillard','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'betton','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'fougeres','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'noyal chatillon sur seiche','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'vitre','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'pleurtuit','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'pace','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'le rheu','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'saint jacques de la lande','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'noyal sur vilaine','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'guichen','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'chantepie','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'cesson sevigne','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'chartres de bretagne','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'chateaugiron','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'melesse','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'acigne','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'mordelles','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'chateaubourg','ville_departement' => '35','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'deols','ville_departement' => '36','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'issoudun','ville_departement' => '36','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'chateauroux','ville_departement' => '36','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'le poinconnet','ville_departement' => '36','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'argenton sur creuse','ville_departement' => '36','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'le blanc','ville_departement' => '36','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'blere','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint cyr sur loire','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'ballan mire','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'amboise','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'loches','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'chinon','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'chambray les tours','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'tours','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint pierre des corps','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'joue les tours','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'monts','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'chateau renault','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'montlouis sur loire','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint avertin','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'fondettes','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'veigne','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'la riche','ville_departement' => '37','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'voiron','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'le peage de roussillon','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint martin d heres','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'meylan','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'charvieu chavagneux','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la verpilliere','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'vizille','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la tour du pin','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'roussillon','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint ismier','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'fontaine','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'echirolles','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'les avenieres','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'grenoble','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'varces allieres et risset','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'domene','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bourgoin jallieu','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint martin le vinoux','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la tronche','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'tignieu jameyzieu','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'le pont de claix','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint egreve','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint martin d uriage','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint marcellin','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'rives','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'moirans','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint maurice l exil','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'villefontaine','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint quentin fallavier','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'pont eveque','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'sassenage','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la mure','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'l isle d abeau','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'gieres','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'villard bonnot','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'tullins','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'crolles','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'voreppe','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'seyssins','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'claix','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'vif','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'seyssinet pariset','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'vienne','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'pontcharra','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'eybens','ville_departement' => '38','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint claude','ville_departement' => '39','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'morez','ville_departement' => '39','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'dole','ville_departement' => '39','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'lons le saunier','ville_departement' => '39','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'champagnole','ville_departement' => '39','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'aire sur l adour','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'parentis en born','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'mimizan','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'biscarrosse','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'dax','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'capbreton','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint pierre du mont','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'tarnos','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'mont de marsan','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'soustons','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint paul les dax','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint vincent de tyrosse','ville_departement' => '40','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'romorantin lanthenay','ville_departement' => '41','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'vineuil','ville_departement' => '41','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'vendome','ville_departement' => '41','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'salbris','ville_departement' => '41','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'blois','ville_departement' => '41','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'mer','ville_departement' => '41','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'rive de gier','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'firminy','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint genest lerpt','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint galmier','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la talaudiere','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'unieux','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'veauche','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'sorbiers','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'montbrison','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint etienne','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint jean bonnefonds','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'sury le comtal','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'andrezieux boutheon','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'le chambon feugerolles','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'chazelles sur lyon','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'le coteau','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint chamond','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint just saint rambert','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la grand croix','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint priest en jarez','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'mably','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la ricamarie','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'roche la moliere','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'villars','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'roanne','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'feurs','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'riorges','ville_departement' => '42','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'monistrol sur loire','ville_departement' => '43','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'brioude','ville_departement' => '43','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'aurec sur loire','ville_departement' => '43','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'sainte sigolene','ville_departement' => '43','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'le puy en velay','ville_departement' => '43','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'yssingeaux','ville_departement' => '43','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'sainte pazanne','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'carquefou','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint herblain','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'vallet','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'donges','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'blain','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'pornic','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'suce sur erdre','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'le pouliguen','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'montoir de bretagne','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'basse goulaine','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'le loroux bottereau','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'trignac','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'thouare sur loire','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint andre des eaux','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'bouguenais','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'les sorinieres','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint sebastien sur loire','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'savenay','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'herbignac','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'pont saint martin','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'treillieres','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'la montagne','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'coueron','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'orvault','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'sautron','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'clisson','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'machecoul','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'pontchateau','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint etienne de montluc','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint julien de concelles','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'pornichet','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'vertou','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'nantes','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'sainte luce sur loire','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'reze','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'chateaubriant','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint philbert de grand lieu','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'heric','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'bouaye','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'guerande','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'ancenis','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'nort sur erdre','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint brevin les pins','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'vigneux de bretagne','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'la baule escoublac','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'la chapelle sur erdre','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint nazaire','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'haute goulaine','ville_departement' => '44','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'amilly','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'la ferte saint aubin','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'briare','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint jean de braye','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'gien','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'villemandeur','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'beaugency','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'pithiviers','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'montargis','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'meung sur loire','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'chalette sur loing','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'la chapelle saint mesmin','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'fleury les aubrais','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'checy','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'malesherbes','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saran','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'sully sur loire','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint jean de la ruelle','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint pryve saint mesmin','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint jean le blanc','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'ingre','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'saint denis en val','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'orleans','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'chateauneuf sur loire','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'olivet','ville_departement' => '45','name' => 'Centre-Val de Loire'),\r\n array('ville_nom_simple' => 'figeac','ville_departement' => '46','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'cahors','ville_departement' => '46','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'bon encontre','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'tonneins','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'agen','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'villeneuve sur lot','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'boe','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'le passage','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'marmande','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'sainte livrade sur lot','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'fumel','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'nerac','ville_departement' => '47','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'mende','ville_departement' => '48','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'chemille','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'cholet','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'beaupreau','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'angers','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'beaufort en vallee','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'montreuil juigne','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'trelaze','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint barthelemy d anjou','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'avrille','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'segre','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'chalonnes sur loire','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'bouchemaine','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'doue la fontaine','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'les ponts de ce','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'longue jumelles','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saumur','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'murs erigne','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint macaire en mauges','ville_departement' => '49','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'equeurdreville hainneville','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'avranches','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'tourlaville','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'granville','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'coutances','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'carentan','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'querqueville','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'cherbourg octeville','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'saint lo','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'valognes','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'la glacerie','ville_departement' => '50','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'betheny','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'reims','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'epernay','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'vitry le francois','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'chalons en champagne','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'cormontreuil','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'sezanne','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'tinqueux','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'fismes','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saint memmie','ville_departement' => '51','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'chaumont','ville_departement' => '52','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'langres','ville_departement' => '52','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saint dizier','ville_departement' => '52','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'chateau gontier','ville_departement' => '53','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'change','ville_departement' => '53','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'ernee','ville_departement' => '53','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint berthevin','ville_departement' => '53','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'mayenne','ville_departement' => '53','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'evron','ville_departement' => '53','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'bonchamp les laval','ville_departement' => '53','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'laval','ville_departement' => '53','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'joeuf','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'tomblaine','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'malzeville','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'mont saint martin','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'laneuveville devant nancy','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saint nicolas de port','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'jarville la malgrange','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'jarny','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'villerupt','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'frouard','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'longwy','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saint max','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'nancy','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'pompey','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'ludres','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'longuyon','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'pont a mousson','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'champigneulles','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'briey','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'heillecourt','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'luneville','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'essey les nancy','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'seichamps','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'maxeville','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'vandoeuvre les nancy','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'neuves maisons','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'dombasle sur meurthe','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'toul','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'villers les nancy','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'liverdun','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'homecourt','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'laxou','ville_departement' => '54','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'verdun','ville_departement' => '55','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'commercy','ville_departement' => '55','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'bar le duc','ville_departement' => '55','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'auray','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'questembert','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'queven','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'theix','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'sarzeau','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'pontivy','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'lorient','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'vannes','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'arradon','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'sene','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'caudan','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'lanester','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'hennebont','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'languidic','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'ploeren','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'ploemeur','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'larmor plage','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'plouay','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'guidel','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'ploermel','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'inzinzac lochrist','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'guer','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'brech','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'pluvigner','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'baud','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'saint ave','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'kervignac','ville_departement' => '56','name' => 'Bretagne'),\r\n array('ville_nom_simple' => 'behren les forbach','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'marly','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'stiring wendel','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'yutz','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'florange','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'amneville','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'mondelange','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'uckange','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'forbach','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'woippy','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'moulins les metz','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'freyming merlebach','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'l hopital','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'metz','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'hombourg haut','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'hayange','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'talange','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'fameck','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'petite rosselle','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'guenange','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'thionville','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'sarrebourg','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'hagondange','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'terville','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'moyeuvre grande','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'faulquemont','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'bitche','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'maizieres les metz','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'rombas','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'farebersviller','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saint avold','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'hettange grande','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'sarreguemines','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'audun le tiche','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'marange silvange','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'montigny les metz','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'algrange','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'creutzwald','ville_departement' => '57','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'decize','ville_departement' => '58','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'cosne cours sur loire','ville_departement' => '58','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'varennes vauzelles','ville_departement' => '58','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'la charite sur loire','ville_departement' => '58','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'nevers','ville_departement' => '58','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'waziers','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'conde sur l escaut','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'sainghin en weppes','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'roubaix','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'wattrelos','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'villeneuve d ascq','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'trith saint leger','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'roncq','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'bauvin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'fourmies','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lille','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'marquette lez lille','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'mons en baroeul','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'wattignies','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'sin le noble','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'aniche','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'la bassee','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'loos','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'fresnes sur escaut','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'le cateau cambresis','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'halluin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'roost warendin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'bourbourg','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'valenciennes','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'la madeleine','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'loon plage','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'wormhout','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'louvroil','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lys lez lannoy','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'quesnoy sur deule','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'perenchies','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint saulve','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'santes','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'hazebrouck','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'onnaing','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'templeuve','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'bruay sur l escaut','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'houplines','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'vieux conde','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lesquin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'gravelines','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'hautmont','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'aulnoye aymeries','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint andre lez lille','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'quievrechain','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'maubeuge','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'merville','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'tourcoing','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'caudry','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'neuville en ferrain','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'jeumont','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lallaing','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'coudekerque branche','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'annoeullin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'fenain','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'croix','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'anzin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'comines','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'marly','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'pecquencourt','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'ronchin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'bondues','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'dunkerque','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'douchy les mines','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'ferriere la grande','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'escaudain','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'flines lez raches','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint amand les eaux','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'douai','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'orchies','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'wallers','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'grand fort philippe','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'nieppe','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'la gorgue','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'armentieres','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'wasquehal','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'mouvaux','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'seclin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lambersart','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'bailleul','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'cambrai','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'marcq en baroeul','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'estaires','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lambres lez douai','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'denain','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'hem','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'la chapelle d armentieres','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'aulnoy lez valenciennes','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'raismes','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'leers','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'cuincy','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'haubourdin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'flers en escrebieux','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'grande synthe','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'teteghem','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'faches thumesnil','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'wambrechies','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'somain','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'cappelle la grande','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'feignies','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'ostricourt','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'linselles','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'auby','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'dechy','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'wavrin','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'beuvrages','ville_departement' => '59','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'compiegne','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'chambly','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'nogent sur oise','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'mouy','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'meru','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint just en chaussee','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'senlis','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'noyon','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'creil','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'crepy en valois','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'gouvieux','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'pont sainte maxence','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'margny les compiegne','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'beauvais','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lamorlaye','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'liancourt','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'villers saint paul','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'montataire','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'chantilly','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'clermont','ville_departement' => '60','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'flers','ville_departement' => '61','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'argentan','ville_departement' => '61','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'alencon','ville_departement' => '61','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'l aigle','ville_departement' => '61','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'la ferte mace','ville_departement' => '61','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'marquise','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'divion','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'grenay','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'mericourt','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint etienne au mont','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'oignies','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'marck','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lievin','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'auchel','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'henin beaumont','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'guines','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'hersin coupigny','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint omer','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'harnes','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'wingles','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'rouvroy','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'cucq','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'arras','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'desvres','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'oye plage','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'sallaumines','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'noyelles sous lens','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'noeux les mines','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'montigny en gohelle','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'marles les mines','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'coulogne','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'annezin','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'beuvry','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'dainville','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'loison sous lens','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'arques','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'calais','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'wimereux','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'boulogne sur mer','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'etaples','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'libercourt','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lillers','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'bethune','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'isbergues','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'le touquet paris plage','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint pol sur ternoise','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'courcelles les lens','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'leforest','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'carvin','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'loos en gohelle','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'aire sur la lys','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'le portel','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'barlin','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'bully les mines','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'bruay la buissiere','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'dourges','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'avion','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'outreau','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'courrieres','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'noyelles godault','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint laurent blangy','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'billy montigny','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'douvrin','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'fouquieres les lens','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'mazingarbe','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'longuenesse','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'lens','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'blendecques','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'vendin le vieil','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'houdain','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'beaurains','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'berck','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'saint martin boulogne','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'sains en gohelle','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'achicourt','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'calonne ricouart','ville_departement' => '62','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'pont du chateau','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'cournon d auvergne','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'ambert','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'clermont ferrand','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'issoire','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'ceyrat','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'lempdes','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'chamalieres','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'thiers','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'lezoux','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'cebazat','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'gerzat','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'riom','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'aubiere','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'beaumont','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'chatel guyon','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'romagnat','ville_departement' => '63','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'boucau','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'mourenx','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'hendaye','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'lescar','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'pau','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'oloron sainte marie','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'hasparren','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'lons','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'cambo les bains','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'bayonne','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'biarritz','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'urrugne','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'jurancon','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'bidart','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'ciboure','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'anglet','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'gan','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint pee sur nivelle','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'ustaritz','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'orthez','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint jean de luz','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'billere','ville_departement' => '64','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'aureilhan','ville_departement' => '65','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'lannemezan','ville_departement' => '65','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'tarbes','ville_departement' => '65','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'vic en bigorre','ville_departement' => '65','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'bagneres de bigorre','ville_departement' => '65','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'lourdes','ville_departement' => '65','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'cabestany','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'bompas','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint cyprien','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'ille sur tet','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint esteve','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'argeles sur mer','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'elne','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint laurent de la salanque','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'rivesaltes','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'thuir','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'ceret','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'le boulou','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'pia','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'canet en roussillon','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'prades','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'le soler','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'toulouges','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'perpignan','ville_departement' => '66','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'ostwald','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'mundolsheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'wasselonne','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'molsheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'barr','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'eckbolsheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'obernai','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saverne','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'strasbourg','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'benfeld','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'bischwiller','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'vendenheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'geispolsheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'bischheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'schiltigheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'reichshoffen','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'souffelweyersheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'illkirch graffenstaden','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'selestat','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'hoenheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'erstein','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'brumath','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'la wantzenau','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'fegersheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'haguenau','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'mutzig','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'lingolsheim','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'wissembourg','ville_departement' => '67','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'wittelsheim','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'colmar','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'altkirch','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'kingersheim','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saint louis','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'wintzenheim','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'illzach','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'wittenheim','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'sainte marie aux mines','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'cernay','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'thann','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'huningue','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'ensisheim','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'soultz haut rhin','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'riedisheim','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'brunstatt','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'pfastatt','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'sausheim','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'rixheim','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'lutterbach','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'guebwiller','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'mulhouse','ville_departement' => '68','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'oullins','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'neuville sur saone','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'grigny','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'venissieux','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'jonage','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'villefranche sur saone','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'tassin la demi lune','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'mions','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'corbas','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'gleize','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'caluire et cuire','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'irigny','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'chaponost','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'lentilly','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint fons','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint genis laval','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'amplepuis','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint symphorien d ozon','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'lyon','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint priest','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'brindas','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'genas','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'vaulx en velin','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'belleville','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'chassieu','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'craponne','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint bonnet de mure','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'villeurbanne','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'pierre benite','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'fontaines sur saone','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'francheville','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'brignais','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'ternay','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'meyzieu','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'l arbresle','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint cyr au mont d or','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'anse','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bron','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'rillieux la pape','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la mulatiere','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'ecully','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'decines charpieu','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'dardilly','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint didier au mont d or','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'feyzin','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'tarare','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'mornant','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'givors','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'sainte foy les lyon','ville_departement' => '69','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'lure','ville_departement' => '70','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'vesoul','ville_departement' => '70','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'luxeuil les bains','ville_departement' => '70','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'gray','ville_departement' => '70','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'hericourt','ville_departement' => '70','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'saint vallier','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'louhans','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'tournus','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'saint remy','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'montchanin','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'le creusot','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'digoin','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'montceau les mines','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'charnay les macon','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'chagny','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'paray le monial','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'macon','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'chalon sur saone','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'gueugnon','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'blanzy','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'saint marcel','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'chatenoy le royal','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'autun','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'bourbon lancy','ville_departement' => '71','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'le mans','ville_departement' => '72','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'mamers','ville_departement' => '72','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'change','ville_departement' => '72','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'allonnes','ville_departement' => '72','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'sable sur sarthe','ville_departement' => '72','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'coulaines','ville_departement' => '72','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'la ferte bernard','ville_departement' => '72','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'la fleche','ville_departement' => '72','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'arnage','ville_departement' => '72','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'aix les bains','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'albertville','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint jean de maurienne','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la ravoire','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'chambery','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'challes les eaux','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint alban leysse','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la motte servolex','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'ugine','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bourg saint maurice','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'cognin','ville_departement' => '73','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'la roche sur foron','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'seynod','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'annecy','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'marnaz','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'sciez','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'thyez','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'evian les bains','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'meythet','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'thones','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'ville la grand','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'bonneville','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'passy','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint jorioz','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'thonon les bains','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'annecy le vieux','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'cran gevrier','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint pierre en faucigny','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'reignier esery','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'gaillard','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'sallanches','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'rumilly','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'poisy','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'annemasse','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'chamonix mont blanc','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'vetraz monthoux','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'marignier','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'scionzier','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'publier','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'cranves sales','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint gervais les bains','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'faverges','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'saint julien en genevois','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'cluses','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'ambilly','ville_departement' => '74','name' => 'Auvergne-Rhône-Alpes'),\r\n array('ville_nom_simple' => 'paris','ville_departement' => '75','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint pierre les elbeuf','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'octeville sur mer','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'le treport','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'cleon','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'le petit quevilly','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'gournay en bray','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'oissel','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'eu','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'darnetal','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'yvetot','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'grand couronne','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'le grand quevilly','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'elbeuf','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'bois guillaume','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'barentin','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'harfleur','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'le trait','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'saint etienne du rouvray','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'deville les rouen','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'malaunay','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'maromme','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'notre dame de gravenchon','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'franqueville saint pierre','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'notre dame de bondeville','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'bihorel','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'rouen','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'mont saint aignan','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'bonsecours','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'dieppe','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'montivilliers','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'sotteville les rouen','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'petit couronne','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'pavilly','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'saint aubin les elbeuf','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'caudebec les elbeuf','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'lillebonne','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'sainte adresse','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'le mesnil esnard','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'fecamp','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'gonfreville l orcher','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'canteleu','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'bolbec','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'le havre','ville_departement' => '76','name' => 'Normandie'),\r\n array('ville_nom_simple' => 'emerainville','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'nangis','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'avon','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'nanteuil les meaux','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'magny le hongre','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'lieusaint','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'gretz armainvilliers','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint thibault des vignes','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'moissy cramayel','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vert saint denis','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'lagny sur marne','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint pierre les nemours','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'claye souilly','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bois le roi','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'champs sur marne','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'esbly','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chelles','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'torcy','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'dammarie les lys','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'roissy en brie','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'fontainebleau','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'meaux','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'nemours','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'brie comte robert','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'othis','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vaires sur marne','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montereau fault yonne','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bailly romainvilliers','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'combs la ville','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'pontault combault','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'dammartin en goele','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'coulommiers','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'champagne sur seine','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vaux le penil','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'cesson','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ozoir la ferriere','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'tournan en brie','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'noisiel','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'souppes sur loing','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'lognes','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'provins','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'la ferte sous jouarre','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'thorigny sur marne','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bussy saint georges','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'fontenay tresigny','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'nandy','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'melun','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'savigny le temple','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'serris','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le mee sur seine','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint fargeau ponthierry','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint pathus','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'mitry mory','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montevrain','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villeparisis','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'courtry','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'lesigny','ville_departement' => '77','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chanteloup les vignes','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chambourcy','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'meulan en yvelines','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'rambouillet','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montesson','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le vesinet','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'maisons laffitte','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'maurepas','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'houilles','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'les mureaux','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'sartrouville','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'la verriere','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'croissy sur seine','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bois d arcy','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'triel sur seine','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'acheres','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'carrieres sous poissy','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint nom la breteche','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'poissy','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'les essarts le roi','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'marly le roi','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'carrieres sur seine','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'verneuil sur seine','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'andresy','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'epone','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'plaisir','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'magny les hameaux','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'mantes la ville','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'gargenville','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'rosny sur seine','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint cyr l ecole','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'versailles','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'guyancourt','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'buc','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chatou','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'trappes','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vernouillet','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'fontenay le fleury','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le chesnay','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'beynes','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bougival','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'louveciennes','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'magnanville','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'maule','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'conflans sainte honorine','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'mantes la jolie','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint germain en laye','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'aubergenville','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'voisins le bretonneux','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'les clayes sous bois','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le pecq','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le perray en yvelines','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villepreux','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montigny le bretonneux','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'noisy le roi','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'elancourt','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'jouy en josas','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'viroflay','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villennes sur seine','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'orgeval','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'limay','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'jouars pontchartrain','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le mesnil le roi','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chevreuse','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'la celle saint cloud','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'velizy villacoublay','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le mesnil saint denis','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint remy les chevreuse','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint arnoult en yvelines','ville_departement' => '78','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'parthenay','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'niort','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'chauray','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint maixent l ecole','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'aiffres','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'la creche','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'bressuire','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'thouars','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'nueil les aubiers','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'mauleon','ville_departement' => '79','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'doullens','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'peronne','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'montdidier','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'roye','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'abbeville','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'ham','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'longueau','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'corbie','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'amiens','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'albert','ville_departement' => '80','name' => 'Hauts-de-France'),\r\n array('ville_nom_simple' => 'albi','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'gaillac','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint juery','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'mazamet','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'lavaur','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'graulhet','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'aussillon','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'saint sulpice','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'labruguiere','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'carmaux','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'castres','ville_departement' => '81','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'castelsarrasin','ville_departement' => '82','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'valence','ville_departement' => '82','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'moissac','ville_departement' => '82','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'caussade','ville_departement' => '82','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'montech','ville_departement' => '82','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'montauban','ville_departement' => '82','name' => 'Occitanie'),\r\n array('ville_nom_simple' => 'sollies toucas','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'cogolin','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la londe les maures','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'sainte maxime','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'sollies pont','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint cyr sur mer','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'cavalaire sur mer','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la garde','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'puget sur argens','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'sanary sur mer','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'hyeres','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la valette du var','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'ollioules','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint maximin la sainte baume','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'lorgues','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'les arcs','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'roquebrune sur argens','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'le pradet','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'bormes les mimosas','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'carqueiranne','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'six fours les plages','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'vidauban','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'gareoult','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'draguignan','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'montauroux','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'trans en provence','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'le muy','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'frejus','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'cuers','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la crau','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'le lavandou','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'toulon','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'le beausset','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la cadiere d azur','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'brignoles','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint raphael','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'le luc','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint tropez','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'pierrefeu du var','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la farlede','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'saint mandrier sur mer','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'bandol','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'la seyne sur mer','ville_departement' => '83','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'bedarrides','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'le pontet','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'cavaillon','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'vedene','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'morieres les avignon','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'pernes les fontaines','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'sarrians','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'sorgues','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'l isle sur la sorgue','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'valreas','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'carpentras','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'courthezon','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'entraigues sur la sorgue','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'mazan','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'bollene','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'monteux','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'orange','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'avignon','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'pertuis','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'le thor','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'apt','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'vaison la romaine','ville_departement' => '84','name' => 'Provence-Alpes-Côte d\\'Azur'),\r\n array('ville_nom_simple' => 'talmont saint hilaire','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'le poire sur vie','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'chateau d olonne','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint jean de monts','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'fontenay le comte','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'olonne sur mer','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'pouzauges','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'challans','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'lucon','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'les sables d olonne','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'la roche sur yon','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint gilles croix de vie','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'chantonnay','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'mortagne sur sevre','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'saint hilaire de riez','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'les herbiers','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'aizenay','ville_departement' => '85','name' => 'Pays de la Loire'),\r\n array('ville_nom_simple' => 'montmorillon','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'buxerolles','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'jaunay clan','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'naintre','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'poitiers','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'loudun','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint benoit','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'chatellerault','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'migne auxances','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'chauvigny','ville_departement' => '86','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'isle','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint junien','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'feytiat','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'limoges','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'saint yrieix la perche','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'aixe sur vienne','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'ambazac','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'couzeix','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'panazol','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'le palais sur vienne','ville_departement' => '87','name' => 'Nouvelle-Aquitaine'),\r\n array('ville_nom_simple' => 'vittel','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'epinal','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'golbey','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'thaon les vosges','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'raon l etape','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'gerardmer','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'mirecourt','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'saint die des vosges','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'remiremont','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'rambervillers','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'neufchateau','ville_departement' => '88','name' => 'Grand Est'),\r\n array('ville_nom_simple' => 'tonnerre','ville_departement' => '89','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'villeneuve sur yonne','ville_departement' => '89','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'avallon','ville_departement' => '89','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'migennes','ville_departement' => '89','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'sens','ville_departement' => '89','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'joigny','ville_departement' => '89','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'auxerre','ville_departement' => '89','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'belfort','ville_departement' => '90','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'delle','ville_departement' => '90','name' => 'Bourgogne-Franche-Comté'),\r\n array('ville_nom_simple' => 'brunoy','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villebon sur yvette','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'evry','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'dourdan','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'draveil','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'mennecy','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'grigny','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'wissous','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ris orangis','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bures sur yvette','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'palaiseau','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'arpajon','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'epinay sur orge','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'boussy saint antoine','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'la ville du bois','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'verrieres le buisson','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'crosne','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'longpont sur orge','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint michel sur orge','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint pierre du perray','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ballancourt sur essonne','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vigneux sur seine','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'courcouronnes','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'etrechy','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saintry sur seine','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montlhery','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'fleury merogis','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'quincy sous senart','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'igny','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'viry chatillon','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'etampes','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'corbeil essonnes','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'orsay','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'massy','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'yerres','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'paray vieille poste','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint germain les arpajon','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'gif sur yvette','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'morangis','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chilly mazarin','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'epinay sous senart','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'les ulis','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'athis mons','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'soisy sur seine','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'lisses','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'marcoussis','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'linas','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'morsang sur orge','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'juvisy sur orge','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montgeron','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bretigny sur orge','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villemoisson sur orge','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bondoufle','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'egly','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint germain les corbeil','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'itteville','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'breuillet','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'lardy','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'sainte genevieve des bois','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'savigny sur orge','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'limours','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'longjumeau','ville_departement' => '91','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'neuilly sur seine','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chatillon','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bois colombes','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'puteaux','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'clamart','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'meudon','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'issy les moulineaux','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vaucresson','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'rueil malmaison','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'antony','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le plessis robinson','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'levallois perret','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'boulogne billancourt','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'asnieres sur seine','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'colombes','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'fontenay aux roses','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'garches','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villeneuve la garenne','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'courbevoie','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montrouge','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chatenay malabry','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'clichy','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vanves','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ville d avray','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'suresnes','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'sevres','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'sceaux','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chaville','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'la garenne colombes','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'gennevilliers','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'nanterre','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint cloud','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'malakoff','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bagneux','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bourg la reine','ville_departement' => '92','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le bourget','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bagnolet','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'la courneuve','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'les pavillons sous bois','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'sevran','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villemomble','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montreuil','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'livry gargan','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'aulnay sous bois','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'dugny','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villetaneuse','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le raincy','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint denis','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'les lilas','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'clichy sous bois','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'noisy le grand','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'romainville','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'aubervilliers','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'noisy le sec','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villepinte','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bobigny','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'pierrefitte sur seine','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'tremblay en france','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vaujours','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montfermeil','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'l ile saint denis','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le pre saint gervais','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'stains','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'pantin','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'neuilly plaisance','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'rosny sous bois','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint ouen','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'gournay sur marne','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bondy','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'epinay sur seine','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'neuilly sur marne','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'drancy','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le blanc mesnil','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'gagny','ville_departement' => '93','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'fontenay sous bois','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'l hay les roses','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'limeil brevannes','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'alfortville','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le plessis trevise','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'choisy le roi','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint mande','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'fresnes','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villiers sur marne','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le kremlin bicetre','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'boissy saint leger','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'la queue en brie','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ormesson sur marne','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'arcueil','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'marolles en brie','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villecresnes','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le perreux sur marne','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'valenton','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'nogent sur marne','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'cachan','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint maur des fosses','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'rungis','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'thiais','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'sucy en brie','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vincennes','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'charenton le pont','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint maurice','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bry sur marne','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bonneuil sur marne','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'joinville le pont','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ablon sur seine','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'gentilly','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villejuif','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vitry sur seine','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chevilly larue','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'chennevieres sur marne','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'champigny sur marne','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ivry sur seine','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'maisons alfort','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'orly','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villeneuve le roi','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villeneuve saint georges','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'creteil','ville_departement' => '94','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'osny','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'cergy','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ezanville','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'jouy le moutier','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'magny en vexin','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'domont','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montmorency','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'pontoise','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'vaureal','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'marly la ville','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'groslay','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'menucourt','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'herblay','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ermont','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'auvers sur oise','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint brice sous foret','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'goussainville','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'pierrelaye','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'franconville','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'louvres','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'gonesse','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'deuil la barre','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bezons','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'courdimanche','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint gratien','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'taverny','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bessancourt','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'beaumont sur oise','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'cormeilles en parisis','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'bouffemont','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'sannois','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ecouen','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint prix','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint leu la foret','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'saint ouen l aumone','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'persan','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'l isle adam','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'garges les gonesse','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montmagny','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'montigny les cormeilles','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'eaubonne','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'parmain','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'argenteuil','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'le plessis bouchard','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'villiers le bel','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'eragny','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'sarcelles','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'mery sur oise','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'soisy sous montmorency','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'beauchamp','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'enghien les bains','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'arnouville','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'fosses','ville_departement' => '95','name' => 'Île-de-France'),\r\n array('ville_nom_simple' => 'ajaccio','ville_departement' => '2A','name' => 'Corse'),\r\n array('ville_nom_simple' => 'porto vecchio','ville_departement' => '2A','name' => 'Corse'),\r\n array('ville_nom_simple' => 'corte','ville_departement' => '2B','name' => 'Corse'),\r\n array('ville_nom_simple' => 'bastia','ville_departement' => '2B','name' => 'Corse'),\r\n array('ville_nom_simple' => 'biguglia','ville_departement' => '2B','name' => 'Corse'),\r\n array('ville_nom_simple' => 'borgo','ville_departement' => '2B','name' => 'Corse'),\r\n array('ville_nom_simple' => 'calvi','ville_departement' => '2B','name' => 'Corse'),\r\n array('ville_nom_simple' => 'les abymes','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'baie mahault','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'baillif','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'basse terre','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'pigeon','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'capesterre belle eau','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'gourbeyre','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'grand bourg','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'le gosier','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'goyave','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'lamentin','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'morne a l eau','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'le moule','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'petit bourg','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'petit canal','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'pointe a pitre','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'pointe noire','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'port louis','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'st claude','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'st francois','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'ste anne','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'ste rose','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'trois rivieres','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'vieux habitants','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'le diamant','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'ducos','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'fort de france','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'le francois','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'gros morne','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'le lamentin','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'le lorrain','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'le marin','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'le morne rouge','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'riviere pilote','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'riviere salee','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'le robert','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'st esprit','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'st joseph','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'ste luce','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'ste marie','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'shoelcher','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'la trinite','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'les trois ilets','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'le vauclin','ville_departement' => '972','name' => 'Martinique'),\r\n array('ville_nom_simple' => 'cayenne','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'kourou','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'macouria tonate','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'mana','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'matoury','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'remire montjoly','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'st laurent du maroni','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'maripasoula','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'grand santi','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'apatou','ville_departement' => '973','name' => 'Guyane'),\r\n array('ville_nom_simple' => 'les avirons','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'bras panon','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'entre deux','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'l etang sale','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'petite ile','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'la plaine des palmistes','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'le port','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'la possession','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'st andre','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'st benoit','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'ste clotilde','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'st joseph','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'st leu','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'st louis','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'st paul','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'ravine des cabris','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'st philippe','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'ste marie','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'ste rose','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'ste suzanne','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'salazie','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'le tampon','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'les trois bassins','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'cilaos','ville_departement' => '974','name' => 'La Réunion'),\r\n array('ville_nom_simple' => 'bandraboua','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'bandrele','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'boueni','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'chiconi','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'chirongui','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'dembeni','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'dzaoudzi','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'koungou','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'mamoudzou','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'mtsamboro','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'm tsangamouji','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'ouangani','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'pamandzi','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'sada','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'tsingoni','ville_departement' => '976','name' => 'Mayotte'),\r\n array('ville_nom_simple' => 'st barthelemy','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'st martin','ville_departement' => '971','name' => 'Guadeloupe'),\r\n array('ville_nom_simple' => 'st pierre et miquelon','ville_departement' => '975','name' => 'Collectivités d\\'Outre-Mer')\r\n );\r\n\r\n\r\n foreach ($regions as $region_data) {\r\n\r\n $bool = false;\r\n $all_region = $manager->getRepository(Region::class)->findBy(['name' => $region_data['name']]);\r\n $departement = new Departement();\r\n $departement->setName($region_data['ville_departement']);\r\n foreach ($all_region as $a_region) {\r\n $departement->setRegion($a_region);\r\n $bool = true;\r\n }\r\n\r\n if (!$bool) {\r\n $region = new Region();\r\n $region->setName($region_data['name']);\r\n $departement->setRegion($region);\r\n }\r\n\r\n $manager->persist($departement);\r\n $manager->flush();\r\n }\r\n\r\n $method = 'GET';\r\n\r\n\r\n $url = 'https://api.ozae.com/gnw/articles?date=20180101__20190320&key=f287095e988e47c0804e92fd513b9843&edition=fr-fr&query=accident';\r\n $data = null;\r\n $curl = curl_init();\r\n\r\n switch ($method) {\r\n case \"POST\":\r\n curl_setopt($curl, CURLOPT_POST, 1);\r\n\r\n if ($data)\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\r\n break;\r\n\r\n case \"PUT\":\r\n curl_setopt($curl, CURLOPT_PUT, 1);\r\n break;\r\n default:\r\n if ($data)\r\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n }\r\n\r\n // Optional Authentication:\r\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\r\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\r\n\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n $result = curl_exec($curl);\r\n\r\n curl_close($curl);\r\n\r\n $result = json_decode($result);\r\n\r\n foreach ($result->articles as $key => $aResult) {\r\n $date = new \\DateTime('2017/1/1');\r\n $date_first_seen = new \\DateTime($aResult->date_first_seen);\r\n $date_last_seen = new \\DateTime($aResult->date_last_seen);\r\n $categories = array();\r\n\r\n $article = new Article();\r\n $html_content = $this->callAPI($aResult->id,'test');\r\n $tags = array(\r\n 'moto',\r\n 'motocyclisme',\r\n 'scooter',\r\n 'circulation',\r\n 'jeep',\r\n 'fourgon',\r\n 'conducteur',\r\n 'chauffeur',\r\n 'voiture',\r\n 'vélo',\r\n 'automobile',\r\n 'avion',\r\n 'véhicule',\r\n 'train',\r\n 'bicyclette',\r\n );\r\n foreach ($tags as $tag) {\r\n if (strpos($html_content, $tag) !== false) {\r\n array_push($categories, $tag);\r\n }\r\n }\r\n $gravite = array();\r\n if (count($categories) !== 0) {\r\n $tags = array(\r\n 'mort',\r\n 'décès',\r\n 'drame',\r\n 'tragédie',\r\n 'dramatique',\r\n 'tragique',\r\n 'trépas',\r\n 'tué',\r\n 'décédé',\r\n 'blessé',\r\n 'grave',\r\n 'sans conséquence',\r\n );\r\n foreach ($tags as $tag) {\r\n if (strpos($html_content, $tag) !== false) {\r\n array_push($gravite, $tag);\r\n }\r\n }\r\n\r\n $tags = array(\r\n 'soirée alcoolisée',\r\n 'minuit',\r\n 'stupéfiant',\r\n 'drogue',\r\n 'cannabis',\r\n );\r\n $causes = array();\r\n foreach ($tags as $tag) {\r\n if (strpos($html_content, 'négatif') === false) {\r\n if (strpos($html_content, $tag) !== false) {\r\n array_push($causes, $tag);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (count($categories) !== 0) {\r\n $article->setName($aResult->name);\r\n $article->setAuthor('John doe');\r\n $article->setArticleScore($aResult->article_score);\r\n $article->setContentHtml($html_content);\r\n $article->setDateFirstSeen($date_first_seen);\r\n $article->setDateLastSeen($date_last_seen);\r\n $article->setImgUri($aResult->img_uri);\r\n $article->setNewsonfire(true);\r\n $article->setShowInterval($date);\r\n $article->setSocialScore($aResult->social_score);\r\n $article->setUrl($aResult->url);\r\n $article->setSocialSpeedSph($aResult->social_speed_sph);\r\n $article->setCategories($categories);\r\n $article->setCauses($causes);\r\n $article->setGravite($gravite);\r\n $all_departement = $manager->getRepository(Departement::class)->findAll();\r\n $added_departement= array();\r\n foreach ($all_departement as $departement) {\r\n if ( (strpos($html_content, $departement->getName()) !== false) ) {\r\n if(!in_array($departement->getName(),$added_departement)) {\r\n array_push($added_departement, $departement->getName());\r\n $article->addDepartement($departement);\r\n $article->addRegion($departement->getRegion());\r\n }\r\n }\r\n }\r\n $manager->persist($article);\r\n }\r\n }\r\n\r\n $manager->flush();\r\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n // admin\n $admin = new User();\n $admin->setLogin('admin');\n $admin->setRoles(['ROLE_ADMIN']);\n $password = $this->encoder->encodePassword($admin, 'Admin_test');\n $admin->setPassword($password);\n $manager->persist($admin);\n $manager->flush();\n\n //utilisateur\n\n $user = new User();\n $user->setLogin('user');\n //$user = setRoles('ROLE_USER');\n $password = $this->encoder->encodePassword($user, 'User_test');\n $user->setPassword($password);\n $manager->persist($user);\n $manager->flush();\n\n // Faker\n\n // $faker = Faker\\Factory::create();\n // echo $faker->name;\n\n // pays\n\n if (($paysFile = fopen(__DIR__ . \"/../../data/ListeDePays.csv\", \"r\")) !== FALSE) {\n while (($data = fgetcsv($paysFile)) !== FALSE) {\n $pays = new Pays();\n $pays->setNom($data[0]);\n $manager->persist($pays);\n }\n\n fclose($paysFile);\n }\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n // $manager->persist($product);\n\n // Projet 1\n $projet = new Projets();\n $projet ->setNom(\"Cadexconseil\");\n $projet ->setLien(\"\");\n $projet ->setDescription(\"\");\n $manager->persist($projet);\n\n // Comppetences\n $skill = new Comppetences();\n $skill ->setNom(\"HTML\");\n $skill ->setType(\"langage\");\n $manager->persist($skill);\n \n\n $manager->flush();\n }", "public function load(ObjectManager $manager)\n {\n $book1 = new Book([\n 'isbn' => 9780132350884,\n 'title' => 'Clean Code: A Handbook of Agile Software Craftsmanship.',\n 'author' => 'Uncle Bob',\n 'description' => 'Clean Code is divided into three parts. The first describes the principles, patterns, and practices of writing clean code. The second part consists of several case studies of increasing complexity. Each case study is an exercise in cleaning up code—of transforming a code base that has some problems into one that is sound and efficient. The third part is the payoff: a single chapter containing a list of heuristics and “smells” gathered while creating the case studies. The result is a knowledge base that describes the way we think when we write, read, and clean code.',\n 'available' => false,\n ]);\n\n $book2 = new Book([\n 'isbn' => 9780135974445,\n 'title' => 'Agile Software Development: Principles, Patterns, and Practices.',\n 'author' => 'Uncle Bob',\n 'description' => 'Written by a software developer for software developers, this book is a unique collection of the latest software development methods. The author includes OOD, UML, Design Patterns, Agile and XP methods with a detailed description of a complete software design for reusable programs in C++ and Java. Using a practical, problem-solving approach, it shows how to develop an object-oriented application—from the early stages of analysis, through the low-level design and into the implementation. Walks readers through the designer\\'s thoughts — showing the errors, blind alleys, and creative insights that occur throughout the software design process. The book covers: Statics and Dynamics; Principles of Class Design; Complexity Management; Principles of Package Design; Analysis and Design; Patterns and Paradigm Crossings.',\n 'available' => true,\n ]);\n\n $manager->persist($book1);\n $manager->persist($book2);\n\n $this->addReference('book1', $book1);\n $this->addReference('book2', $book2);\n\n $manager->flush();\n }" ]
[ "0.7679375", "0.7595607", "0.7548666", "0.7404691", "0.7331613", "0.727661", "0.7206886", "0.7035208", "0.70090604", "0.6956272", "0.6910011", "0.68890536", "0.685312", "0.6845403", "0.68398637", "0.682337", "0.6822801", "0.6818304", "0.6747987", "0.6747564", "0.67143613", "0.67123795", "0.6684148", "0.66787875", "0.66677123", "0.66629595", "0.66574687", "0.6653655", "0.6649049", "0.6634128", "0.66336155", "0.6611043", "0.6605563", "0.65710425", "0.65689296", "0.65622145", "0.65565705", "0.6555641", "0.65435827", "0.65137714", "0.6482422", "0.64751345", "0.64714664", "0.64683795", "0.6414458", "0.6410557", "0.6410308", "0.63881487", "0.6383829", "0.6373849", "0.63583404", "0.6355334", "0.6335262", "0.631924", "0.6314224", "0.6305864", "0.6297401", "0.6295885", "0.6290285", "0.6285913", "0.6279371", "0.6269964", "0.62659186", "0.62651354", "0.6252448", "0.62489724", "0.6242643", "0.6235231", "0.6230493", "0.6227573", "0.62274635", "0.622109", "0.62180376", "0.62138045", "0.61973137", "0.61901796", "0.6187674", "0.6183077", "0.6175988", "0.61658645", "0.61562246", "0.6155219", "0.6151186", "0.614772", "0.61329985", "0.6120072", "0.6115829", "0.61120343", "0.61077833", "0.6102324", "0.61012983", "0.6099655", "0.6097389", "0.6089896", "0.6074458", "0.60740525", "0.60708576", "0.6067432", "0.60659003", "0.60632193" ]
0.6223916
71
Get the order of this fixture
public function getOrder() { return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrder() {\n // the lower the number, the sooner that this fixture is loaded\n return 3;\n }", "public function getOrder() {\n // the lower the number, the sooner that this fixture is loaded\n return 2;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 3;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 3;\n }", "public function getOrder()\n {\n return 1; //the order in which fixtures will be loaded\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 2;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 2;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 2;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 2;\n }", "public function getOrder()\n {\n return 10; // the order in which fixtures will be loaded\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 1;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 1;\n }", "public function getOrder() {\n // the lower the number, the sooner that this fixture is loaded\n return 4;\n }", "public function getOrder()\n {\n return 100; //the order in which fixtures will be loaded\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 10;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 7;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 5;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 15;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 25;\n }", "public function getOrder()\n {\n // the lower the number, the sooner that this fixture is loaded\n return 201;\n }", "public function getOrder() {\n return MaderaFixtures::ACCOUNTING_TVA;\n }", "public function order()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return static::ORDER;\n }", "public function getOrder()\n {\n return static::ORDER;\n }", "public function getOrder()\n {\n return static::ORDER;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder() {\n return 1;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "function getOrder()\n {\n return 3;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 0;\n }", "function getOrder()\n {\n return 0;\n }", "public function getOrder() {\n\n return 1;\n }", "function getOrder()\n {\n return 4;\n }", "function getOrder()\n {\n return 4;\n }", "public function getOrder()\n {\n //Note: order by parts are not \"named\" so it's all or nothing\n return $this->_get('_order');\n }", "public function getOrder()\n {\n return 4;\n }", "public function getOrder()\n {\n return 4;\n }", "public function getOrder()\n\t{\n\t\treturn $this->order;\n\t}", "public function Order()\n {\n return $this->order;\n }", "public function getOrder ()\r\n\t{\r\n\t\treturn $this->order;\r\n\t}", "public function getOrder() \n\t{\n\t\treturn $this->order;\n\t}", "public function getOrder()\n\t{\n\t\treturn $this->_order;\n\t}", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder()\n {\n return $this->_order;\n }", "public function getOrder()\n {\n return 4;\n // TODO: Implement getOrder() method.\n }", "public function getOrder()\n\t\t{\n\t\t\treturn $this->order;\n\t\t}", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }" ]
[ "0.86217266", "0.8601454", "0.85574025", "0.85574025", "0.85339797", "0.8531659", "0.8531659", "0.8531659", "0.8531659", "0.8521673", "0.85087395", "0.85087395", "0.84690696", "0.8452324", "0.8345033", "0.83282036", "0.8281141", "0.82403344", "0.8206898", "0.7914048", "0.7144192", "0.7084482", "0.6958377", "0.6958377", "0.6958377", "0.6926821", "0.6926821", "0.6926821", "0.6926821", "0.6926821", "0.6926821", "0.6926821", "0.6926821", "0.6926821", "0.68993825", "0.68872267", "0.68872267", "0.6882757", "0.6882652", "0.6882652", "0.6882652", "0.6882652", "0.68564755", "0.68564755", "0.68491215", "0.6837154", "0.6837154", "0.6808187", "0.6786166", "0.6786166", "0.6755435", "0.67518455", "0.6746367", "0.67420286", "0.67207223", "0.67094153", "0.67094153", "0.67094153", "0.67094153", "0.67094153", "0.67094153", "0.67068934", "0.67045206", "0.6700452", "0.66887414", "0.66887414", "0.66887414", "0.66887414", "0.66887414", "0.66887414", "0.66887414", "0.66887414", "0.66887414", "0.66887414", "0.66887414" ]
0.68704516
66
Constructor to set initial values
public function __construct($response, xfSymfonyBrowserRequest $request) { $this->response = $response; $this->request = $request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function init() {\n\t\t// use this method to initialize default values.\n\t}", "public function __construct() {\n\t\t$this->overrideDefaults( $this->loadDefaults() );\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "function SetInitialValues()\n\t{\n\t\t$this->id = -1;\n\t\t$this->title = '';\n\t\t$this->url = '';\n\t\t$this->user_id = -1;\n\t\t$this->timestamp = -1;\n\t}", "public function __construct() {\n // Adding values to the variabels\n $this->currentYear = date(\"Y\");\n $this->offsetYear = 0;\n $this->multiplier = 1;\n }", "public function __construct() {\r\n\t\t$this->_val = new \\tinyPHP\\Classes\\Core\\Val();\r\n\t}", "function __construct()\n {\n $this->setNumber(42);\n $this->setStatus(0);\n }", "public function __construct()\n {\n $this->set(array());\n }", "public function __construct()\n {\n $this->currency = NULL;\n $this->order = NULL;\n $this->customer = NULL;\n $this->fraudScreeningRequest = NULL;\n $this->statementDescriptor = NULL;\n $this->amount = 0;\n $this->amountOriginal = 0;\n $this->amountSurcharge = 0;\n }", "public function Initialize()\n\t\t{\n\t\t\t$this->intId = Person::IdDefault;\n\t\t\t$this->strFirstName = Person::FirstNameDefault;\n\t\t\t$this->strLastName = Person::LastNameDefault;\n\t\t}", "function __construct() {\n //added for code coverage.\n //$this->testValue = $testValue;\n }", "public function __construct() {\n\t\tforeach ($this as $key => $value) \n\t\t\t$this->$key = '';\n\t\t$this->log_date = $this->seller_PP_ProfileStartDate = $this->timestmp = '0000-00-00 00:00:00';\n\t\t$this->vendor_id = 0;\n\t}", "function __construct() {\n $this->always = array();\n $this->at = array();\n }", "function __construct() {\r\n\t\t$this->production_total = \"0\";\r\n\t\t$this->id_state = 1;\r\n\t}", "public function init()\n {\n $this->hoje = new DateTime('now');\n $this->diasBaseLine = $this->numdiasbaseline;\n $this->diasReal = $this->numdiasrealizados;\n }", "function __construct() {\n # Initialize Attributes\n $this->cur_val = 0;\n $this->cur_type = \"Integer\";\n $this->length = 0;\n $this->result = 0;\n $this->error_message = \"\";\n $this->error_log = array();\n $this->error_count = 0;\n }", "private function __construct() {\n\t\t$this->initialise();\n\t}", "public function __construct()\n {\n // Initialise values\n $this->_sheet = false;\n $this->_objects = false;\n $this->_scenarios = false;\n $this->_formatCells = false;\n $this->_formatColumns = false;\n $this->_formatRows = false;\n $this->_insertColumns = false;\n $this->_insertRows = false;\n $this->_insertHyperlinks = false;\n $this->_deleteColumns = false;\n $this->_deleteRows = false;\n $this->_selectLockedCells = false;\n $this->_sort = false;\n $this->_autoFilter = false;\n $this->_pivotTables = false;\n $this->_selectUnlockedCells = false;\n $this->_password = '';\n }", "public function __construct( ) {\n $this->setVotes1(0);\n $this->setVotes2(0);\n }", "protected function initialize()\n {\n $this->data = new stdClass();\n $this->data->ownId = null;\n $this->data->amount = new stdClass();\n $this->data->amount->currency = self::AMOUNT_CURRENCY;\n $this->data->amount->subtotals = new stdClass();\n $this->data->items = [];\n $this->data->receivers = [];\n }", "protected function init()\n {\n $this->totais = [\n 'liquidados' => 0,\n 'entradas' => 0,\n 'baixados' => 0,\n 'protestados' => 0,\n 'erros' => 0,\n 'alterados' => 0,\n ];\n }", "public function initialize()\n\t{\n\t\t$this->data = new stdClass();\n\t}", "public function __construct()\n {\n $this->assigns = new Assigns();\n $this->assigns->setStrict(false);\n $this->setDefaults();\n $this->init();\n }", "protected function init()\n {\n $this->totais = [\n 'liquidados' => 0,\n 'entradas' => 0,\n 'baixados' => 0,\n 'protestados' => 0,\n 'erros' => 0,\n 'alterados' => 0,\n ];\n }", "public function __construct() {\n\t\t$this\n\t\t\t->calculateMaxTargets()\n\t\t\t->generateMap()\n\t\t\t->populateMap();\n\t}", "function initialize()\n\t{\n\t\t$this->strType = strtoupper($this->dom->getAttribute(\"type\"));\n\t\t$this->strValues = $this->dom->getAttribute(\"values\");\n\t\t\n\t\t$this->prepare();\n\t}", "public function __construct() {\n\n\t\t$this->contenuto=array();\n\t\t$this->quantita=array();\n }", "function __construct(){\n\t\t\t$this->setId(0);\n\t\t\t$this->setFecha('');\t\n\t\t\t$this->setMotivo('');\n\t\t\t$this->setEstado(true);\n\t\t}", "protected function __construct()\n\t\t{\n\t\t\t$this->init();\n\t\t}", "protected function __construct()\n\t\t{\n\t\t\t$this->init();\n\t\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n {\n $this->getBiomes();\n $this->getHeights();\n $this->getRainfall();\n $this->getTemperature();\n $this->getHasRiver();\n }", "public function init()\n {\n if (!is_array($this->values)) {\n $this->values = [$this->values];\n }\n }", "public function __construct() {\r\n\t\t$this->user_id = null;\r\n\t\t$this->username = 'Anonymous';\r\n\t\t$this->avatar = ANONYMOUS_AVATAR;\r\n\t\t$this->date_joined = '2015-8-7';\r\n\t}", "function __construct() {\n\t \n\t \t\t$this->bi_config(); \t\t\t\n\t\t\t// setup all variables \n\t\t\t$this->Clear();\n\t}", "function __construct() \n\t\t{\n\t\t \n\t\t \t$this->bi_config(); \t\t\t\n\t\t\t// setup all variables \n\t\t\t$this->clear();\n\t\t\t\n\t\t}", "public function _construct(){\n\t\t$this->marque = 'Peugeot';\n\t\t$this->couleur = 'blanc';\n\t\t$this->vitesse = 50;\n\t}", "protected function constructor()\r\n\t{\r\n\t\t$this->finalYear = self::MAX_INT;\r\n\t\t$this->finalMillis = self::MAX_DBL;\r\n\t\t$this->finalZone = null;\r\n\r\n\t\t$this->constructEmpty();\r\n\t}", "public function __construct()\n\t{\n\t\t$this->_age = 19;\n\t\t$this->_aSonBonnet = TRUE;\n\t\t$this->_couleurPreferee = 'rouge';\n\t\t$this->_gouts = [ 'musique', 'cinéma', 'curling' ];\n\t}", "function __construct()\n {\n $this->id = 0;\n $this->issuedDate = date('Y-m-d H:i:s');\n $this->returnDate = date('Y-m-d H:i:s');\n $this->fine = 0;\n $this->bookId = 0;\n $this->userId = 0;\n }", "public function __construct()\n\t\t{\n\t\t\t$this->today = date('Y-m-d');\n\n\t\t\t// Set a default start/run date to today. This can be\n\t\t\t// overridden using the setStartDate() method.\n\t\t\t$this->start_date = $this->today;\n\n\t\t\t// Some functions require an end_date. This is set to today\n\t\t\t// but can be overridden using the setEndDate() method.\n\t\t\t$this->end_date = $this->today;\n\t\t}", "public function __construct()\n {\n $this->setLockedSince(new \\DateTime(\"0000-00-00 00:00:00\"));\n $this->setCreated(new \\DateTime());\n $this->setModified(new \\DateTime());\n $this->setLastError(new \\DateTime(\"0000-00-00 00:00:00\"));\n $this->hasError = false;\n $this->isActive = true;\n $this->lastRunTime = 0;\n $this->notifyOnError = true;\n }", "public function _initialize()\n {\n \tparent::_initialize();\n $this->pz\t = D('mru_jfb');\n $this->dp\t = D('Miye_dianpu');\n $this->order = D('Miye_order');\n \n }", "public function initialize()\n {\n $this->data = new stdClass();\n }", "final private function __construct()\n {\n \t$this->init();\n }", "public function setDefaultValues() {\n $this->effective_date = \"1970-1-1\";\n $this->end_date = \"9999-12-31\";\n $this->pu_percentage = 100;\n }", "public function Initialize()\n\t\t{\n\t\t\t$this->intIdOrganization = Organization::IdOrganizationDefault;\n\t\t\t$this->strName = Organization::NameDefault;\n\t\t\t$this->strPhone = Organization::PhoneDefault;\n\t\t\t$this->strQrCode = Organization::QrCodeDefault;\n\t\t\t$this->strOrganizationImage = Organization::OrganizationImageDefault;\n\t\t\t$this->strLatitude = Organization::LatitudeDefault;\n\t\t\t$this->strLongitude = Organization::LongitudeDefault;\n\t\t\t$this->strCountry = Organization::CountryDefault;\n\t\t\t$this->strCity = Organization::CityDefault;\n\t\t\t$this->strAddress = Organization::AddressDefault;\n\t\t\t$this->intIdOrganizationType = Organization::IdOrganizationTypeDefault;\n\t\t\t$this->intIdOwner = Organization::IdOwnerDefault;\n\t\t}", "public function __construct() {\n\t\t\t$this->init();\n\t\t}", "public function __construct() {\n $this->_configPassword = $this->parseConfig(2);\n $this->_configClass = $this->parseConfig(5);\n $this->_time = time();\n\t}", "public function __construct()\n {\n // Setup internal data arrays\n self::internals();\n }", "public function __construct($data) {\n $this->setValues($data);\n }", "public function __construct() {\n $this->Init();\n $this->Unique();\n }", "public function __construct()\n\t{\n\t\t$this->incomeData = FieldMap::getFieldLabel(\"income_data\",\"\",1);\n\t\t$this->removeIncomeFlag = 0;\n\t}", "function __construct( ) {\n $this->initialize( );\n }", "public function __construct()\n {\n // Initialise values\n $this->lastModifiedBy = $this->creator;\n $this->created = time();\n $this->modified = time();\n }", "public function __construct() {\n\t\t\t$this->setLength(10);\n\t\t\t$this->setDigits(true);\n\t\t\t$this->setLowerAlpha(true);\n\t\t\t$this->setUpperAlpha(true);\n\t\t}", "public function __construct()\n {\n $this->repeatDays = array();\n $this->repeatExceptions = array();\n\n $this->repeatCount = 0;\n }", "public function __construct($initialData = array()) {\r\n\t\t\t$this->setData($initialData);\r\n\t\t}", "final private function __construct() {\n\t\t\t}", "public function __construct()\n {\n $this->itemsPerPage = 15;\n $this->currentPage = 1;\n $this->previousPage = 1;\n $this->nextPage = 1;\n $this->url = '';\n $this->totalPages = 1;\n $this->renderedItemsMax = 8;\n }", "function __construct($params = null) {\n // Do the setting override or initial settings.\n //\n if ($params != null) {\n foreach ($params as $name => $sl_value) {\n $this->$name = $sl_value;\n }\n }\n }", "protected function __construct() {\n\t\tglobal $conf, $DB;\n\t\tself::$_conf = $conf;\n\t\tself::$_DB = $DB;\n\t}", "public function init(){}", "public function init(){}", "public function __construct()\n {\n $this->purchaseOperation = '';\n $this->startDate = '';\n $this->stopDate = '';\n }", "public function __construct()\n {\n $this->setRequiredFields($this->_aDefaultRequiredFields);\n\n $aRequiredFields = oxRegistry::getConfig()->getConfigParam('aMustFillFields');\n if (is_array($aRequiredFields)) {\n $this->setRequiredFields($aRequiredFields);\n }\n }" ]
[ "0.8028759", "0.8028759", "0.8028759", "0.8028759", "0.8028759", "0.7926206", "0.7926206", "0.7926206", "0.7926206", "0.7926206", "0.7926206", "0.7926206", "0.7926206", "0.7926206", "0.7926206", "0.7914584", "0.76346827", "0.75881857", "0.75881857", "0.75881857", "0.75881857", "0.75881857", "0.75881857", "0.75881857", "0.75881857", "0.75881857", "0.75824225", "0.7401536", "0.73485905", "0.7347245", "0.73387706", "0.7321973", "0.7253983", "0.7208192", "0.7180157", "0.7126882", "0.71058184", "0.7102389", "0.70850575", "0.70812905", "0.70728683", "0.70631945", "0.70567214", "0.7050808", "0.70444053", "0.702676", "0.69825065", "0.6950219", "0.6936543", "0.6935902", "0.69333035", "0.6930113", "0.6930113", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.6919321", "0.69013983", "0.6898105", "0.68962723", "0.689252", "0.68816805", "0.6881151", "0.68807304", "0.68795073", "0.687443", "0.6874275", "0.6867969", "0.68632084", "0.68571633", "0.6855261", "0.6838388", "0.68337154", "0.6829448", "0.6826935", "0.6825962", "0.6822172", "0.6819831", "0.6816812", "0.6813566", "0.6812003", "0.6805639", "0.6793242", "0.6791326", "0.67843616", "0.6778938", "0.6774226", "0.67731065", "0.676858", "0.676858", "0.67684543", "0.67649734" ]
0.0
-1
Switch zoom level (gmaptile users the old 170 levels instead of 017) TODO: fix this in gmaptile.php
function _simplegeo_tileservice_get_nodes($x, $y, $zoom, $lang, $layer, $type) { $zoom = 21 - $zoom; $top_left = _simplegeo_tileservice_tile2coord($x, $y, $zoom); $bottom_right = _simplegeo_tileservice_tile2coord($x+1, $y+1, $zoom); $nodes = array(); // Use views as query builder if a view is specified. if (module_exists('views') && $layer->conf['view'] && $view = views_get_view($layer->conf['view'])) { // Sanity check; make sure the user added the bounding_box argument to the view. // TODO: Add support for other displays than "default"?. $argument_setting = $view->display['default']->display_options['arguments']; if (is_array($argument_setting)) { $first_argument_setting = current($argument_setting); if ($first_argument_setting['id'] == 'bounding_box') { // Create the string expected by the bounding box argument. $box = $top_left['lat'] . ',' . $top_left['long'] . ',' . $bottom_right['lat'] . ',' . $bottom_right['long']; $view->set_arguments(array($box)); $view->execute(); foreach ($view->result as $node) { $point = explode(' ', simple_geo_clean_wkt('point', $node->simple_geo_point)); $nodes[] = array('lat' => (float)$point[0], 'lon' => (float)$point[1], 'count' => 1, 'nid' => (int)$node->nid); } } } } // Build our own query based on layer settings. else { $sql = "SELECT n.nid, AsText(ps.position) AS simple_geo_point FROM {node} n INNER JOIN {simple_geo_position} ps ON n.nid = ps.nid AND ps.type = 'node' "; // Define the WHERE part of the query. We first define some defaults. $wheres = array( 'n.status <> 0', "Contains(Envelope(GeomFromText('LineString(%s %s,%s %s)')), ps.position)", "n.language = '%s'", ); if (!empty($layer->conf['node_type'])) { $wheres[] = "n.type = '%s'"; } // If max age is defined check so the node isn't older than the specified age. if (!empty($layer->conf['max_age'])) { $wheres[] = 'n.created >= ' . strtotime('-' . $layer->conf['max_age']); } // If update since is defined check so the node has been updated since the specified time. if (!empty($layer->conf['updated_since'])) { $wheres[] = 'n.changed >= ' . strtotime('-' . $layer->conf['updated_since']); } // Add the WHEREs to the query. $sql .= ' WHERE ' . implode(' AND ', $wheres); $sql .= " ORDER BY n.created"; $params = array($top_left['lat'], $top_left['long'], $bottom_right['lat'], $bottom_right['long'], $lang); if (isset($layer->conf['node_type'])) { $params[] = $layer->conf['node_type']; } $res = db_query(db_rewrite_sql($sql), $params); while ($node = db_fetch_object($res)) { $point = explode(' ', simple_geo_clean_wkt('point', $node->simple_geo_point)); $nodes[] = array('lat' => (float)$point[0], 'lon' => (float)$point[1], 'count' => 1, 'nid' => (int)$node->nid); } } return $nodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setZoom($value) {\n\t}", "public function zoom() {\n\t}", "public function setZoom($nom){\n\t\t$zoom = (int) $zoom;\n\t\t// On vérifie ensuite si ce nombre est bien strictement positif.\n\t\tif ($zoom > 0){\n\t\t\t// Si c'est le cas, c'est tout bon, on assigne la valeur à l'attribut correspondant.\n\t\t\t$this->_zoom = $zoom;\n\t\t}\n\t}", "public function setZoomPrint($value) {\n\t}", "public function setZoom($zoom) \n {\n $this->zoom = $zoom;\n }", "function amap_ma_get_map_zoom() {\n $mapzoom = trim(elgg_get_plugin_setting('map_default_zoom', AMAP_MA_PLUGIN_ID));\n if (!is_numeric($mapzoom))\n $mapzoom = AMAP_MA_CUSTOM_DEFAULT_ZOOM;\n if ($mapzoom < 1)\n $mapzoom = AMAP_MA_CUSTOM_DEFAULT_ZOOM;\n if ($mapzoom > 20)\n $mapzoom = AMAP_MA_CUSTOM_DEFAULT_ZOOM;\n\n return $mapzoom;\n}", "public function getActZoomPic()\n {\n return 1;\n }", "public function setZoom($value) {\n $this->settings['zoom'] = $value;\n // Return for chaining\n return $this;\n }", "function wpsl_valid_zoom_level( $zoom_level ) {\n\n $zoom_level = absint( $zoom_level );\n\n if ( ( $zoom_level < 1 ) || ( $zoom_level > 21 ) ) {\n $zoom_level = wpsl_get_default_setting( 'zoom_level' );\n }\n\n return $zoom_level;\n}", "public function setZoomControl()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof ZoomControl)) {\n $this->zoomControl = $args[0];\n $this->mapOptions['zoomControl'] = true;\n } elseif ((isset($args[0]) && is_string($args[0])) && (isset($args[1]) && is_string($args[1]))) {\n if ($this->zoomControl === null) {\n $this->zoomControl = new ZoomControl();\n }\n\n $this->zoomControl->setControlPosition($args[0]);\n $this->zoomControl->setZoomControlStyle($args[1]);\n\n $this->mapOptions['zoomControl'] = true;\n } elseif (!isset($args[0])) {\n $this->zoomControl = null;\n\n if (isset($this->mapOptions['zoomControl'])) {\n unset($this->mapOptions['zoomControl']);\n }\n } else {\n throw MapException::invalidZoomControl();\n }\n }", "public function setMaxZoom($zoom) {\n $this->maxZoom = $zoom;\n }", "public function withZoomFactor(ZoomFactor $zoom);", "private function writeZoom(): void\n {\n // If scale is 100 we don't need to write a record\n if ($this->phpSheet->getSheetView()->getZoomScale() == 100) {\n return;\n }\n\n $record = 0x00A0; // Record identifier\n $length = 0x0004; // Bytes to follow\n\n $header = pack('vv', $record, $length);\n $data = pack('vv', $this->phpSheet->getSheetView()->getZoomScale(), 100);\n $this->append($header . $data);\n }", "public function withoutZoomFactor();", "public function zoomPrint() {\n\t}", "public function SetZoomFactor($aZoom)\n\t{\n\t\t$this->iZoomFactor = $aZoom;\n\t}", "function setLevel($level);", "public function setZoomArea($zoomArea) {\n\t\t$this -> setProperty('chtm', $zoomArea);\n\t}", "private function buildZoom() {\n return '&zoom=' . $this->mappingOptions->zoom;\n }", "public function setInfoWindowZoom($infoWindowZoom) \n {\n $this->infoWindowZoom = $infoWindowZoom;\n }", "function SetDisplayMode($zoom,$layout='continuous'){\n\t\t\tif($zoom=='fullpage' or $zoom=='fullwidth' or $zoom=='real' or $zoom=='default' or !is_string($zoom))\n\t\t\t\t$this->ZoomMode=$zoom;\n\t\t\telse\n\t\t\t\t$this->Error('Incorrect zoom display mode: '.$zoom);\n\t\t\tif($layout=='single' or $layout=='continuous' or $layout=='two' or $layout=='default')\n\t\t\t\t$this->LayoutMode=$layout;\n\t\t\telse\n\t\t\t\t$this->Error('Incorrect layout display mode: '.$layout);\n\t\t}", "public function setImageZoom($imageZoom) {\n\t\t$this->imageZoom = $imageZoom;\n\t}", "public function testZoomOut()\n {\n parent::setUpPage();\n\n $this->webDriver->findElement(WebDriverBy::linkText('Preview'))->click();\n $default_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $link = $this->webDriver->findElements(WebDriverBy::className('toolsZoomOut'))[0];\n $link->click();\n parent::waitOnMap();\n $new_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $this->assertNotEquals($default_img, $new_img);\n $this->assertContains(MAPPR_MAPS_URL, $new_img);\n }", "public function scale() { }", "public function getImageZoom() {\n\t\treturn $this->imageZoom;\n\t}", "public function __construct($numLevels = 18, $zoomFactor = 2, $verySmall = 0.00001, $forceEndpoints = true)\n\t{\n\t\t$this->numLevels = $numLevels;\n\t\t$this->zoomFactor = $zoomFactor;\n\t\t$this->verySmall = $verySmall;\n\t\t$this->forceEndpoints = $forceEndpoints;\n\n\t\tfor ($i = 0; $i < $this->numLevels; $i++)\n\t\t{\n\t\t\t$this->zoomLevelBreaks[$i] = $this->verySmall * pow($this->zoomFactor, $this->numLevels - $i - 1);\n\t\t}\n\t}", "public function setScaleControl()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof ScaleControl)) {\n $this->scaleControl = $args[0];\n $this->mapOptions['scaleControl'] = true;\n } elseif ((isset($args[0]) && is_string($args[0])) && (isset($args[1]) && is_string($args[1]))) {\n if ($this->scaleControl === null) {\n $this->scaleControl = new ScaleControl();\n }\n\n $this->scaleControl->setControlPosition($args[0]);\n $this->scaleControl->setScaleControlStyle($args[1]);\n\n $this->mapOptions['scaleControl'] = true;\n } elseif (!isset($args[0])) {\n $this->scaleControl = null;\n\n if (isset($this->mapOptions['scaleControl'])) {\n unset($this->mapOptions['scaleControl']);\n }\n } else {\n throw MapException::invalidScaleControl();\n }\n }", "public function getCloudZoomMode()\n {\n return \\XLite\\Core\\Config::getInstance()->Layout->cloud_zoom_mode ?: \\XLite\\View\\FormField\\Select\\CloudZoomMode::MODE_INSIDE;\n }", "public static function getZoom()\n {\n $element = new Lib_Form_Element_Location_Zoom();\n return $element;\n }", "public static function getZoom()\n {\n $element = new Lib_Form_Element_Location_Zoom();\n return $element;\n }", "function getXTile( $lat, $lon, $zoom ) {\n return floor((($lon + 180) / 360) * pow(2, $zoom));\n}", "function wpsl_get_max_zoom_levels() {\n\n $max_zoom_levels = array();\n $zoom_level = array(\n 'min' => 10,\n 'max' => 21\n );\n\n $i = $zoom_level['min'];\n\n while ( $i <= $zoom_level['max'] ) {\n $max_zoom_levels[$i] = $i;\n $i++;\n }\n\n return $max_zoom_levels;\n}", "public function getZoomControl()\n {\n return $this->zoomControl;\n }", "function scale($scale) {\r\n\t\t$width = $this->getWidth() * $scale/100;\r\n\t\t$height = $this->getheight() * $scale/100;\r\n\t\t$this->resize($width,$height);\r\n\t}", "public function getZoomOptions()\n {\n return ArrayLib::valuekey(range(1, 20));\n }", "public function zoomin($source, $dest, Array $option)\n {\n $image_obj = $this->_getInstance('montage');\n $source = $this->_getSource($source);\n return $image_obj->zoomin($source, $dest, $option);\n }", "public function testZoomControlStyles()\n {\n $this->assertEquals(ZoomControlStyle::getZoomControlStyles(), array(\n ZoomControlStyle::DEFAULT_,\n ZoomControlStyle::LARGE,\n ZoomControlStyle::SMALL\n ));\n }", "public function Zoom($c) {\r\n parent::ZoomScroll($c);\r\n }", "private function _setMapSize()\n {\n $this->map_obj->setSize($this->image_size[0], $this->image_size[1]);\n if ($this->_isResize()) {\n $this->map_obj->setSize($this->_download_factor*$this->image_size[0], $this->_download_factor*$this->image_size[1]);\n }\n }", "public function alejarCamaraPresidencia() {\n\n self::$presidencia->alejarZoom();\n\n }", "public function setLevel($level);", "function setMode($mode){\n\t\t//Switches the operating mode of\n\t\t//'ScaleTool'.\n\n\t\tif($mode == 'fit' || $mode == 'fill')\n\t\t\t$this->mode = $mode;\n\t}", "public function setEnableWindowZoom($enableWindowZoom) \n {\n $this->enableWindowZoom = $enableWindowZoom;\n }", "public static function imaggaScale()\n {\n return new CropMode(CropMode::IMAGGA_SCALE);\n }", "function setInitialZoom($initial_zoom) {\n if (!(intval($initial_zoom) > 0))\n throw new Error(create_invalid_value_message($initial_zoom, \"initial_zoom\", \"html-to-pdf\", \"Must be a positive integer number.\", \"set_initial_zoom\"), 470);\n \n $this->fields['initial_zoom'] = $initial_zoom;\n return $this;\n }", "public function showZoomPics()\n {\n $aPicGallery = $this->getPictureGallery();\n\n return $aPicGallery['ZoomPic'];\n }", "public function getEffectiveZoom() {\n return $this->effectiveZoom;\n }", "public function testGetTimelineZoomWithLocalSettings()\n {\n\n // Set system default.\n set_option('timeline_zoom', 25);\n\n // Create exhibit.\n $exhibit = $this->_createNeatline();\n $exhibit->default_timeline_zoom = 3;\n\n // Test for system default.\n $this->assertEquals(\n $exhibit->getTimelineZoom(),\n 3\n );\n\n }", "public function setScale($newScale)\n {\n $this->domain->setScale($newScale);\n }", "private function _setPan()\n {\n if (isset($this->pan) && $this->pan) {\n switch ($this->pan) {\n case 'up':\n $x_offset = 1;\n $y_offset = 0.9;\n break;\n\n case 'right':\n $x_offset = 1.1;\n $y_offset = 1;\n break;\n\n case 'down':\n $x_offset = 1;\n $y_offset = 1.1;\n break;\n\n case 'left':\n $x_offset = 0.9;\n $y_offset = 1;\n break;\n }\n\n $new_point = ms_newPointObj();\n $new_point->setXY($this->map_obj->width/2*$x_offset, $this->map_obj->height/2*$y_offset);\n $this->map_obj->zoompoint(1, $new_point, $this->map_obj->width, $this->map_obj->height, $this->map_obj->extent);\n }\n }", "function setMiles($new_miles)\n {\n $this->miles = $new_miles;\n }", "public function isZoomable()\n {\n return $this->zoomable;\n }", "public function zoomAction(Request $request,$slug) {\n \n \n $repid = 'CoreAdminBundle:adminlistedesregles';\n $rep2 = $this->getDoctrine()->getRepository($repid);\n $dernierAcces2 = $rep2->findBy(Array('id'=>\"=\".$slug));\n $dernierAcces2 = $rep2->find($slug);\n \n $regle = $this->extraireRegles($dernierAcces2);\n \n \n if (is_null($regle) ) {\n $regle = Array(0=>Array('nom'=>\"AUCUNE REGLE CORRESPOND A ID \".\"=\".$slug.\" Dans \".$repid,'status'=>\"LISTE VIDE\",'incluscrit'=>\"\",'inclusregle'=>\"\",'id'=>\"\"));\n }\n else {\n if (array_key_exists(0, $regle)) {\n \n }\n else {\n $regle = Array(0=>Array('nom'=>\"AUCUNE REGLE CORRESPOND A ID \".\"=\".$slug.\" Dans \".$repid,'status'=>\"LISTE VIDE\",'incluscrit'=>\"\",'inclusregle'=>\"\",'id'=>\"\"));\n \n }\n \n }\n // $irmsecurity a été injecté à l'instanciation de la class\n $auth = $this->irmsecurity->getIRMSecurityStatus();\n \n $auth = $auth.$this->irmsecurity->getCapabilities(1,\"YAML\");\n return $this->render('CoreAdminBundle:Default:zoom.html.twig', array('auth' => $auth,'id' => $slug,'rq'=>$request->getBaseUrl(),'regles'=>$regle));\n \n }", "function setInitialZoomType($initial_zoom_type) {\n if (!preg_match(\"/(?i)^(fit-width|fit-height|fit-page)$/\", $initial_zoom_type))\n throw new Error(create_invalid_value_message($initial_zoom_type, \"initial_zoom_type\", \"html-to-pdf\", \"Allowed values are fit-width, fit-height, fit-page.\", \"set_initial_zoom_type\"), 470);\n \n $this->fields['initial_zoom_type'] = $initial_zoom_type;\n return $this;\n }", "public function setLevel($level) \n {\n $level = abs(filter_var($level, FILTER_SANITIZE_NUMBER_INT));\n if($level < 1 || $level > 12)\n {\n throw new Exception('Level must be between 1, 12');\n } else {\n $this->level = $level;\n }\n }", "static function the_multimarker_map( $map_id = 'map-canvas', $zoom = 13 ) {\n\t\t// variables.\n\t\t$key = get_field( 'google_maps_key', 'option' );\n\t\t$maps = get_field( 'map-repeater' ); // Notice field ID MUST BE map-repeater.\n\t\t$mapmarker = get_field( 'map-marker', 'option' ) ? get_field( 'map-marker', 'option' ) : '';\n\t\t$lang = is_rtl() ? 'iw' : '';\n\n\t\t// enqueue.\n\t\twp_enqueue_script( 'googlemaps', \"https://maps.googleapis.com/maps/api/js?key={$key}&language={$lang}\", '', '', true );\n\t\t?>\n\n\t\t<script type=\"text/javascript\">\n\t\t\tvar maps = <?php echo wp_json_encode( $maps ); ?>\n\t\t</script>\n\n\t\t<div class=\"entry-map\">\n\t\t\t<div id=\"<?php echo esc_attr( $map_id ); ?>\" class=\"map-canvas\" data-zoom=\"<?php echo esc_attr( $zoom ); ?>\" data-mapmarker=\"<?php echo esc_attr( $mapmarker ); ?>\"></div>\n\t\t</div>\n\n\t\t<?php\n\t}", "public function set_level($value) {\n\t\tif (is_anint($value)) {\n\t\t\t$this->init_from_type_and_level($this->type, $value);\n\t\t}\n\t}", "function xmldb_zoom_upgrade($oldversion) {\n global $DB;\n\n $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes.\n $table = new xmldb_table('zoom');\n\n if ($oldversion < 2015071000) {\n // Add updated_at.\n $field = new xmldb_field('updated_at', XMLDB_TYPE_CHAR, '20', null, null, null, null, 'created_at');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Add ended_at.\n $field = new xmldb_field('ended_at', XMLDB_TYPE_CHAR, '20', null, null, null, null, 'updated_at');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2015071000, 'zoom');\n }\n\n if ($oldversion < 2015071500) {\n // Rename option_no_video_host to option_host_video; change default to 1; invert values.\n $field = new xmldb_field('option_no_video_host', XMLDB_TYPE_INTEGER, '1', null, null, null,\n '1', 'option_start_type');\n // Invert option_no_video_host.\n $DB->set_field('UPDATE {zoom} SET option_no_video_host = 1 - option_no_video_host');\n $dbman->change_field_default($table, $field);\n $dbman->rename_field($table, $field, 'option_host_video');\n\n // Rename option_no_video_participants to option_participants_video; change default to 1; invert values.\n $field = new xmldb_field('option_no_video_participants', XMLDB_TYPE_INTEGER, '1', null, null, null,\n '1', 'option_host_video');\n // Invert option_no_video_participants.\n $DB->set_field('UPDATE {zoom} SET option_no_video_participants = 1 - option_no_video_participants');\n $dbman->change_field_default($table, $field);\n $dbman->rename_field($table, $field, 'option_participants_video');\n\n // Change start_time to int (timestamp).\n $field = new xmldb_field('start_time', XMLDB_TYPE_INTEGER, '12', null, null, null, null, 'name');\n $starttimes = $DB->get_recordset('zoom');\n foreach ($starttimes as $time) {\n $time->start_time = strtotime($time->start_time);\n $DB->update_record('zoom', $time);\n }\n $starttimes->close();\n $dbman->change_field_type($table, $field);\n\n // Change precision/length of duration to 6 digits.\n $field = new xmldb_field('duration', XMLDB_TYPE_INTEGER, '6', null, null, null, null, 'type');\n $dbman->change_field_precision($table, $field);\n $DB->set_field('UPDATE {zoom} SET duration = duration*60');\n\n upgrade_mod_savepoint(true, 2015071500, 'zoom');\n }\n\n if ($oldversion < 2015071600) {\n // Add intro.\n $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, null, null, null, null, null, 'course');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Add introformat.\n $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', null, null, null, null, 'intro');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2015071600, 'zoom');\n }\n\n if ($oldversion < 2015072000) {\n // Drop updated_at.\n $field = new xmldb_field('updated_at');\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n\n // Drop ended_at.\n $field = new xmldb_field('ended_at');\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n\n // Add timemodified.\n $field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '12', null, null, null, null, 'start_time');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Add grade.\n $field = new xmldb_field('grade', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'introformat');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2015072000, 'zoom');\n }\n\n if ($oldversion < 2016040100) {\n // Add webinar.\n $field = new xmldb_field('webinar', XMLDB_TYPE_INTEGER, '1', null, null, null, '0', 'type');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Change type to recurring.\n $field = new xmldb_field('type', XMLDB_TYPE_INTEGER, '1', null, null, null, '0', 'timemodified');\n $dbman->change_field_notnull($table, $field);\n $dbman->change_field_default($table, $field);\n // Meeting is recurring if type is 3.\n $DB->set_field_select('zoom', 'type', 0, 'type <> 3');\n $DB->set_field('zoom', 'type', 1, array('type' => 3));\n $dbman->rename_field($table, $field, 'recurring');\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2016040100, 'zoom');\n }\n\n if ($oldversion < 2018091200) {\n // Removed apiurl option from settings.\n set_config('apiurl', null, 'mod_zoom');\n\n // Set the starting number of API calls.\n set_config('calls_left', 2000, 'mod_zoom');\n\n // Set the time at which to start looking for meeting reports.\n set_config('last_call_made_at', time() - (60 * 60 * 12), 'mod_zoom');\n\n // Start zoom table modifications.\n $table = new xmldb_table('zoom');\n\n // Define field status to be dropped from zoom.\n $field = new xmldb_field('status');\n\n // Conditionally launch drop field status.\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n\n // Define field exists_on_zoom to be added to zoom.\n $field = new xmldb_field('exists_on_zoom', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1', 'option_audio');\n\n // Conditionally launch add field exists_on_zoom.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define field uuid to be dropped from zoom.\n $field = new xmldb_field('uuid');\n\n // Conditionally launch drop field uuid.\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n\n // Define table zoom_meeting_details to be created.\n $table = new xmldb_table('zoom_meeting_details');\n\n // Adding fields to table zoom_meeting_details.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('uuid', XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null);\n $table->add_field('meeting_id', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null);\n $table->add_field('end_time', XMLDB_TYPE_INTEGER, '12', null, XMLDB_NOTNULL, null, null);\n $table->add_field('duration', XMLDB_TYPE_INTEGER, '12', null, XMLDB_NOTNULL, null, null);\n $table->add_field('start_time', XMLDB_TYPE_INTEGER, '12', null, null, null, null);\n $table->add_field('topic', XMLDB_TYPE_CHAR, '300', null, XMLDB_NOTNULL, null, null);\n $table->add_field('total_minutes', XMLDB_TYPE_INTEGER, '12', null, null, null, '0');\n $table->add_field('participants_count', XMLDB_TYPE_INTEGER, '4', null, null, null, '0');\n $table->add_field('zoomid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n\n // Adding keys to table zoom_meeting_details.\n $table->add_key('uuid_unique', XMLDB_KEY_UNIQUE, array('uuid'));\n $table->add_key('id_primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('zoomid_foreign', XMLDB_KEY_FOREIGN, array('zoomid'), 'zoom', array('id'));\n $table->add_key('meeting_unique', XMLDB_KEY_UNIQUE, array('meeting_id', 'uuid'));\n\n // Conditionally launch create table for zoom_meeting_details.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n // Define table zoom_meeting_participants to be created.\n $table = new xmldb_table('zoom_meeting_participants');\n\n // Adding fields to table zoom_meeting_participants.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('zoomuserid', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null);\n $table->add_field('uuid', XMLDB_TYPE_CHAR, '30', null, null, null, null);\n $table->add_field('user_email', XMLDB_TYPE_TEXT, null, null, null, null, null);\n $table->add_field('join_time', XMLDB_TYPE_INTEGER, '12', null, XMLDB_NOTNULL, null, null);\n $table->add_field('leave_time', XMLDB_TYPE_INTEGER, '12', null, XMLDB_NOTNULL, null, null);\n $table->add_field('duration', XMLDB_TYPE_INTEGER, '12', null, XMLDB_NOTNULL, null, null);\n $table->add_field('attentiveness_score', XMLDB_TYPE_CHAR, '7', null, XMLDB_NOTNULL, null, null);\n $table->add_field('userid', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);\n $table->add_field('detailsid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'name');\n\n // Adding keys to table zoom_meeting_participants.\n $table->add_key('id_primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('user_by_meeting_key', XMLDB_KEY_UNIQUE, array('detailsid', 'zoomuserid'));\n $table->add_key('detailsid_foreign', XMLDB_KEY_FOREIGN, array('detailsid'), 'zoom_meeting_details', array('id'));\n\n // Adding indexes to table zoom_meeting_participants.\n $table->add_index('userid', XMLDB_INDEX_NOTUNIQUE, array('userid'));\n\n // Conditionally launch create table for zoom_meeting_participants.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n upgrade_mod_savepoint(true, 2018091200, 'zoom');\n }\n\n if ($oldversion < 2018091400) {\n // Define field alternative_hosts to be added to zoom.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('alternative_hosts', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'exists_on_zoom');\n\n // Conditionally launch add field alternative_hosts.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2018091400, 'zoom');\n }\n\n if ($oldversion < 2018092201) {\n\n // Changing type of field userid on table zoom_meeting_participants to int.\n $table = new xmldb_table('zoom_meeting_participants');\n\n $index = new xmldb_index('userid', XMLDB_INDEX_NOTUNIQUE, ['userid']);\n\n // Conditionally launch drop index userid.\n if ($dbman->index_exists($table, $index)) {\n $dbman->drop_index($table, $index);\n }\n\n $field = new xmldb_field('userid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'id');\n\n // Launch change of type for field userid.\n $dbman->change_field_type($table, $field);\n\n $index = new xmldb_index('userid', XMLDB_INDEX_NOTUNIQUE, ['userid']);\n\n // Conditionally launch add index userid.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2018092201, 'zoom');\n }\n\n if ($oldversion < 2019061800) {\n // Make sure start_time is not null to match install.xml.\n $table = new xmldb_table('zoom_meeting_details');\n $field = new xmldb_field('start_time', XMLDB_TYPE_INTEGER, '12', null, XMLDB_NOTNULL, null, null);\n if ($dbman->field_exists($table, $field)) {\n $dbman->change_field_notnull($table, $field);\n }\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2019061800, 'zoom');\n }\n\n if ($oldversion < 2019091200) {\n // Change field alternative_hosts from type char(255) to text.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('alternative_hosts', XMLDB_TYPE_TEXT, null, null, null, null, null, 'exists_on_zoom');\n $dbman->change_field_type($table, $field);\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2019091200, 'zoom');\n }\n\n if ($oldversion < 2020042600) {\n // Change field zoom_meeting_participants from type int(11) to char(35),\n // because sometimes zoomuserid is concatenated with a timestamp.\n // See https://devforum.zoom.us/t/meeting-participant-user-id-value/7886/2.\n $table = new xmldb_table('zoom_meeting_participants');\n\n // First drop key, not needed anymore.\n $key = new xmldb_key('user_by_meeting_key', XMLDB_KEY_UNIQUE,\n ['detailsid', 'zoomuserid']);\n $dbman->drop_key($table, $key);\n\n // Change of type for field zoomuserid to char(35).\n $field = new xmldb_field('zoomuserid', XMLDB_TYPE_CHAR,\n '35', null, XMLDB_NOTNULL,\n null, null, 'userid');\n $dbman->change_field_type($table, $field);\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2020042600, 'zoom');\n }\n\n if ($oldversion < 2020042700) {\n // Define field attentiveness_score to be dropped from zoom_meeting_participants.\n $table = new xmldb_table('zoom_meeting_participants');\n $field = new xmldb_field('attentiveness_score');\n\n // Conditionally launch drop field attentiveness_score.\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2020042700, 'zoom');\n }\n\n if ($oldversion < 2020051800) {\n // Define field option_mute_upon_entry to be added to zoom.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_mute_upon_entry', XMLDB_TYPE_INTEGER, '1', null, null, null, '1', 'option_audio');\n\n // Conditionally launch add field option_mute_upon_entry.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define field option_waiting_room to be added to zoom.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_waiting_room', XMLDB_TYPE_INTEGER, '1', null, null, null, '1', 'option_mute_upon_entry');\n\n // Conditionally launch add field option_waiting_room.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define field authenticated_users to be added to zoom.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_authenticated_users', XMLDB_TYPE_INTEGER,\n '1', null, null, null, '0', 'option_waiting_room');\n\n // Conditionally launch add field authenticated_users.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Changing the default of field option_host_video on table zoom to 0.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_host_video', XMLDB_TYPE_INTEGER, '1', null, null, null, '0', 'option_start_type');\n\n // Launch change of default for field option_host_video.\n $dbman->change_field_default($table, $field);\n\n // Changing the default of field option_participants_video on table zoom to 0.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_participants_video', XMLDB_TYPE_INTEGER, '1', null, null, null, '0', 'option_host_video');\n\n // Launch change of default for field option_participants_video.\n $dbman->change_field_default($table, $field);\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2020051800, 'zoom');\n }\n\n if ($oldversion < 2020052100) {\n // Increase meeting_id since Zoom increased the size from 10 to 11.\n\n // First need to drop index.\n $table = new xmldb_table('zoom');\n $index = new xmldb_index('meeting_id_idx', XMLDB_INDEX_NOTUNIQUE, ['meeting_id']);\n if ($dbman->index_exists($table, $index)) {\n $dbman->drop_index($table, $index);\n }\n\n // Increase size to 15 for future proofing.\n $field = new xmldb_field('meeting_id', XMLDB_TYPE_INTEGER, '15', null, XMLDB_NOTNULL, null, null, 'grade');\n $dbman->change_field_precision($table, $field);\n\n // Add index back.\n $dbman->add_index($table, $index);\n\n // First need to drop key.\n $table = new xmldb_table('zoom_meeting_details');\n $key = new xmldb_key('meeting_unique', XMLDB_KEY_UNIQUE, ['meeting_id', 'uuid']);\n $dbman->drop_key($table, $key);\n\n // Increase size to 15 for future proofing.\n $field = new xmldb_field('meeting_id', XMLDB_TYPE_INTEGER, '15', null, XMLDB_NOTNULL, null, null, 'uuid');\n $dbman->change_field_precision($table, $field);\n\n // Add key back.\n $dbman->add_key($table, $key);\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2020052100, 'zoom');\n }\n\n if ($oldversion < 2020100800) {\n // Changing the default of field option_host_video on table zoom to 0.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_host_video', XMLDB_TYPE_INTEGER, '1', null, null, null, '0', 'option_start_type');\n\n // Launch change of default for field option_host_video.\n $dbman->change_field_default($table, $field);\n\n // Changing the default of field option_participants_video on table zoom to 0.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_participants_video', XMLDB_TYPE_INTEGER, '1', null, null, null, '0', 'option_host_video');\n\n // Launch change of default for field option_participants_video.\n $dbman->change_field_default($table, $field);\n\n // Changing the default of field option_mute_upon_entry on table zoom to 1.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_mute_upon_entry', XMLDB_TYPE_INTEGER, '1', null, null, null, '1', 'option_audio');\n\n // Launch change of default for field option_participants_video.\n $dbman->change_field_default($table, $field);\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2020100800, 'zoom');\n }\n\n if ($oldversion < 2020120800) {\n // Delete config no longer used.\n set_config('calls_left', null, 'mod_zoom');\n upgrade_mod_savepoint(true, 2020120800, 'zoom');\n }\n\n if ($oldversion < 2021012902) {\n // Define field option_encryption_type to be added to zoom.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_encryption_type', XMLDB_TYPE_CHAR, '20', null, null, null, 'enhanced_encryption',\n 'option_authenticated_users');\n\n // Conditionally launch add field option_encryption_type.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2021012902, 'zoom');\n }\n\n if ($oldversion < 2021012903) {\n // Quite all settings in settings.php had the 'mod_zoom' prefix while it should have had a 'zoom' prefix.\n // After the prefix has been modified in settings.php, the existing settings in DB have to be modified as well.\n\n // Get the existing settings with the old prefix from the DB,\n // but don't get the 'version' setting as this one has to have the 'mod_zoom' prefix.\n $oldsettingsql = 'SELECT name\n FROM {config_plugins}\n WHERE plugin = :plugin AND name != :name';\n $oldsettingparams = array('plugin' => 'mod_zoom', 'name' => 'version');\n $oldsettingkeys = $DB->get_fieldset_sql($oldsettingsql, $oldsettingparams);\n\n // Change the prefix of each setting.\n foreach ($oldsettingkeys as $oldsettingkey) {\n // Get the value of the existing setting with the old prefix.\n $oldsettingvalue = get_config('mod_zoom', $oldsettingkey);\n // Set the value of the setting with the new prefix.\n set_config($oldsettingkey, $oldsettingvalue, 'zoom');\n // Drop the setting with the old prefix.\n set_config($oldsettingkey, null, 'mod_zoom');\n }\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2021012903, 'zoom');\n }\n\n if ($oldversion < 2021030300) {\n // Define index uuid (not unique) to be added to zoom_meeting_participants.\n $table = new xmldb_table('zoom_meeting_participants');\n $index = new xmldb_index('uuid', XMLDB_INDEX_NOTUNIQUE, ['uuid']);\n\n // Conditionally launch add index uuid.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2021030300, 'zoom');\n }\n\n if ($oldversion < 2021081900) {\n $table = new xmldb_table('zoom');\n\n // Define and conditionally add field recurrence_type.\n $field = new xmldb_field('recurrence_type', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'recurring');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define and conditionally add field repeat_interval.\n $field = new xmldb_field('repeat_interval', XMLDB_TYPE_INTEGER, '2', null, null, null, null, 'recurrence_type');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define and conditionally add field weekly_days.\n $field = new xmldb_field('weekly_days', XMLDB_TYPE_CHAR, '14', null, null, null, null, 'repeat_interval');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define and conditionally add field monthly_day.\n $field = new xmldb_field('monthly_day', XMLDB_TYPE_INTEGER, '2', null, null, null, null, 'weekly_days');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define and conditionally add field monthly_week.\n $field = new xmldb_field('monthly_week', XMLDB_TYPE_INTEGER, '2', null, null, null, null, 'monthly_day');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define and conditionally add field monthly_week_day.\n $field = new xmldb_field('monthly_week_day', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'monthly_week');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define and conditionally add field monthly_repeat_option.\n $field = new xmldb_field('monthly_repeat_option', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'monthly_week_day');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define and conditionally add field end_times.\n $field = new xmldb_field('end_times', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'monthly_week_day');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define and conditionally add field end_date_time.\n $field = new xmldb_field('end_date_time', XMLDB_TYPE_INTEGER, '12', null, null, null, null, 'end_times');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define and conditionally add field end_date_option.\n $field = new xmldb_field('end_date_option', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'end_date_time');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // For a time these defaults were not being updated but needed to be. This should catch them up.\n\n // Changing the default of field option_host_video on table zoom to 0.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_host_video', XMLDB_TYPE_INTEGER, '1', null, null, null, '0', 'option_start_type');\n\n // Launch change of default for field option_host_video.\n $dbman->change_field_default($table, $field);\n\n // Changing the default of field option_participants_video on table zoom to 0.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_participants_video', XMLDB_TYPE_INTEGER, '1', null, null, null, '0', 'option_host_video');\n\n // Launch change of default for field option_participants_video.\n $dbman->change_field_default($table, $field);\n\n // Changing the default of field option_mute_upon_entry on table zoom to 1.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('option_mute_upon_entry', XMLDB_TYPE_INTEGER, '1', null, null, null, '1', 'option_audio');\n\n // Launch change of default for field option_participants_video.\n $dbman->change_field_default($table, $field);\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2021081900, 'zoom');\n }\n\n if ($oldversion < 2021111100) {\n // Define table zoom_meeting_tracking_fields to be created.\n $table = new xmldb_table('zoom_meeting_tracking_fields');\n\n // Adding fields to table zoom_meeting_tracking_fields.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('meeting_id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n $table->add_field('tracking_field', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);\n $table->add_field('value', XMLDB_TYPE_TEXT, null, null, null, null, null);\n\n // Adding keys to table zoom_meeting_tracking_fields.\n $table->add_key('id_primary', XMLDB_KEY_PRIMARY, array('id'));\n\n // Adding indexes to table zoom_meeting_tracking_fields.\n $table->add_index('meeting_id', XMLDB_INDEX_NOTUNIQUE, array('meeting_id'));\n $table->add_index('tracking_field', XMLDB_INDEX_NOTUNIQUE, array('tracking_field'));\n\n // Conditionally launch create table for zoom_meeting_tracking_fields.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2021111100, 'zoom');\n }\n\n if ($oldversion < 2021111800) {\n // Define table zoom_meeting_recordings to be created.\n $table = new xmldb_table('zoom_meeting_recordings');\n\n // Adding fields to table zoom_meeting_recordings.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('zoomid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n $table->add_field('meetinguuid', XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null);\n $table->add_field('zoomrecordingid', XMLDB_TYPE_CHAR, '36', null, XMLDB_NOTNULL, null, null);\n $table->add_field('name', XMLDB_TYPE_CHAR, '300', null, XMLDB_NOTNULL, null, null);\n $table->add_field('externalurl', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null);\n $table->add_field('passcode', XMLDB_TYPE_CHAR, '30', null, null, null, null);\n $table->add_field('recordingtype', XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null);\n $table->add_field('recordingstart', XMLDB_TYPE_INTEGER, '12', null, XMLDB_NOTNULL, null, null);\n $table->add_field('showrecording', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '12', null, null, null, null);\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '12', null, null, null, null);\n\n // Adding keys to table zoom_meeting_recordings.\n $table->add_key('id_primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('zoomid_foreign', XMLDB_KEY_FOREIGN, array('zoomid'), 'zoom', array('id'));\n\n // Conditionally launch create table for zoom_meeting_recordings.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n // Define table zoom_meeting_recordings_view to be created.\n $table = new xmldb_table('zoom_meeting_recordings_view');\n\n // Adding fields to table zoom_meeting_recordings_view.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('recordingsid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n $table->add_field('viewed', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '12', null, null, null, null);\n\n // Adding keys to table zoom_meeting_recordings_view.\n $table->add_key('id_primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('recordingsid_foreign', XMLDB_KEY_FOREIGN, array('recordingsid'), 'zoom_meeting_recordings', array('id'));\n\n // Adding indexes to table zoom_meeting_recordings_view.\n $table->add_index('userid', XMLDB_INDEX_NOTUNIQUE, array('userid'));\n\n // Conditionally launch create table for zoom_meeting_recordings_view.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n // Add new field for recordings_visible_default.\n $table = new xmldb_table('zoom');\n // Define field recordings_visible_default to be added to zoom.\n $field = new xmldb_field('recordings_visible_default', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1',\n 'alternative_hosts');\n\n // Conditionally launch add field recordings_visible_default.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2021111800, 'zoom');\n }\n\n if ($oldversion < 2021112900) {\n // Define table zoom_meeting_details to be created.\n $table = new xmldb_table('zoom_meeting_details');\n // Conditionally launch add key uuid_unique.\n if (!$table->getKey('uuid_unique')) {\n $key = new xmldb_key('uuid_unique', XMLDB_KEY_UNIQUE, ['uuid']);\n $dbman->add_key($table, $key);\n }\n\n // Launch drop key meeting_unique.\n $key = new xmldb_key('meeting_unique', XMLDB_KEY_UNIQUE, ['meeting_id', 'uuid']);\n $dbman->drop_key($table, $key);\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2021112900, 'zoom');\n }\n\n if ($oldversion < 2022022400) {\n\n // Change the recordings_visible_default field in the zoom table.\n $table = new xmldb_table('zoom');\n $field = new xmldb_field('recordings_visible_default', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1',\n 'alternative_hosts');\n $dbman->change_field_default($table, $field);\n\n // Change the showrecording field in the zoom table.\n $table = new xmldb_table('zoom_meeting_recordings');\n $field = new xmldb_field('showrecording', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0');\n $dbman->change_field_default($table, $field);\n\n // Zoom savepoint reached.\n upgrade_mod_savepoint(true, 2022022400, 'zoom');\n }\n\n return true;\n}", "function resize_scale($scale){\n\n $width = $this->get_width() * $scale / 100;\n $height = $this->get_height() * $scale / 100;\n $this->resize($width, $height);\n\n return true;\n }", "public function zoomRect($r) {\r\n $this->x0 = $r->getLeft();\r\n $this->y0 = $r->getTop();\r\n $this->x1 = $r->getRight();\r\n $this->y1 = $r->getBottom();\r\n $this->calcZoomPoints();\r\n }", "function remove_image_zoom_support() {\n remove_theme_support( 'wc-product-gallery-zoom' );\n }", "public function setScaling($scaling = 100) {}", "public function addScalebar()\n {\n $this->map_obj->scalebar->set(\"style\", 0);\n $this->map_obj->scalebar->set(\"intervals\", 3);\n $this->map_obj->scalebar->set(\"height\", ($this->_isResize() && $this->_download_factor > 1) ? $this->_download_factor*4 : 8);\n $this->map_obj->scalebar->set(\"width\", ($this->_isResize() && $this->_download_factor > 1) ? $this->_download_factor*100 : 200);\n $this->map_obj->scalebar->color->setRGB(30, 30, 30);\n $this->map_obj->scalebar->outlinecolor->setRGB(0, 0, 0);\n $this->map_obj->scalebar->set(\"units\", 4); // 1 feet, 2 miles, 3 meter, 4 km\n $this->map_obj->scalebar->label->set(\"font\", \"arial\");\n $this->map_obj->scalebar->label->set(\"encoding\", \"UTF-8\");\n $this->map_obj->scalebar->label->set(\"size\", ($this->_isResize() && $this->_download_factor > 1) ? $this->_download_factor*5 : 8);\n $this->map_obj->scalebar->label->color->setRGB(0, 0, 0);\n\n //svg format cannot do scalebar in MapServer\n if ($this->download && $this->options['scalebar'] && $this->output != 'svg') {\n $this->map_obj->scalebar->set(\"status\", MS_EMBED);\n $this->map_obj->scalebar->set(\"position\", MS_LR);\n $this->map_obj->drawScalebar();\n }\n if (!$this->download) {\n $this->map_obj->scalebar->set(\"status\", MS_DEFAULT);\n $this->scale = $this->map_obj->drawScalebar();\n $this->scalebar_url = $this->scale->saveWebImage();\n }\n }", "public function setNoZoomFlag($noZoom = true) {}", "public function setCloudZoomMode($mode)\n {\n $mode = in_array($mode, $this->getAllowedCloudZoomModes()) ? $mode : \\XLite\\View\\FormField\\Select\\CloudZoomMode::MODE_INSIDE;\n\n \\XLite\\Core\\Database::getRepo('XLite\\Model\\Config')->createOption(\n array(\n 'category' => 'Layout',\n 'name' => 'cloud_zoom_mode',\n 'value' => $mode,\n )\n );\n\n return $this;\n }", "public function getCloudZoomEnabled()\n {\n return (boolean)\\XLite\\Core\\Config::getInstance()->Layout->cloud_zoom;\n }", "protected function scaleImages() {}", "public function scale($scale = 1) {\n\t\tif(stristr($scale, '%') !== false) {\n\t\t\t$scale = (float) preg_replace('/[^0-9\\.]/', '', $scale);\n\t\t\t$scale = $scale/100;\n\t\t}\n\t\t$scale = (float) $scale;\n\t\t$new_width = ceil($this->width * $scale);\n\t\t$new_height = ceil($this->height * $scale);\n\n\t\t$working_image = imagecreatetruecolor($new_width, $new_height);\n\n\t\tif(imagecopyresampled($working_image, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height)) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = $new_width;\n\t\t\t$this->height = $new_height;\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Resize failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "function setLevel($level) {\n\t\tif (is_string($level)) {\n\t\t\tswitch (strtolower($level)) {\n\t\t\t\tcase \"debug\":\n\t\t\t\t\t$level = MC_LOGGER_DEBUG;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"info\":\n\t\t\t\t\t$level = MC_LOGGER_INFO;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"warn\":\n\t\t\t\tcase \"warning\":\n\t\t\t\t\t$level = MC_LOGGER_WARN;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"error\":\n\t\t\t\t\t$level = MC_LOGGER_ERROR;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"fatal\":\n\t\t\t\t\t$level = MC_LOGGER_FATAL;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$level = MC_LOGGER_FATAL;\n\t\t\t}\n\t\t}\n\n\t\t$this->_level = $level;\n\t}", "public static function run($dataDir=null)\n {\n $pres = new Presentation();\n\n # Setting View Properties of Presentation\n #pres.getViewProperties().getSlideViewProperties().setScale(50) # zoom value in percentages for slide view\n $pres->getViewProperties()->getNotesViewProperties()->setScale(50); # .Scale = 50; //zoom value in percentages for notes view\n\n # Save the presentation as a PPTX file\n $save_format = new SaveFormat();\n $pres->save($dataDir . \"Zoom.pptx\", $save_format->Pptx);\n\n print \"Set zoom value, please check the output file.\";\n }", "private function setLevel()\n\t{\n\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bin_level` WHERE 1\");\n\t\tif ($level_count > 1) // binary level\n\t\t{\n\t\t\t$this->levelType = 1;\n\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bin_level` WHERE 1\");\n\t\t}else{\n\t\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bin_serial_type` WHERE 1\");\n\t\t\tif ($level_count > 1)\n\t\t\t{\n\t\t\t\t$this->levelType = 2;\n\t\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bin_serial_type` WHERE 1\");\n\t\t\t}else{\n\t\t\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bbc_user_group` WHERE `is_admin`=0\");\n\t\t\t\tif ($level_count > 2) // user group level\n\t\t\t\t{\n\t\t\t\t\t$this->levelType = 3;\n\t\t\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bbc_user_group` WHERE `is_admin`=0\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function zoomOnMarkers($margin = 0, $default_zoom = 14)\n\t{\n\t\t$this->options['zoom'] = $this->getMarkersFittingZoom($margin, $default_zoom);\n\t}", "function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }", "function setIssueLevel( $sessionID, $issueID, $level ){\r\n\t \tif($this->userCanSetIssueLevel( $sessionID, $issueID )){\r\n\t \t\t$userID = $_SESSION[ 'userid' ];\r\n\t\t\t$this->sendIssueAlerts($issueID, 'Issue level changed.');\r\n\t\t\t$query=\"UPDATE issues SET Modifier='$userID', Level='$level' WHERE ID='$issueID'\";\r\n\t\t\t$result=mysql_query($query);\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t}", "public function getCloudZoomSettings()\n {\n $modulName = Mage::app()->getRequest()->getModuleName();\n $store = Mage::app()->getStore();\n if ($modulName == 'quickview') {\n $pageType = '_quickview';\n } else {\n $pageType = '';\n }\n\n $settings = array(\n 'zoomWidth' => (int)Mage::getStoreConfig('quickview/cloudzoom/zoom_width' . $pageType, $store),\n 'zoomHeight' => (int)Mage::getStoreConfig('quickview/cloudzoom/zoom_height' . $pageType, $store),\n 'position' => Mage::getStoreConfig('quickview/cloudzoom/position' . $pageType, $store),\n 'adjustX' => (int)Mage::getStoreConfig('quickview/cloudzoom/adjust_x' . $pageType, $store),\n 'adjustY' => (int)Mage::getStoreConfig('quickview/cloudzoom/adjust_y' . $pageType, $store),\n 'tint' => Mage::getStoreConfig('quickview/cloudzoom/tint', $store),\n 'softFocus' => (int)Mage::getStoreConfig('quickview/cloudzoom/soft_focus', $store),\n 'smoothMove' => (int)Mage::getStoreConfig('quickview/cloudzoom/smooth_move', $store),\n 'showTitle' => (int)Mage::getStoreConfig('quickview/cloudzoom/show_title', $store),\n 'tintOpacity' => (float)str_replace(',', '.', Mage::getStoreConfig('quickview/cloudzoom/tint_opacity', $store)),\n 'lensOpacity' => (float)str_replace(',', '.', Mage::getStoreConfig('quickview/cloudzoom/lens_opacity', $store)),\n 'titleOpacity' => (float)str_replace(',', '.', Mage::getStoreConfig('quickview/cloudzoom/title_opacity', $store))\n );\n if (!$settings['position']) {\n $settings['position'] = Mage::getStoreConfig('quickview/cloudzoom' . $pageType . '/position_element', $store);\n }\n\n $settings = $this->checkDefaultCloudZoomSettings($settings);\n return $settings;\n }", "public function setLevel($level) {\n $this->level = $level;\n }", "public function setLevel(int $level) {\n\n $this->level = $level;\n\n }", "public function setScale(int $scale)\n\t{\n\t\t$this->scale = $scale;\n\t\t\n\t\treturn $this;\n\t}", "public function loadLevel() {\n\t\tswitch(true){\n\t\t\tcase ($this->data['level_pts'] >= 5000):\n\t\t\t\t$level = floor($this->data['level_pts'] / 1000) + 7;\n\t\t\t\tbreak;\n\t\t\tcase ($this->data['level_pts'] >= 1000):\n\t\t\t\t$level = floor($this->data['level_pts'] / 500) + 2;\n\t\t\t\tbreak;\n\t\t\tcase ($this->data['level_pts'] >= 600):\n\t\t\t\t$level = 3;\n\t\t\t\tbreak;\n\t\t\tcase ($this->data['level_pts'] >= 300):\n\t\t\t\t$level = 2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$level = 1;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $level;\n\t}", "function scaleByFactor($size)\r\n {\r\n $new_x = round($size * $this->img_x, 0);\r\n $new_y = round($size * $this->img_y, 0);\r\n return $this->_resize($new_x, $new_y);\r\n }", "public function setScale($var)\n {\n GPBUtil::checkDouble($var);\n $this->scale = $var;\n\n return $this;\n }", "public function scale($s_)\n\t{\n\t\t$this->setX( $this->x*$s_ );\n\t\t$this->setY( $this->y*$s_ );\n\t}", "public function set_level($level = \"INFO\") {\n if(Validator::isa($level,\"string\") \n && ($k=array_search($level,$this->order))!==false) \n $this->level = $this->order[$k];\n else \n $this->level = \"INFO\";\n }", "function levelPengguna($kira, $data, $level)\n\t{\n\t\tif ($level == 'user')\n\t\t\theader('location:' . URL . 'homeuser');\n\t\telseif($level == 'admin')\n\t\t\theader('location:' . URL . 'homeadmin');\n\t\telseif($level == 'admin2')\n\t\t\theader('location:' . URL . 'homeadmin2');\n\t\telse\n\t\t\theader('location:' . URL . ''); //*/\n\t}", "public function setMag($mag_)\n\t{\n\t\t$s = $mag_ / $this->mag();\n\t\t$this->scale($s);\n\t}", "public function SetLevel($level)\n {\n $this->level = $level;\n }", "public function getZoomPics()\n {\n $aPicGallery = $this->getPictureGallery();\n\n return $aPicGallery['ZoomPics'];\n }", "public function changeDefaultMap() \n\t{\n \t\t$mapId = $_POST['mapId'];\n\t\t$gameId = $_SESSION['jogoid'];\n\n\t\t$this->model->removeDefaultMapByGame($gameId);\n\t\t$this->model->defineDefaultMap($mapId);\n\t}", "public function testLargerValueSet()\n {\n $this->grid100x100->setPoint(2, 2, 10);\n }", "public function alejarCamaraAlumnos1() {\n\n self::$alumnos1->alejarZoom();\n\n }", "public function setLandscape($value) {\n\t}", "public function setScale($var)\n {\n GPBUtil::checkInt32($var);\n $this->scale = $var;\n\n return $this;\n }", "public function getHoverZoomEffect(): ?bool;", "public function zoomPercent($percentZoom) {\r\n $percentZoom = ($percentZoom - 100.0) * 0.01;\r\n\r\n $left = $this->calcAxisScale($this->chart->getAxes()->getLeft(), $percentZoom);\r\n $right = $this->calcAxisScale($this->chart->getAxes()->getRight(), $percentZoom);\r\n $top = $this->calcAxisScale($this->chart->getAxes()->getTop(), $percentZoom);\r\n $bottom = $this->calcAxisScale($this->chart->getAxes()->getBottom(), $percentZoom);\r\n $this->chart->doZoom($top, $bottom, $left, $right);\r\n $this->invalidate();\r\n }", "public static function xTileToLng(int $id, int $position, int $zoom, int $tileSize): float\n {\n return ($id + $position / $tileSize) / \\pow(2, $zoom) * 360 - 180;\n }", "function setGutter($gutter) {\t \r\n\t $this->gutter = $gutter;\r\n\t}", "public function setZoomed($value) {\r\n $this->zoomed = $value;\r\n if (($this->chart->getParent() != null) && (!$this->zoomed)) {\r\n $this->chart->getParent()->doUnZoomed($this);\r\n }\r\n $this->invalidate();\r\n }", "public static function scale()\n {\n return new CropMode(CropMode::SCALE);\n }", "private function _scale()\n\t{\n\t\t//scale down the image by 55%\n\t\t$weaponImageSize = $this->weapon->getImageGeometry();\n\t\t$this->weaponScale['w'] = $weaponImageSize['width'] * 0.55;\n\t\t$this->weaponScale['h'] = $weaponImageSize['height'] * 0.55;\n\n\t\t$this->weapon->scaleImage($this->weaponScale['w'], $this->weaponScale['h']);\n\n\t\t//scale down the image by 30%\n\t\t$emblemImageSize = $this->emblem->getImageGeometry();\n\t\t$this->emblemScale['w'] = $emblemImageSize['width'] * 0.30;\n\t\t$this->emblemScale['h'] = $emblemImageSize['height'] * 0.30;\n\n\t\t$this->emblem->scaleImage($this->emblemScale['w'], $this->emblemScale['h']);\n\n\t\t//scale down the image by 70%\n\t\t$profileImageSize = $this->profile->getImageGeometry();\n\t\t$this->profileScale['w'] = $profileImageSize['width'] * 0.70;\n\t\t$this->profileScale['h'] = $profileImageSize['height'] * 0.70;\n\n\t\t$this->profile->scaleImage($this->profileScale['w'], $this->profileScale['h']);\n\t}", "function gmuj_mmi_add_sublevel_menu() {\n\tadd_submenu_page(\n\t\t'gmuw',\n\t\t'Mason Meta Information',\n\t\t'Mason Meta Information',\n\t\t'manage_options',\n\t\t'gmuj_mmi',\n\t\t'gmuj_mmi_display_settings_page',\n\t\t1\n\t);\n\t\n}", "public function updateMenLevelById($m_id) {\r\t\t$a_point = $this->user_model->getMemById($m_id)->aggregate_point;\r\t\t\r\t\tif ( 0 <= $a_point && $a_point <= 100)\r\t\t\t$level = 1;\r\t\telse if ( 100 < $a_point && $a_point <= 1000)\r\t\t\t$level = 2;\r\t\telse if ( 1000 < $a_point && $a_point <= 5000)\r\t\t\t$level = 3;\r\t\telse if ( 5000 < $a_point && $a_point <= 10000)\r\t\t\t$level = 4;\r\t\telse \r\t\t\t$level = 5;\r\t\t\t\r\t\t$this->db->where('m_id', $m_id);\r\t\t$this->db->update('member', array('level'=>$level));\r\t}" ]
[ "0.7464501", "0.6858716", "0.6742981", "0.6731587", "0.66959023", "0.6533208", "0.6500038", "0.6359873", "0.6333222", "0.6212704", "0.6197975", "0.6119751", "0.5978669", "0.5949558", "0.59443074", "0.5836194", "0.57371", "0.5683524", "0.56734014", "0.5658885", "0.5621032", "0.5614178", "0.55763155", "0.55435216", "0.5532465", "0.5441391", "0.5422966", "0.5368269", "0.5326936", "0.5326936", "0.5311433", "0.53052616", "0.5298846", "0.52977675", "0.52732414", "0.5255089", "0.523166", "0.51881975", "0.51642764", "0.51554364", "0.51552916", "0.5086983", "0.5077692", "0.50739974", "0.5046744", "0.504098", "0.5037417", "0.50307626", "0.50034153", "0.49785233", "0.49750784", "0.49701998", "0.4970071", "0.4968036", "0.49563137", "0.49485222", "0.49462008", "0.49374205", "0.49327078", "0.49145207", "0.49125662", "0.48999086", "0.48915106", "0.4885379", "0.4876729", "0.48757237", "0.48432958", "0.4842891", "0.48286006", "0.48244333", "0.48184443", "0.4813366", "0.48112828", "0.48103365", "0.4808956", "0.48085296", "0.48034984", "0.47966614", "0.4787737", "0.47820455", "0.47796482", "0.47752693", "0.4774469", "0.47630656", "0.47602555", "0.47354025", "0.472748", "0.4703128", "0.46928778", "0.46778035", "0.4660321", "0.46601483", "0.46579462", "0.4635116", "0.4627169", "0.46244845", "0.46090856", "0.46071523", "0.45875287", "0.4582518", "0.4573519" ]
0.0
-1
/ Create a connection to a database
function __construct() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createDatabaseConnection()\r\n\t{\r\n\t\t$this->dbConnectionPool = new \\Bitrix\\Main\\Db\\DbConnectionPool();\r\n\t}", "public function createConnection()\n {\n $client = DatabaseDriver::create($this->getConfig());\n\n return $client;\n }", "function createConection(){\n\n\t\tglobal $db_host;\n\t\tglobal $db_usr;\n\t\tglobal $db_pwd;\n\t\tglobal $db_name;\n\t\tglobal $db_port;\n\n\t\treturn pg_connect('user='.$db_usr.' password='.$db_pwd.' host= '.$db_host.' dbname = '.$db_name.' port = '.$db_port);\n\t}", "private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}", "protected static function createDbConnection() {\n if(isset(self::$_config['db']) &&\n isset(self::$_config['db']['host']) &&\n isset(self::$_config['db']['user']) &&\n isset(self::$_config['db']['password']) &&\n isset(self::$_config['db']['database'])) {\n $db = mysqli_connect(\n self::$_config['db']['host'],\n self::$_config['db']['user'],\n self::$_config['db']['password'],\n self::$_config['db']['database']\n );\n\n if(mysqli_connect_errno()) {\n static::error500('DB error.', 'DB error: ' . mysqli_connect_errno());\n }\n\n if(!mysqli_set_charset($db, 'utf8')) {\n static::error500('DB error.', 'DB error: ' . mysqli_error($db));\n }\n\n Model::setConnection($db);\n } else {\n static::error500('Database settings are missing from config.');\n }\n }", "public function connectToDB() {}", "public function createConnection($db)\n {\n $this->adodb = $db;\n }", "private function createConnection()\n {\n\n //Pull db credentials from a .ini file in the private folder.\n $config = parse_ini_file('db.ini');\n\n $username = $config['username'];\n $password = $config['password'];\n $hostName = $config['servername'];\n $dbName = $config['dbname'];\n $dsn = 'mysql:host=' . $hostName . ';dbname=' . $dbName . ';';\n\n\n try {\n\n //Create connection\n $this->db = new PDO($dsn, $username, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n\n $error_message = $e->getMessage();\n echo $error_message;\n }\n }", "function create_connection(){\n\t\t$this->dbconn =& new DBConn();\r\n\t\tif($this->dbconn == NULL)\r\n\t\t\tdie('Could not create connection object');\n\t}", "public function openConnection() {\n if($this->database != null) return;\n\n $config = $this->getDatabaseConfig();\n\n try {\n $this->database = new \\PDO(\n 'mysql:dbname=' . $config['database'] . ';host=' . $config['host'] . ':' . $config['port'],\n $config['username'],\n $config['password'],\n [\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n \\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_ASSOC\n ]\n );\n } catch(\\PDOException $exception) {\n die('Connection to mysql-server failed: ' . $exception->getMessage());\n }\n }", "private function connect()\n {\n if ($this->configuration->get('db.connector') == 'PDO') {\n $dsn = \"mysql:host=\" . $this->configuration->get('db.host') . \";dbname=\" . $this->configuration->get('db.name');\n $options = array();\n $this->db = new PDO(\n $dsn, $this->configuration->get('db.username'), $this->configuration->get('db.password'), $options\n );\n } elseif ($this->configuration->get('db.connector') == 'mysqli') {\n $this->db = mysqli_connect(\n $this->configuration->get('db.host'), $this->configuration->get('db.username'), $this->configuration->get('db.password'), $this->configuration->get('db.name')\n );\n }\n }", "public static function connect() {\n $databaseConfig = Config::getDatabase();\n $databaseClass = $databaseConfig['class'];\n $databaseFile = SRC.'lib/db/databases/'.$databaseClass.'.php';\n if (!file_exists($databaseFile)) {\n throw new SynopsyException(\"Database class file '$databaseFile' doesn't exist!\");\n }\n require_once($databaseFile);\n $c = \"\\Synopsy\\Db\\Databases\\\\$databaseClass\";\n self::$instance = new $c();\n if (!self::$instance instanceof DatabaseInterface) {\n throw new SynopsyException(\"Database class '$databaseClass' doesn't implement DatabaseInterface interface!\");\n }\t\n self::$instance->connect($databaseConfig);\n }", "public function conn(): DB\n {\n return new DB();\n }", "private function connecDb()\n {\n try{\n $dsn = \"{$this->db_type}:host={$this->db_host};port={$this->db_port};\";\n $dsn .= \"dbname={$this->db_name};charset={$this->db_charset}\";\n //echo \"$dsn, $this->db_user, $this->db_pass\";\n $this->pdo = new PDO($dsn,$this->db_user,$this->db_pass);\n }catch(PDOException $e){\n echo\"<h2>创建POD对象失败</h2>\";\n $this->ShowErrorMessage($e);\n die();\n }\n }", "private function databaseConnection()\n {\n // Les connexions sont établies en créant des instances de la classe de base de PDO\n $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);\n $this->db = new PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS, $options);\n }", "function create_db_connection($host, $user, $password, $dbname, $new_connection = FALSE, $persistency = FALSE)\n{\n\tglobal $phpraid_config;\n\t\n\t// If you are using PHP 4 and need to be instanciating objects by reference, uncomment the second \"$connection\" string below and\n\t// comment the first one.\n\t$connection = new sql_db($host , $user, $password, $dbname, $new_connection, $persistency);\t\t\n\t//$connection = &new sql_db($host, $user, $password, $dbname, $new_connection, $persistency);\t\t\n\t\n\treturn $connection;\n}", "public function connectToDatabase(){\n\t\t$dbinfo=$this->getDBinfo();\n\n\t\t$host=$dbinfo[\"host\"];\n\t\t$dbname=$dbinfo[\"dbname\"];\n\t\t$user=$dbinfo[\"user\"];\n\t\t\n $pass=$this->getPassword();//don't share!!\n\n try{\n $DBH = new PDO(\"mysql:host=$host;dbname=$dbname\", $user, $pass);\n $DBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n }catch(PDOException $e){\n $this->processException($e);\n }\n \n $this->setDBH($DBH);\n }", "private function dbConnect(){\n $database=new \\Database();\n return $database->getConnection();\n }", "protected function getConnection()\n\t{\n\t\treturn $this->createDefaultDBConnection(TEST_DB_PDO(), TEST_GET_DB_INFO()->ldb_name);\n\t}", "private function dbConnection() {\r\n //if (!is_resource($this->connessione))\r\n // $this->connessione = mysql_connect($this->db_server,$this->db_username,$this->db_pass) or die(\"Error connectin to the DBMS: \" . mysql_error());\r\n if (!is_resource($this->connessione)) {\r\n try {\r\n $this->connessione = new PDO($this->db_type . \":dbname=\" . $this->db_name . \";host=\" . $this->db_server, $this->db_username, $this->db_pass);\r\n //echo \"PDO connection object created\";\r\n $this->setupSQLStatement();\r\n } catch (PDOException $e) {\r\n echo $e->getMessage();\r\n die();\r\n }\r\n }\r\n }", "public function connectDB() {}", "protected function db_connect() {\n \n // Data source name\n $this->dsn = 'mysql:host=' . $this->db_host . ';dbname=' . $this->db_name . ';charset=' . $this->db_charset;\n\n // Makes a connection to the database\n $this->db_conn = new PDO( $this->dsn, $this->db_user, $this->db_password );\n\n // When fetching an SQL row it turn into an object\n $this->db_conn->setAttribute( PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ );\n // Gives the Error reporting atribute and throws exeptions\n $this->db_conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n \n // Returns the connection\n return $this->db_conn;\n\n }", "public function connect()\n {\n $config = $this->config;\n $config = array_merge($this->_baseConfig, $config);\n\n $conn = \"DATABASE='{$config['database']}';HOSTNAME='{$config['host']}';PORT={$config['port']};\";\n $conn .= \"PROTOCOL=TCPIP;UID={$config['username']};PWD={$config['password']};\";\n\n if (!$config['persistent']) {\n $this->connection = db2_connect($conn, PGSQL_CONNECT_FORCE_NEW);\n } else {\n $this->connection = db2_pconnect($conn);\n }\n $this->connected = false;\n\n if ($this->connection) {\n $this->connected = true;\n $this->query('SET search_path TO '.$config['schema']);\n }\n if (!empty($config['charset'])) {\n $this->setEncoding($config['charset']);\n }\n\n return $this->connection;\n }", "abstract public function OpenConnection( $user, $pass, $ip, $port, $db, $options );", "public function createClient(){\n $config = new DBALConfiguration();\n $this->dbConnection = DBALDriverManager::getConnection($this->config, $config);\n }", "function db_connect() {\n\t$database = new mysqli(DB_SERVER, DB_USER, DB_PASS, DB_NAME); //create the object $connection\n\tconfirm_db_connect($database);\n\n\t// this function returns the object $connection with the database\n\treturn $database; \n\t}", "function createConnection( ) {\n global $conn;\n // Create connection object\n $conn = new mysqli(SERVER_NAME, DBF_USER_NAME, DBF_PASSWORD);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n } \n }", "public function connect()\r\n\t{\r\n\t\t$options = array(\r\n\t\t\t'driver' => $this->_driver,\r\n\t\t\t'host' => $this->_host,\r\n\t\t\t'user' => $this->_username,\r\n\t\t\t'password' => $this->_password,\r\n\t\t\t'database' => $this->_database,\r\n\t\t\t'prefix' => $this->_prefix\r\n\t\t);\r\n\t\t\r\n\t\t$this->_instance = JFlappConnectorTypeDatabase::getInstance( $options );\r\n\t\r\n\t\treturn $this->_instance;\r\n\t}", "function connectToDatabase() {\n\n $host = self::servername;\n $databaseName = self::dbname;\n $password = self::password;\n $username = self::username;\n //To create the connection\n $conn = new mysqli($host, $username, $password, $databaseName);\n self::$conn = $conn;\n //Connection Checking, if there is a connection error, print the error\n if ($conn->connect_error) {\n exit(\"Failure\" . $conn->connect_error);\n }\n }", "protected function openConn() {\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "private function openDatabaseConnection()\n {\n\n // set the (optional) options of the PDO connection. in this case, we set the fetch mode to\n // \"objects\", which means all results will be objects, like this: $result->user_name !\n // For example, fetch mode FETCH_ASSOC would return results like this: $result[\"user_name] !\n // @see http://www.php.net/manual/en/pdostatement.fetch.php\n $options = array(\\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_OBJ, \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_WARNING);\n\n // generate a database connection, using the PDO connector\n // @see http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/\n $this->db = new \\PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=' . DB_CHARSET, DB_USER, DB_PASS, $options);\n }", "private function connect()\n {\n if (! is_null(self::$db)) {\n return;\n }\n\n // $this->host \t= $Database->host;\n // $this->user \t= $Database->user;\n // $this->pass \t= $Database->pass;\n // $this->database\t= $Database->database;\n\n $conn = 'mysql:dbname=' . $this->dbInfo->database . ';host=' . $this->dbInfo->host.';charset=utf8';\n try {\n self::$db = new PDO($conn, $this->dbInfo->user, $this->dbInfo->pass);\n } catch (PDOException $e) {\n die('Could not connect to database (' . $conn . ')');\n }\n }", "private function connectToDatabase()\n {\n return DbConnection::connectToDatabase($this->link);\n }", "public function getConnection(): \\codename\\core\\database\r\n {\r\n return $this->db;\r\n }", "private function connectDB()\n\t{\n\t\t$this->db = ECash::getMasterDb();\n\t\t\n\t//\t$this->dbconn = $this->db->getConnection();\n\t}", "public static function connect() {\n\t\tif(!self::$conn) {\n\t\t\tnew Database();\n\t\t}\n\t\treturn self::$conn;\n\t}", "private function connectToDB()\n {\n $this->handler = new DBConnect();\n $this->handler = $this->handler->startConnection();\n }", "function connect_to_db(){\n\t\t//Fun Fact: @ suppresses errors of the expression it prepends\n\t\t\n\t\t//Connect to the database and select the database\t\t\t\n\t\ttry{\n\t\t\t$this->connection = new PDO(\"mysql:host=$DATABASE_HOST;dbname=DATABASE_NAME\", DATABASE_USER, DATABASE_PASS);\n\t\t\t$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t}catch(PDOException $err){\n\t\t\tdie('Could not connect to database' . $err->getMessage());\n\t\t}\t\t\n\t}", "public function open_database_connection()\n {\n $server = 'blog';\n $dbname = 'blog';\n $username = 'root';\n $password = 'root';\n\n $link = new \\PDO(\"mysql:host=$server;dbname=$dbname\", $username, $password);\n\n return $link;\n }", "public static function createConnection()\n {\n self::$conn = new mysqli(self::$db_server,self::$db_username, \n \t\tself::$db_password, self::$db_name);\n if(mysqli_connect_errno())//error connecting\n {\n echo(\"error connecting\");\n return null;\n }\n return self::$conn;\n }", "protected function getConnection()\n {\n $host = DB_HOST;\n $dbName = DB_NAME;\n $dbUser = DB_USER;\n $dbPass = DB_PASS;\n // mysql\n $dsn = 'mysql:host=' . $host . ';dbName=' . $dbName;\n $db = new \\PDO($dsn, $dbUser, $dbPass);\n $connection = $this->createDefaultDBConnection($db, $dbName);\n return $connection;\n }", "function createConnect()\r\n\t\t{\r\n\t\t$this->conn=mysql_pconnect($this->host,$this->user,$this->password);\r\n\t\tif(!is_resource($this->conn))\r\n\t\t\t{\r\n\t\t\t$this->errors=\"Could Not able to connect to the SQL Server.\";\r\n\t\t\t}\r\n\t\t$d = mysql_select_db($this->dbname, $this->conn);\r\n\t\tif(!is_resource($d))\r\n\t\t\t{\r\n\t\t\t$this->errors=\"Could Not able to Use database \".$this->dbname.\".\";\r\n\t\t\t}\r\n\t\t}", "protected function openConn()\n {\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "public static function getConnection() {\n if (!self::$db) {\n //new connection object\n new dbConn();\n }\n //return connection\n return self::$db;\n }", "protected function getConnection()\n {\n return $this->createDefaultDBConnection($this->createPdo(), static::NAME);\n }", "protected function _initDbConnection() {\n\t\tif (!empty($this->db)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Create a new connection\n\t\tif (empty($this->config['datasource'])) {\n\t\t\tdie(\"FeedAggregatorPdoStorage: no datasource configured\\n\");\n\t\t}\n\n\t\t// Initialise a new database connection and associated schema.\n\t\t$db = new PDO($this->config['datasource']); \n\t\t$this->_initDbSchema();\n\t\t\n\t\t// Check the database tables exist\n\t\t$this->_initDbTables($db);\n\n\t\t// Database successful, make it ready to use\n\t\t$this->db = $db;\n\t}", "public function open_db_connection() {\n $this->connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n // cgecking if the connection has errors\n if($this->connection->connect_errno) {\n die(\"Database connection failed\" . $this->connection->connect_error);\n }\n }", "function establish_connection() {\n\t \t\tself::$db = Registry()->db = SqlFactory::factory(Config()->DSN);\n\t \t\tself::$has_update_blob = method_exists(self::$db, 'UpdateBlob');\n\t\t\treturn self::$db;\n\t\t}", "public static function makeConnection()\n {\n self::$connectionManager = new ConnectionManager();\n self::$connectionManager->addConnection([\n 'host' => self::$config['host'],\n 'user' => self::$config['user'],\n 'password' => self::$config['password'],\n 'dbname' => self::$config['dbname']\n ]);\n self::$connectionManager->bootModel();\n }", "public static function open_db_connection(){\r\n self::$connection = new mysqli(DB_SERVER, DB_USER, DB_PASS, DB_NAME);\r\n\t\t}", "private function connect() {\n $host = $this->dbConfig[$this->selected]['host'];\n $login = $this->dbConfig[$this->selected]['login'];\n $password = $this->dbConfig[$this->selected]['password'];\n $database = $this->dbConfig[$this->selected]['database'];\n try {\n $this->db = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=utf8', $login, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n//\t\t\t$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } catch (PDOException $e) {\n die('Could not connect to DB:' . $e);\n }\n }", "public function connect($db_properties);", "public function connect() {\n if ($this->link = mysql_connect($this->host, $this->user, $this->pass)) {\n if (!empty($this->name)) {\n if (!mysql_select_db($this->name)) {\n $this->exception(\"Could not connect to the database!\");\n }\n }\n } else {\n $this->exception(\"Could not create database connection!\");\n }\n }", "private function setupDatabase()\n {\n try {\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n\n } catch (PDOException $e) {\n\n if (false != strpos($e->getMessage(), 'Unknown database')) {\n $db = new PDO(sprintf('mysql:host=%s', $this->host), $this->userName, $this->password);\n $db->exec(\"CREATE DATABASE IF NOT EXISTS `$this->dbName` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;\") or die(print_r($db->errorInfo(), true));\n\n } else {\n die('DB ERROR: ' . $e->getMessage());\n }\n\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n }\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n return $db;\n }", "public function connect() {\n\t\t$cnn_string = 'host='.$this->_dbhost.' port='.$this->_dbport.' user='.$this->_dbuser.' password='.$this->_dbpass.' dbname='.$this->_dbname;\n\t\t\n\t\t$this->_instance = pg_connect($cnn_string) or PK_debug(__FUNCTION__, \"No se ha podido conectar con la DB\\n\\n\".pg_errormessage(), array('class'=>'error'));\n\t\t\n\t\tif (!$this->_instance) {\n\t\t\techo '<h1>Error en la aplicacion</h1><p>No se ha podido conectar con la base de datos</p>';\n\t\t\tPK_debug('', '', 'output');\n\t\t\texit();\n\t\t}\n\t\t\n\t\treturn $this->_instance;\n\t}", "protected function connect()\n\t{\n\t\t$strDSN = 'mysql:';\n\t\t$strDSN .= 'dbname=' . $GLOBALS['TL_CONFIG']['dbDatabase'] . ';';\n\t\t$strDSN .= 'host=' . $GLOBALS['TL_CONFIG']['dbHost'] . ';';\n\t\t$strDSN .= 'port=' . $GLOBALS['TL_CONFIG']['dbPort'] . ';';\n\t\t$strDSN .= 'charset=' . $GLOBALS['TL_CONFIG']['dbCharset'] . ';'; // supported only in PHP 5.3.6+\n\n\t\t$arrOptions = array(\n\t\t\tPDO::ATTR_PERSISTENT => $GLOBALS['TL_CONFIG']['dbPconnect'],\n\t\t\tPDO::MYSQL_ATTR_INIT_COMMAND => 'SET sql_mode=\\'\\'; SET NAMES ' . $GLOBALS['TL_CONFIG']['dbCharset'],\n\t\t\tPDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION\n\t\t);\n\n\t\t$this->resConnection = new PDO($strDSN, $GLOBALS['TL_CONFIG']['dbUser'], $GLOBALS['TL_CONFIG']['dbPass'], $arrOptions);\n\t}", "public function newConnection( Array $options ){\r\n\r\n\t\t $driver = isset($options['driver']) ? $options['driver'] : 'mysql';\r\n\t\t $host = isset($options['host']) ? $options['host'] : 'localhost';\r\n\t\t $user = isset($options['user']) ? $options['user'] : 'root';\r\n\t\t $pwd = isset($options['password']) ? $options['password'] : 'root';\r\n\t\t $dbName = isset($options['dbName']) ? $options['dbName'] : 'kelvic_hms';\r\n\t\t $active = isset($options['active']) ? $options['active'] : true;\r\n\r\n\r\n\t\t //make Sure DbName is set\r\n\t\t if(!$dbName){\r\n\t\t\tError::throwException('Database name not Set');\r\n\t\t }\r\n\r\n $dsn = $driver . \":host=\" . $host . \";dbname=\" . $dbName . \";charset=utf8\";\r\n\r\n\t\t try{\r\n\t\t\t$this->_connections[$dbName] = new PDO($dsn, $user, $pwd );\r\n\t\t\t$this->_connections[$dbName]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t //$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\r\n\t\t $this->_connections[$dbName]->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY , true);\r\n\t\t $this->_connections[$dbName]->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\r\n\r\n\t\t }catch(PDOException $e){\r\n\t\t\techo $e->getMessage();\r\n\t\t\tdie;\r\n\t\t }\r\n\t\t//if active is true..set this connection as the active connection\r\n\t\tif($active){\r\n\t\t\t$this->setActiveConnection($dbName);\r\n\t\t}\r\n }", "public function connectDatabase()\n {\n if($this->database !== null)\n {\n $this->disconnectDatabase();\n }\n\n $this->database = new mysqli(\n $this->DatabaseConfiguration['Host'],\n $this->DatabaseConfiguration['Username'],\n $this->DatabaseConfiguration['Password'],\n $this->DatabaseConfiguration['Name'],\n $this->DatabaseConfiguration['Port']\n );\n }", "function setDatabaseConnection($host,$database,$user,$pass);", "private function _newConnection($host, $dbname, $username, $passwd, $options = NULL) \n\t{\n\t\t// setting default options if not provided\n\t\t$options || $options = array (\n\t\t\t\\PDO::MYSQL_ATTR_FOUND_ROWS => TRUE\n\t\t);\n\t\n\t\ttry {\n\t\t\t// connect to the database\n\t\t\t$this->_connection = new \\PDO ( 'mysql:host=' . $host . ';dbname=' . $dbname, $username, $passwd, $options );\n\t\t\t\t\n\t\t\t// set the error codes\n\t\t\t$this->_connection->setAttribute ( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION );\n\t\t} catch ( PDOException $e ) {\n\t\t\ttrigger_error ( 'Error connecting to host: ' . $e->getMessage (), E_USER_ERROR );\n\t\t}\n\t}", "protected function CeateDatabaseConnection()\r\n\t{\r\n\t\t// Create an instance of the database for use in the system\r\n\t\tif($this->InProduction($_SERVER['SERVER_NAME']))\r\n\t\t\t//$this->Database\t= new Database('gstour.db.4628821.hostedresource.com','gstour','Golf1215','gstour');\r\n\t\t\t$this->Database\t= new Database('97.74.149.114','gstour','Golf1215','gstour');\r\n\t\telse\r\n\t\t\t$this->Database\t= new Database('localhost','root','','test');\r\n\t}", "function getDBConnection() {\n\t\n\t\tglobal $dbh;\n\n\t\tif(!$dbh) {\n\t\t\t$dbh = mysqli_connect(\"localhost\", \"sa\", \"sa\", \"travelexperts\");\n\t\t\tif(!$dbh) {\n\t\t\t\tprint(\"Connection failed: \" . mysqli_connect_errno($dbh) . \"--\" . mysqli_connect_error($dbh) . \"<br/>\");\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\t//db connection exists, do not need to create again.\n\t\t}\n\t\t\n\t}", "public static function connectDatabase()\n {\n $database_config = require(__ROOT__ . 'config/database.php');\n\n try {\n\n return new \\PDO(\n 'mysql:host=' . $database_config['host'] . ';dbname=' . $database_config['db_name'] . ';charset=' . $database_config['db_charset'],\n $database_config['db_user'],\n $database_config['db_password']\n );\n\n } catch (\\PDOException $e) {\n\n }\n }", "public static function createConnection()\n {\n $variablesIsSet =\n isset($_ENV['DB_HOST']) &&\n isset($_ENV['DB_NAME']) &&\n isset($_ENV['DB_USER']) &&\n isset($_ENV['DB_PASSWORD']);\n\n if ($variablesIsSet) {\n return new PDO(\n \"mysql:dbname={$_ENV['DB_NAME']};host={$_ENV['DB_HOST']}\",\n $_ENV['DB_USER'],\n $_ENV['DB_PASSWORD'],\n [\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\n ]\n );\n }\n }", "public function testCreateDb()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n \n list($host, $port, $dbname) = $this->_getUrlParts();\n $dbname = trim($dbname, '/');\n \n $db = Sopha_Db::createDb($dbname, $host, $port);\n \n // Make sure DB now exists\n $response = Sopha_Http_Request::get($this->_url);\n $this->assertEquals(200, $response->getStatus());\n }", "function connexionDb()\n{\n $confDb = getConfigFile()['DATABASE'];\n\n\n $type = $confDb['type'];\n $host = $confDb['host'];\n $servername = \"$type:host=$host\";\n $username = $confDb['username'];\n $password = $confDb['password'];\n $dbname = $confDb['dbname'];\n\n $db = new PDO(\"$servername;dbname=$dbname\", $username, $password);\n return $db;\n}", "protected static function getConnection()\n {\n try\n {\n //get file with params to connect\n $paramsPath = ROOT . '/config/db_params.php';\n $params = include($paramsPath);\n\n $dsn = \"mysql:host={$params['host']};dbname={$params['dbname']}\";\n $db = new PDO($dsn, $params['user'], $params['password']);\n $db->exec(\"set names utf8\");\n\n return $db;\n }\n catch(PDOException $ex) // Check connection with db\n {\n die(\"У нас проблемы, зайдите позже\");\n }\n }", "public static function getConnection() {\r\n //Guarantees single instance, if no connection object exists then create one.\r\n if (!self::$db) {\r\n //new connection object.\r\n new dbConn();\r\n }\r\n //return connection.\r\n return self::$db;\r\n }", "function getConnection($db,$custom);", "function connect(\n\t\t$dbname)\n\t{\n\t\trequire 'config.php';\n\n\t\t$servername = $configs['db_servername'];\n\t\t$username = $configs['db_username'];\n\t\t$password = $configs['db_password'];\n\n\t\t// Create connection\n\t\t$this->connection = new mysqli($servername, $username, $password, $dbname);\n\n\t\t// Check connection\n\t\tif ($this->connection->connect_error) {\n\t\t\tdie(\"Connection failed: \" . $this->connection->connect_error);\n\t\t}\n\t}", "public function connect() {\n if ($this->db === null) {\n $this->db = new PDO($this->db_dsn, $this->db_user, $this->db_pass);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n\n if ($this->db_schema !== null && $this->db_schema !== '') {\n $this->db->exec('SET search_path = ' . $this->db_schema . ', public');\n }\n\n return $this->db;\n }", "function open_connection() {\n // $con = new mysqli(\"localhost\", \"id15327665_root\", \"!qwertyQAZ9i03\");\n $con = new mysqli(\"localhost\", \"root\", \"\");\n if ($con->connect_errno) {\n printf(\"Database connection failed: %s\\n\", $con->connect_errno);\n exit();\n }\n\n if (!$con->select_db('pweb_fp')) {\n echo \"Could not select database\" . $con->error.\"<br>\";\n if (!$con->query(\"CREATE DATABASE IF NOT EXISTS pweb_fp;\")) {\n echo \"Could not create database: \" . $con->error.\"<br>\";\n }else{\n echo \"Database created<br>\";\n }\n $con->select_db('pweb_fp');\n }\n return $con;\n}", "protected function connectDB () {\n $host=$this->Parameters['db_host'];\n $username=$this->Parameters['db_username'];\n\t\t$password=$this->Parameters['db_userpassword'];\n\t\t$dbname=$this->Parameters['db_name'];\n\t\t\n $this->Conn = new mysqli ($host,$username,$password,$dbname);\n if($this->Conn->connect_errno > 0){\n throw new Exception('Unable to connect to database [' . $this->Conn->connect_error . ']');\n }\n }", "public function getConnection()\n {\n $this->connection = db($this->connectionName);\n\n return $this->connection;\n }", "function OpenCon() {\n $dbhost = \"\";\n $dbuser = \"\";\n $dbpass = \"\";\n if($_SERVER['SERVER_NAME'] == \"localhost\"){\n $dbhost = \"localhost\";\n $dbuser = \"root\";\n $dbpass = \"root\";\n }\n else{\n $dbhost = \"db.cs.dal.ca\";\n $dbuser = \"aio\";\n $dbpass = \"ge7ochooCae7\";\n }\n $db = \"aio\";\n $conn = new mysqli($dbhost, $dbuser, $dbpass, $db) or die(\"Connect failed: %s\\n\". $conn -> error);\n return $conn;\n }", "function connect_to_database($create_db = false)\r\n{\r\n\t// establish connection with database server\r\n\tif (!($link = mysql_connect(DB_HOST_NAME .\":\". DB_PORT, DB_USERNAME, DB_PASSWORD)))\r\n\t{\r\n\t\tmessage_die(\"Could not connect to the database\\n\");\r\n\t}\r\n\r\n\t// create database if requested\r\n\tif ($create_db)\r\n\t{\r\n\t\t$sql = \"CREATE DATABASE \". DB_DATABASE;\r\n\t\tif (!mysql_query($sql)) message_die(mysql_error($db) .\"\\n\");\r\n\t}\r\n\t\r\n\t// select database\r\n\tif (!mysql_select_db(DB_DATABASE, $link))\r\n\t{\r\n\t\tmessage_die(\"Database does not exist\\n\");\r\n\t}\r\n\t\r\n\treturn $link;\r\n}", "public function connect() {\n $this->database = new mysqli(\n $this->dbinfo['host'],\n $this->dbinfo['user'],\n $this->dbinfo['pass'],\n $this->dbinfo['name']\n );\n if ($this->database->connect_errno > 0)\n return $this->fail(\"Could not connect to database: [{$this->database->connect_error}]\");\n }", "public function NewConnection(){\n\t\ttry{\n\t\t\t$conn = mysql_connect($this->host, $this->user, $this->pass );\n\n\t\t\tif(!$conn)\n\t\t\t\tthrow_error(ERR_OPEN_CONNECTION,'Open database error.');\n\n\t\t\tmysql_select_db($this->dbname, $conn);\n\n\t\t\tif(mysql_errno())\n\t\t\t\tthrow_error(ERR_OPEN_CONNECTION,mysql_error());\n\n\t\t}catch(Exception $e){\n\t\t\tthrow_error(ERR_OPEN_CONNECTION,$e->getMessage());\n\t\t}\n\n\t\treturn $conn;\n\t}", "protected function getConnection()\n {\n $pdo = new PDO($GLOBALS['DB_DSN'],\n $GLOBALS['DB_USER'],\n $GLOBALS['DB_PASSWORD']);\n return $this->createDefaultDBConnection($pdo, $GLOBALS['DB_NAME']);\n }", "public function open_db_connection()\n\t{\n\n\t\t$this->connection = new mysqli(DB_HOST,DB_USER,\n\t\t\tDB_PASS,DB_NAME);\n\n\t\tif ($this->connection->connect_errno):\n\t\t\tdie('database connection failed badly' . $this->connection->connect_error);\n\t\tendif;\n\n\t}", "public function getConnection()\n {\n return $this->createDefaultDBConnection($this->_pdo, Zend_Registry::get('config')->database->dbname);\n }", "public function getConnection()\n {\n return $this->createDefaultDBConnection($this->_pdo, Zend_Registry::get('config')->database->dbname);\n }", "public static function connectDB(){ \r\n include '../config.php'; // $dbhost, $dbuser, $dbpass and $dbname are all defined here\r\n self::$db = new mysqli(\"$dbhost\", \"$dbuser\", \"$dbpass\", \"$dbname\");\r\n if (self::$db->connect_error) { // if there's error in connection\r\n die('Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error);\r\n }\r\n return self::$db;\r\n }", "private function connect() {\r\n\t\tunset($this->dbLink);\r\n\t\t/* create connection to database host */\r\n\t\t// $dbLink = mysql_connect(\"mysql.localhost\", \"de88623\", \"proberaum1\");\r\n\t\t$dbLink = mysql_connect(\"localhost\", \"robert\", \"YMbHFY+On2\");\r\n\t\t/* select database */\r\n\t\tmysql_select_db(\"robert_www_parkdrei_de\");\r\n\t\t/* set link to database as a object attribute */\r\n\t\t$this->dbLink = $dbLink;\r\n\t}", "private function connect(){\n\t\trequire (__DIR__ . '/../../config.php');\n\t\t$mysqlCFG =$database['mysql'];\n\t\t\n\t\tif(!self::$db){\n\t\t\t$connectionString = \"mysql:host=$mysqlCFG[host];dbname=$mysqlCFG[dbname]\";\n\t\t\ttry{\n\t\t\t\tself::$db = new \\PDO($connectionString, $mysqlCFG['user'], $mysqlCFG['password']);\n\t\t\t\tself::$db->setAttribute( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t\t}catch(\\PDOException $e){\n\t\t\t\tdie(\"Ocurrio un error al conectar con la base de datos: $e->getMessage()\");\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function getConnection()\n {\n try {\n $servername = config(\"database.connections.mysql.host\");\n $port = config(\"database.connections.mysql.port\");\n $username = config(\"database.connections.mysql.username\");\n $password = config(\"database.connections.mysql.password\");\n $dbname = config(\"database.connections.mysql.database\");\n\n $db = new PDO(\"mysql:host=$servername;port=$port;dbname=$dbname\", $username, $password);\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n return $db;\n } catch (PDOException $e) {\n Log::error(\"Exception: \", array(\n \"message\" => $e->getMessage()\n ));\n throw new DatabaseException(\"Database Exception:\" . $e->getMessage(), 0, $e);\n }\n\n }", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "protected function getConnection()\n {\n $pdo = new PDO(DB_DSN, DB_USER, DB_PASS);\n return new DefaultConnection($pdo, DB_NAME);\n }", "public function connect()\n {\n $driver = 'DB'; // default driver\n $dsn = $this->getParameter('dsn');\n\n $do = $this->getParameter('dataobject');\n if ($do && isset($do['db_driver'])) {\n $driver = $do['db_driver'];\n }\n\n if ('DB' == $driver) {\n\n if (!class_exists('DB')) {\n include('DB.php');\n }\n\n $options = PEAR::getStaticProperty('DB', 'options');\n if ($options) {\n $this->connection = DB::connect($dsn, $options);\n } else {\n $this->connection = DB::connect($dsn);\n }\n \n } else {\n\n if (!class_exists('MDB2')) {\n include('MDB2.php');\n }\n \n $options = PEAR::getStaticProperty('MDB2', 'options');\n $this->connection = MDB2::connect($dsn, $options);\n }\n\n if (PEAR::isError($this->connection)) {\n\n throw new AgaviDatabaseException($this->connection->getMessage());\n $this->connection = Null;\n }\n }", "private function connect()\n {\n $connection_string = 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';';\n $this->connection = new PDO($connection_string, DB_USER, DB_PASS);\n }" ]
[ "0.8079734", "0.7740089", "0.7606688", "0.7596471", "0.75939846", "0.7503964", "0.7502423", "0.7502079", "0.73325104", "0.73203886", "0.72391456", "0.7191462", "0.71667737", "0.7130376", "0.70963025", "0.70942324", "0.70864236", "0.7077575", "0.70742416", "0.70686984", "0.70640755", "0.70526505", "0.70523113", "0.7046486", "0.7039004", "0.7034387", "0.7022796", "0.7021657", "0.70206404", "0.7015886", "0.7002001", "0.69927365", "0.69912046", "0.69903564", "0.69901764", "0.69889736", "0.6985164", "0.6984683", "0.69797444", "0.6977959", "0.69638616", "0.6963219", "0.6958474", "0.69569176", "0.69548506", "0.69506156", "0.6943993", "0.6940299", "0.69382095", "0.69299006", "0.691358", "0.6912126", "0.6909572", "0.6899386", "0.68978286", "0.6895581", "0.6895525", "0.68874216", "0.68865466", "0.6884846", "0.6884197", "0.6883493", "0.6880859", "0.68806565", "0.68614256", "0.686137", "0.6858366", "0.6857592", "0.6855306", "0.6848814", "0.68410236", "0.6837505", "0.6832381", "0.6829364", "0.68187666", "0.68090063", "0.68041915", "0.68024576", "0.67973435", "0.6793861", "0.6787076", "0.6787076", "0.6781145", "0.6777223", "0.67707556", "0.67645156", "0.6756316", "0.6756316", "0.6756316", "0.6756316", "0.6756316", "0.6756316", "0.6756316", "0.6756316", "0.6756316", "0.6756316", "0.6756316", "0.6756316", "0.6754351", "0.6750944", "0.6748772" ]
0.0
-1
/ Write new data
function _write($id, $sess_data) { //$row = DB::row("SELECT value FROM " . DB::$db_prefix . "_sessions WHERE sesskey = '".$id."'"); $time = time()+parent::$sess_lifetime; DB::query(" REPLACE INTO " . DB::$db_prefix . "_sessions VALUES ( '".$id."', '".$time."', '".addslashes($sess_data)."', '".$_SERVER['REMOTE_ADDR']."' ) "); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _write($data)\n {\n }", "abstract public function write($data);", "public function write($data);", "public function write($data);", "public function write($data);", "public function write($data);", "public function write($data) {\n\t}", "private function write($data)\n {\n $this->connection->write($data);\n }", "protected function _write() {}", "public function write($key, $data)\n {\n }", "public function write();", "public function write();", "abstract protected function _write();", "public function writeAll( array $data ) {\n\n\t\t$this->_data = $data;\n\t}", "function _write($id, $data) {\n $access = time();\n\n $this->_destroy($id);\n return ee()->db->insert($this->table_name, array(\n 'id' => $id,\n 'data' => $data,\n 'access' => $access\n ));\n }", "public function write($data, $length){ }", "public function writeFile($data);", "public function write(array $data);", "public function write($data)\n {\n $this->buffer .= $data;\n }", "function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}", "abstract protected function write();", "abstract public function updateData();", "function write($offset, $data) {}", "function write($id, $data, $next);", "function write($data) {\n if (!@fwrite($this->_handler, $data, strlen($data))) {\n \tFire_Error::throwError(sprintf('Failed to write %s data to %s file.',\n \t $data,\n \t $this->_file\n \t ), __FILE__, __LINE__\n \t);\n }\n }", "public function __invoke($data)\n {\n $this->write($data);\n }", "public function onWrite();", "public function write(): void\n {\n $this->writeAndReturnAffectedNumber();\n }", "public function saveData()\r\n {\r\n \r\n }", "protected function write()\n {\n $this->writeString($this->database);\n $this->writeString($this->type);\n $this->writeString($this->storage);\n }", "protected function appendData($data)\n {\n $this->sha1 = null;\n $this->data.=$data;\n }", "public function write($name, array $data);", "protected function putData($uri,array $newData) {\n\n $path = $this->getFileNameForUri($uri);\n\n // opening up the file, and creating a shared lock\n $handle = fopen($path,'a+');\n flock($handle,LOCK_EX);\n ftruncate($handle,0);\n rewind($handle);\n\n fwrite($handle,serialize($newData));\n fclose($handle);\n\n }", "public function write()\n {\n }", "public function write($path, $data);", "function write($data)\r\n {\r\n $this->string.=$data;\r\n return TRUE;\r\n }", "private function write_single($data){\r\n if($this->$data[0] !== NULL){\r\n //add row of data to transaction object\r\n $this->$data[0]->add_list($data);\r\n }else{\r\n $this->$data[0] = new transaction_object($data[0]);\r\n $this->$data[0]->add_header($this->default_headers[$data[0]]);\r\n $this->$data[0]->add_list($data);\r\n }\r\n }", "protected function _write($data)\n {\n $this->_connect();\n\n fwrite($this->_socket, $data);\n stream_set_timeout($this->_socket, Zend_TimeSync::$options['timeout']);\n }", "protected function _write() {\n\n if ( !empty( $this->rid ) && $this->rid instanceof ID ) {\n $this->cluster_id = $this->rid->cluster;\n $this->cluster_position = $this->rid->position;\n }\n\n $this->record->setRid( new ID( $this->cluster_id, $this->cluster_position ) );\n\n $this->_writeShort( $this->cluster_id );\n $this->_writeLong( $this->cluster_position );\n\n if( $this->_transport->getProtocolVersion() >= 23 ){\n $this->_writeBoolean( $this->update_content );\n }\n\n $this->_writeBytes( CSV::serialize( $this->record ) );\n $this->_writeInt( $this->record_version );\n $this->_writeChar( $this->record_type );\n $this->_writeBoolean( $this->mode );\n\n }", "public function writeToFile($data){\t\n\t\tfwrite($this->fptr,$data);\n\t}", "public function saveDataToFile()\n {\n\n }", "private static function save() {\n\t\tif(self::$data===null) throw new Excepton('Save before load!');\n\t\t$fp=fopen(self::$datafile,'w');\n\t\tif(!$fp) throw new Exception('Could not write data file!');\n\t\tforeach (self::$data as $item) {\n\t\t\tfwrite($fp,$item); // we use the __toString() here\n\t\t}\n\t\tfclose($fp);\n\t}", "public function write($data) {\r\n\t\t$res=fwrite($this->_handle, $data);\r\n\t\tif(!$res) {\r\n\t\t\tthrow new Curly_Stream_Exception('An error occured while writing data into the output stream');\r\n\t\t}\r\n\t\telse if($res!==strlen($data)) {\r\n\t\t\tthrow new Curly_Stream_Exception('Not all data was written to the output stream. Just '.$res.' bytes were written');\r\n\t\t}\r\n\t}", "public function setData($data){\n\t\t$this->_storage = $data;\n\t\t\n\t\t// set update flag\n\t\t$this->_isModified = true;\n\t\t\n\t\t// new data available\n\t\t$this->_dataAvailable = true;\n\t}", "public function save()\n {\n if ( !$this->unsaved ) {\n // either nothing has been changed, or data has not been loaded, so\n // do nothing by returning early\n return;\n }\n\n $this->write();\n $this->unsaved = false;\n }", "function ccio_appendData($filename, $data) {\r\n\t//$fh = fopen($filename, \"ab\");\r\n\t$fh = fopen($filename, \"at\");\r\n\tfwrite($fh, $data);\t\t\r\n\tfclose($fh);\r\n\treturn TRUE;\r\n}", "function set($key,$data)\n\t{\n\t\t// Get file path\n\t\t$file_path = $this->get_file_path($key);\n\n\t\t// Add content to file\n\t\tfile_put_contents($file_path,serialize($data));\n\t}", "public function write($data, $filename = '', $uploadDir = '');", "private static function saveDataToNode($data) {\r\n file_put_contents(static::getFilePath(), json_encode($data));\r\n }", "public function storeIncomingData() {}", "function writePlayerData($player, $data) {\n\t$old_data = getGamestate();\n\t$old_data[$player] = $data;\n\twriteGamestate($old_data);\n}", "public function write(){\n\n\t\t$ACHFile = fopen($this->getFileLocation(), \"w\");\n\t\tfwrite($ACHFile, $this->getData());\n\t\tfclose($ACHFile);\n\n\t\treturn $this->getFileLocation();\t\n\t}", "public function putAll($data)\n\t{\n\t\t$this->data = array_merge($this->data, $data);\n\n\t\tif ($this->autosave) $this->write();\n\t}", "public function write($sessionId, $data);", "public static function write( $key, $newData ) {\r\n\t\t\t// split keys\r\n\t\t\t$keys = self::explode( $key );\r\n\t\t\t// write values\r\n\t\t\t$data = & self::$data;\r\n\t\t\tforeach ( $keys as $part ) {\r\n\t\t\t\tif ( !isset( $data[ $part ] ) ) {\r\n\t\t\t\t\t$data[ $part ] = array();\r\n\t\t\t\t}\r\n\t\t\t\t$data = & $data[ $part ];\r\n\t\t\t}\r\n\t\t\t$data = $newData;\r\n\t\t\tself::callEvent( 'Configure.write', $key, $newData );\r\n\t\t}", "public function write($data)\n {\n $this->attachedWebsocket->write($data);\n }", "public function writeFile($path, $data);", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "abstract public function save( $data );", "public function write($id = NULL, $data = '') \n\t{\n\t\t/*\n\t\t * Case 2: We check to see if the session already exists. If it does\n\t\t * then we need to update it. If not, then we create a new entry.\n\t\t */\n// if($this->session_id && $this->session_id != $id)\n//\t\t{\n//\t \t$this->_conn->query(\"UPDATE {$this->table_name} SET data = '{$data}' WHERE {$this->primary_key} = '{$id}'\");\n//\t\t}\n//\t\telse\n//\t\t{\n//\t\t\t$this->_conn->query(\"INSERT INTO {$this->table_name}({$this->primary_key},data) VALUES('{$id}','{$data}')\");\n//\t\t}\n// return TRUE;\n\n\t\t$time = date('Y-m-d H:i:s', time());\n\t\t$this->_conn->query(\"REPLACE `{$this->table_name}` (`{$this->primary_key}`,`last_activity`,`data`) VALUES('{$id}','{$time}','{$data}')\");\n return TRUE;\n\t}", "public function syncDataNode() {}", "private function writeAppData()\n {\n $fileName = \"{$this->storeDirectory}/appData.json\";\n $data = json_encode([\n 'default-counter' => $this->defaultCounter,\n ]);\n file_put_contents($fileName, $data, JSON_PRETTY_PRINT);\n }", "private function saveData() {\n // Create a new object with relevant information\n $data = new stdClass();\n $data->accessToken = $this->accessToken;\n $data->expirationDate = $this->expirationDate;\n $data->refreshToken = $this->refreshToken;\n\n // And save it to disk (will automatically create the file for us)\n file_put_contents(DATA_FILE, json_encode($data));\n }", "public function write($id, $data) \r\n {\r\n echo __METHOD__,'<BR>'; \r\n echo 'session_id =',$id,'<br>';\r\n try {\r\n $sql = 'replace into `session` set `session`.session_id = :id ,`session`.session_data = :data , `session`.session_last_access = :time';\r\n echo 'data befor save = ',$data,'<br>';\r\n $rs =R::exec($sql,array(':id'=>$id,':data'=>$data,':time'=>time()));\r\n var_dump($rs);\r\n return true;\r\n exit();\r\n } catch (Exception $e) {\r\n echo 'Execption = ';\r\n echo $e->getMessage();\r\n } \r\n echo 'aftersave<br>';\r\n //REPLACE\r\n // global $SESS_DBH, $SESS_LIFE;\r\n // $session_last_access = time();\r\n // $value = $val;\r\n // $qry = \"insert into sessions values('$key',$session_last_access,'$value')\";\r\n // $qid = mysql_query($qry, $SESS_DBH);\r\n // if (!$qid) {\r\n // $qry = \"update sessions set session_last_access=$session_last_access, session_data='$value' where session_id='$key' \";\r\n // $qid = mysql_query($qry, $SESS_DBH);\r\n // }\r\n // return $qid;\r\n\r\n // var_dump($data); \r\n $sess_file = $this->_path . $this->_name . \"_$id\";\r\n // echo 'session file = ',$sess_file,'<br>';\r\n $iv = mcrypt_create_iv($this->_ivSize, MCRYPT_DEV_URANDOM);\r\n $encrypted = mcrypt_encrypt(\r\n $this->_algo,\r\n $this->_key,\r\n $data,\r\n MCRYPT_MODE_CBC,\r\n $iv\r\n );\r\n $hmac = hash_hmac('sha256', $iv . $this->_algo . $encrypted, $this->_auth);\r\n $bytes = file_put_contents($sess_file, $hmac . ':' . base64_encode($iv) . ':' . base64_encode($encrypted));\r\n // $bytes = file_put_contents($sess_file,$data);\r\n // echo 'write=',$bytes;\r\n return ($bytes !== false); \r\n }", "function write(string $key, $data, array $dependencies): void;", "protected function _writeFileBody() {}", "public function writeItem($item)\n {\n $this->data[] = $item;\n }", "public function write(string $data): bool {}", "function store() {\r\n $this->reindex();\r\n //---------------------\r\n if (($handle = fopen($this->_origin, \"w\")) !== FALSE) {\r\n fputcsv($handle, $this->_fields);\r\n foreach ($this->_data as $key => $record)\r\n fputcsv($handle, array_values((array) $record));\r\n fclose($handle);\r\n }\r\n }", "function Commit()\n\t{\n\t\t// save the all changes!! (append data & update the indexes)\n\t\tif (!$this->fd || $this->mode != 'w' || $this->dat_buffer == '') return;\n\n\t\t// 1. load all unloaded index_buffer\n\t\tfor ($i = 0; $i < $this->max_klen; $i++)\n\t\t{\n\t\t\tif (isset($this->key_buffer[$i])) continue;\n\t\t\t$this->key_buffer[$i] = '';\n\t\t\tif (!isset($this->key_index[$i]) || $this->key_index[$i]['len'] == 0) continue;\n\t\t\tfseek($this->fd, $this->key_index[$i]['off'], SEEK_SET);\n\t\t\t$this->key_buffer[$i] = fread($this->fd, $this->key_index[$i]['len']);\n\t\t}\n\n\t\t// 2. save the append data\n\t\tif ($this->dat_buffer != '')\n\t\t{\n\t\t\tfseek($this->fd, $this->key_index[0]['off'], SEEK_SET);\n\t\t\tfwrite($this->fd, $this->dat_buffer);\n\t\t\tunset($this->dat_buffer);\n\t\t\t$this->dat_buffer = '';\n\t\t}\n\t\t// 3. save the key_buffer\n\t\t$off = $this->dat_offset;\n\t\t$kbuf = '';\n\t\tfor ($i = 0; $i < $this->max_klen; $i++)\n\t\t{\n\t\t\t// check the index modified or not\n\t\t\t$kblen = strlen($this->key_buffer[$i]);\n\t\t\tif (!isset($this->put_pool[$i]))\n\t\t\t{\n\t\t\t\tif ($kblen > 0)\n\t\t\t\t\tfwrite($this->fd, $this->key_buffer[$i], $kblen);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// modified!!\n\t\t\t\t$size = $i + 9;\t\t// record_size\n\n\t\t\t\t// sort the put_pool by key\n\t\t\t\t$pool = &$this->put_pool[$i];\n\t\t\t\tksort($pool);\n\n\t\t\t\t$buffer = '';\n\t\t\t\t$o = $n = 0;\n\t\t\t\twhile ($o < $kblen)\n\t\t\t\t{\n\t\t\t\t\t$pval = each($pool);\n\t\t\t\t\tif (!$pval)\n\t\t\t\t\t{\n\t\t\t\t\t\t// end of pool\n\t\t\t\t\t\t$buffer .= substr($this->key_buffer[$i], $o);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$okey = substr($this->key_buffer[$i], $o + 8, $size - 8);\n\t\t\t\t\t$cmp = strcmp($pval['key'], $okey);\n\n\t\t\t\t\t// 直到找到大于的?\n\t\t\t\t\twhile ($cmp < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$buffer .= pack('VVa*', $pval['value']['off'], $pval['value']['len'], $pval['key']);\n\t\t\t\t\t\t$n += $size;\n\n\t\t\t\t\t\t// find the next\n\t\t\t\t\t\t$pval = each($pool);\n\t\t\t\t\t\tif (!$pval) $cmp = 1;\t// set > 0\n\t\t\t\t\t\telse $cmp = strcmp($pval['key'], $okey);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($cmp == 0)\n\t\t\t\t\t\t$buffer .= pack('VVa*', $pval['value']['off'], $pval['value']['len'], $pval['key']);\n\t\t\t\t\telse if ($cmp > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$buffer .= substr($this->key_buffer[$i], $o, $size);\n\t\t\t\t\t\tif ($pval && !prev($pool)) end($pool);\n\t\t\t\t\t}\n\t\t\t\t\t$o += $size;\n\t\t\t\t}\n\n\t\t\t\t// other pool data\n\t\t\t\twhile ($pval = each($pool))\n\t\t\t\t{\n\t\t\t\t\t$buffer .= pack('VVa*', $pval['value']['off'], $pval['value']['len'], $pval['key']);\n\t\t\t\t\t$n += $size;\n\t\t\t\t}\n\n\t\t\t\t// save to disk\n\t\t\t\t$kblen += $n;\n\t\t\t\tfwrite($this->fd, $buffer, $kblen);\n\n\t\t\t\t// delete the pool\n\t\t\t\tunset($buffer, $pool);\n\t\t\t\tunset($this->put_pool[$i]);\n\t\t\t}\n\n\t\t\t$kbuf .= pack('VV', $off, $kblen);\n\t\t\t$this->key_index[$i] = array('off' => $off, 'len' => $kblen);\n\t\t\t$off += $kblen;\n\t\t\tunset($this->key_buffer[$i]);\n\t\t}\n\t\t// 4. save the head offset & length (key_index)\n\t\tfseek($this->fd, 32, SEEK_SET);\n\t\tfwrite($this->fd, $kbuf);\n\t\tunset($kbuf);\n\n\t\t// 5. flush the fd\n\t\tfflush($this->fd);\n\t}", "public function save($data)\n\t{\n\t}", "public function write($data, $length = null)\n {\n // TODO: Implement write() method.\n }", "public function store() {\n $logData = \"=========================================\\n\";\n $logData .= \"Date Time: \".$this->record_date.\"\\n\";\n $logData .= $this->title.\" (\".$this->type.\") \\n\";\n if(!empty($this->data)) {\n $logData .= var_export($this->data, true).\"\\n\";\n }\n \n file_put_contents($this->file, $logData, FILE_APPEND);\n \n }", "public static function write($id, $data){\n\t\t$id = self::hash_id($id);\n\n\t\tself::set_table($id);\n\n\t\tself::switch_if_necessary($id, $data);\n\n\t\t$stmt = self::$db->prepare(sprintf(self::${self::exists($id) ? 'SET_DATA' : 'INSERT'}, self::$table));\n\n\t\t$stmt->execute(array($data, $id));\n\t\t$stmt->closeCursor();\n\n\t\treturn true;\n\t}", "private function saveData(): void\n {\n $this->tab_chat_call->call_update = gmdate(\"Y-m-d H:i:s\"); //data e hora UTC\n $result = $this->tab_chat_call->save();\n\n if ($result) {\n $this->Result = true;\n $this->Error = [];\n $this->Error['msg'] = \"Sucesso!\";\n $this->Error['data']['call'] = $this->tab_chat_call->call_id;\n } else {\n $this->Result = false;\n $this->Error = [];\n $this->Error['msg'] = $this->tab_chat_call->fail()->getMessage();\n $this->Error['data'] = null;\n }\n }", "protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n file_put_contents($this->file, json_encode([\n 'network' => $this->network,\n 'epoch' => static::$epoch,\n 'iteration' => static::$iteration,\n 'a' => $this->a,\n 'e' => $this->e\n ]));\n }", "protected function filewrite($data = NULL) {\n ob_start();\n print_r($data);\n $c = ob_get_clean();\n $fc = fopen('txtfile' . DS . 'data.txt', 'w');\n fwrite($fc, $c);\n fclose($fc);\n }", "public function processWrite()\n {\n if (!$this->hasPendingWrite()) {\n return;\n }\n\n if (!$this->pendingWriteBuffer) {\n $this->pendingWriteBuffer .= array_shift($this->pendingWrites)->toRawData();\n }\n\n $this->log('Writing data to client, buffer contents: ' . $this->pendingWriteBuffer, Loggable::LEVEL_DEBUG);\n\n $bytesWritten = fwrite($this->socket, $this->pendingWriteBuffer);\n\n if ($bytesWritten === false) {\n $this->log('Data write failed', Loggable::LEVEL_ERROR);\n $this->trigger('error', $this, 'Data write failed');\n\n $this->disconnect();\n } else if ($bytesWritten > 0) {\n $this->pendingWriteBuffer = (string) substr($this->pendingWriteBuffer, $bytesWritten);\n }\n }", "abstract protected function write(array $record);", "function write($data)\n {\n eval(PUBSUB_MUTATE);\n if ($this->_finished_writing)\n {\n #errno = EBADF; # as if we were writing on a closed fd\n return -1;\n }\n $this->_outbuf .= $data;\n if (strlen($this->_outbuf))\n {\n # XXX: check for failure?\n $this->_evl->setInterestOnWritable($this->_outsock,\n $this->_wrapOnWritable);\n }\n return strlen($data);\n }", "public function append($data) {\r\n\t\tif ($this->exists) {\r\n\t\t\t\r\n\t\t\t$handle = fopen ( $this->filename, \"a\" ) or die ( $this->error [\"103\"] );\r\n\t\t\tfwrite ( $handle, $data );\r\n\t\t\tfclose ( $handle );\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "static function writeFl($data,$file)\n {\n $filec = fopen($file,\"w\") or die(\"unable to open\");\n fwrite($filec,$data);\n }", "public function save($key, $data);", "function put($key, $data) {\n $fn = $this->name($key);\n file_put_contents($fn, serialize($data), LOCK_EX);\n }", "function stream_write( $data ) {\r\n\t\tif ( ! isset( $this->data_ref ) ) {\r\n\t\t\t$this->data_ref = '';\r\n\t\t}\r\n\r\n\t\t$left = substr( $this->data_ref, 0, $this->position );\r\n\t\t$right = substr( $this->data_ref, $this->position + strlen( $data ) );\r\n\r\n\t\tWP_Test_Stream::$data[ $this->bucket ][ $this->file ] = $left . $data . $right;\r\n\r\n\t\t$this->position += strlen( $data );\r\n\t\treturn strlen( $data );\r\n\t}", "function writeGamestate($newdata) {\n\t//file_put_contents(\"data/gamestate.json\", json_encode($newdata));\n\tif (isset($_SESSION['gameid'])) {\n\t\t$id = $_SESSION['gameid'];\n\n\t\tfile_put_contents(\"data/games/$id.json\", json_encode($newdata));\n\n\t\treturn $newdata;\n\t} else {\n\t\treturn []; // error('please register first');\n\t}\n\n}", "public function save($data): void;", "private function write($data)\n {\n $this -> printer -> getPrintConnector() -> write($data);\n }", "public static function writeLog($data){\n\n $directory_path = WINEAC_DIR_PATH.self::DIRECTORY_LOGS;\n $file_path = WINEAC_DIR_PATH.self::DIRECTORY_LOGS.self::DIRECTORY_SEPARATOR.self::LOGS_FILE;\n\n if (!file_exists($directory_path)) {\n mkdir($directory_path, 0777, true);\n }\n\n if(!file_exists($file_path)){\n fopen($file_path , 'w');\n }\n\n if(is_array($data)) {\n $data = json_encode($data);\n }\n $file = fopen($file_path ,\"a\");\n fwrite($file, \"\\n\" . date('Y-m-d h:i:s') . \" :: \" . $data);\n fclose($file);\n\n }", "function file_write ($filename, $data) {\r\n $fd = fopen($filename, 'w') or die(\"Can't open file $filename for write!\");\r\n fwrite($fd, $data);\r\n fclose($fd);\r\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function append($data);", "function addData($name, $message)\n{\n global $dataFileName;\n $newline = implode('|', [$name, $message]).\"\\r\\n\";\n $file = fopen($dataFileName, 'a');\n fwrite($file, $newline);\n}", "function write()\n {\n }", "public function write($data) {\n $result = socket_write($this->communicationSocket, $data);\n $this->checkResult($result);\n }", "public function write($id, $data)\n\t{\n\t\ttry\n\t\t{\n\t\t\tif($this->table()->where('id', '=', $id)->count() != 0)\n\t\t\t{\n\t\t\t\treturn (bool) $this->table()->where('id', '=', $id)->update(array('data' => $data, 'expires' => (time() + $this->maxLifetime)));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->table()->insert(array('id' => $id, 'data' => $data, 'expires' => (time() + $this->maxLifetime)));\n\t\t\t}\n\t\t}\n\t\tcatch(PDOException $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public static function write($id, $data){\n//\t\techo 'write'.$id.\"\\n<br>\";\n\t\t$db = RuntimeInfo::instance()->connections()->MySQL(RuntimeInfo::instance()->helpers()->Session()->getSessionConfig()->getHosts());\n\t\t$query='REPLACE INTO php_session VALUES ('.$db->escape($id).','.$db->escape(time()).','.$db->escape($data).')';\n\t\treturn $db->query($query);\n\t}" ]
[ "0.76748735", "0.7601268", "0.75909555", "0.75909555", "0.75909555", "0.75909555", "0.74730575", "0.6981291", "0.69794786", "0.69478804", "0.694365", "0.694365", "0.6798985", "0.6737019", "0.6724943", "0.66886795", "0.6668277", "0.6661615", "0.66370255", "0.6593994", "0.6591027", "0.65855", "0.65725595", "0.65720505", "0.6529614", "0.6516014", "0.64819914", "0.64794576", "0.64788955", "0.6454398", "0.64336604", "0.643328", "0.6417572", "0.6364144", "0.6291324", "0.628533", "0.6280129", "0.6275276", "0.62612563", "0.6238448", "0.6221102", "0.6192942", "0.61784554", "0.6178365", "0.6172232", "0.61596304", "0.6138478", "0.61322", "0.6131356", "0.6111175", "0.6093832", "0.6087342", "0.6078399", "0.60778034", "0.60671353", "0.60596", "0.60431564", "0.6042033", "0.60415345", "0.6035853", "0.6023994", "0.60187185", "0.6004888", "0.5988813", "0.59851605", "0.5978979", "0.5976821", "0.5966853", "0.59589064", "0.59573776", "0.59559226", "0.5951826", "0.59464383", "0.5945451", "0.59267294", "0.59156257", "0.5911405", "0.59071934", "0.59045947", "0.5898491", "0.58975697", "0.5890677", "0.5883369", "0.5881491", "0.5880432", "0.5871131", "0.5870706", "0.58697355", "0.5866532", "0.5866287", "0.58612883", "0.58612883", "0.58610094", "0.58610094", "0.58590335", "0.58580756", "0.5846203", "0.5831108", "0.58283865", "0.5825054", "0.5824522" ]
0.0
-1
/ Garbage collection, deletes old sessions
function _gc($maxlifetime) { DB::query("DELETE FROM " . DB::$db_prefix . "_sessions WHERE expiry < UNIX_TIMESTAMP(NOW() - '" . $maxlifetime . "')"); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gc (){\n\n # create database object if not create\n self::_connect();\n\n # delete expired session from database table\n $res = $this->link->delete($this->table_name,array(array('','session_expire','<',time(),'')));\n\n }", "public function delete_old_sessions()\n\t{\n\t\t$expire = ee()->localize->now - $this->session_length;\n\n\t\tsrand(time());\n\n\t\tif ((rand() % 100) < $this->gc_probability)\n\t\t{\n\t\t\tee()->db->where('last_activity < ', $expire)\n\t\t\t\t\t\t ->delete('sessions');\n\t\t}\n\t}", "protected function destroy_all_sessions()\n {\n }", "protected abstract function destroy_all_sessions();", "protected function delete_old_sessions () {\n\t\t$this->db_prime()->q(\n\t\t\t\"DELETE FROM `[prefix]sessions`\n\t\t\tWHERE `expire` < \".time()\n\t\t);\n\t}", "public static function drop_sessions()\n {\n }", "public static function drop_sessions()\n {\n }", "function phpAds_SessionDataDestroy()\n{\n $dal = new MAX_Dal_Admin_Session();\n\n\tglobal $session;\n $dal->deleteSession($_COOKIE['sessionRPID']);\n\n MAX_cookieAdd('sessionRPID', '');\n MAX_cookieFlush();\n\n\tunset($session);\n\tunset($_COOKIE['sessionRPID']);\n}", "function sess_destroy ()\n {\n if (isset($_COOKIE[session_name()])) {\n setcookie(session_name(), '', (time()-42000), '/');\n }\n\n //Destroy the Session Array\n $_SESSION = array();\n\n //Destroy the userdata array - in case any further calls after the destory session is called, \"stale\" information is not called upon.\n $this->userdata = array();\n\n //Complete the session destory process by calling PHP's native session_destroy() function\n session_destroy();\n }", "public function delete() {\n $this->logger->debug(\"Deleting session\");\n $this->repository->removeByKey($this->getKeys());\n self::$instance = null;\n }", "function destroy () {\r\n $_SESSION = array();\r\n session_destroy();\r\n }", "public function destroySession()\n {\n $_SESSION = [];\n $this->executeGcNotificationCallback($this->getSessionId(), time());\n session_destroy();\n }", "public function purge()\n {\n $this->_session->purge();\n }", "function sessionDeleteAll() {\n\t$_SESSION = array();\n\n\t// If it's desired to kill the session, also delete the session cookie.\n\t// Note: This will destroy the session, and not just the session data!\n\tif (ini_get(\"session.use_cookies\")) {\n\t $params = session_get_cookie_params();\n\t setcookie(session_name(), '', time() - 42000,\n\t $params[\"path\"], $params[\"domain\"],\n\t $params[\"secure\"], $params[\"httponly\"]\n\t );\n\t}\n\n\t// Finally, destroy the session.\n\tsession_destroy();\n}", "public static function refresh()\n {\n //self::delete(name_of_session);\n }", "private function deleteSession() {\n session_start();\n\n $_SESSION = array();\n\n if (ini_get('session.use_cookies')) {\n $params = session_get_cookie_params();\n setcookie(\n session_name(),\n '',\n time() - 42000,\n $params['path'],\n $params['domain'],\n $params['secure'],\n $params['httponly']\n );\n }\n\n session_destroy();\n }", "function payswarm_clear_session() {\n // clear existing stored session\n $session = payswarm_get_session();\n if($session !== false) {\n delete_transient('ps_sess_' . $session['id']);\n }\n\n // clear cookie\n payswarm_clear_session_cookie();\n}", "public function __destruct()\n {\n foreach (glob(\"$this->save_path/sess_*\") as $filename) {\n if (filemtime($filename) + 3600 < time()) {\n @unlink($filename);\n }\n }\n }", "public function reset_db_sessions()\n\t{\n\t\t$ttl = (int)Phpr::$config->get('STORED_SESSION_TTL', 3);\n\t\tDb_Helper::query('delete from db_session_data where created_at < DATE_SUB(now(), INTERVAL :seconds SECOND)', array('seconds'=>$ttl));\n\t}", "public static function destroy_all()\n\t{\n\t\t$_SESSION['Session_Master'] = array();\n\t}", "public function reset_session() {\n\t\tSession::instance()\n\t\t\t->destroy();\n\t\tSession::$instances = array();\n\t}", "public static function destroy() {\t\t\t\n\t\t\tself::start();\n\t\t\tsession_regenerate_id(true); \n\t\t\t\n\t\t\tunset($_SESSION);\n\t\t\tsession_destroy();\n\t\t}", "function wp_destroy_all_sessions()\n {\n }", "public function resetDbSessions()\n {\n $ttl = (int)Phpr::$config->get('STORED_SESSION_TTL', 3);\n Db_DbHelper::query(\n 'delete from db_session_data where created_at < DATE_SUB(now(), INTERVAL :seconds SECOND)',\n array('seconds' => $ttl)\n );\n }", "function deleteSession()\n{\n\tif (!$this->sessName) return;\n\t$this->app->deleteSession($this->sessName);\n}", "function wp_destroy_other_sessions()\n {\n }", "function db_pwassist_session_gc()\n{\n\tglobal $pear_session_db,$ilDB;\n\n\t$q = \"DELETE FROM usr_pwassist \".\n\t\t \"WHERE expires < \".$ilDB->quote(time(), \"integer\");\n\t$ilDB->manipulate($q);\n\t\n\treturn true;\n}", "protected function cleanup() {\n $this->clearLocalSessionValues();\n }", "public function purge(): void\n {\n $this->start();\n\n $session = $_SESSION ?? [];\n $prefix = $this->sessionPrefix . '_';\n\n if ([] !== $session) {\n while ($sessionKey = key($session)) {\n if (mb_substr($sessionKey, 0, mb_strlen($prefix)) === $prefix) {\n unset($_SESSION[$sessionKey]);\n }\n\n next($session);\n }\n }\n }", "function clear_session()\n\t{\n\t\t$fields = array('institution__institutions'=>'', 'role__jobroles'=>'', 'headline'=>'', 'summary'=>'', 'details'=>'', 'publishstart'=>'', 'publishend'=>'');\n\t\t$this->native_session->delete_all($fields);\n\t}", "public function kill()\n {\n session_regenerate_id();\n $_SESSION[CCID] = array(); // session_unset();\n session_destroy();\n }", "public static function destroy(){\n unset($_SESSION[self::$appSessionName]);\n }", "public function _sess_gc(){}", "public function clean() {\n\t\t$sess = ORM::for_table($this->session_type)\n\t\t\t->where_lt('expired', date('Y-m-d H:i:s'))\n\t\t\t->find_many();\n\t\tif($sess != false) {\n\t\t\tforeach($sess as $s) {\n\t\t\t\t$s->delete();\n\t\t\t}\n\t\t}\n\t}", "function clearSession(){\n\t\t\n\t\t$this->dm->session->sess_destroy();\n }", "public function clearAll() {\n $this->startSession();\n $_SESSION = array();\n $this->sessionData = null;\n session_write_close();\n }", "public function CleanSession()\n {\n unset($_SESSION[SESSION_ENTRY]);\n }", "public function __destruct()\n {\n foreach (static::$sessions as $session_id => $session) {\n try {\n static::$retry->retry(function () use ($session) {\n $session->delete();\n }, true);\n } catch (\\Exception $e) {\n }\n }\n }", "public function destroySession() {}", "public function testGc()\n {\n ini_set(\"session.gc_maxlifetime\",3);\n $redis=\\RWKY\\Redis\\setUpRedis();\n \\RWKY\\Redis\\RedisSessions::$redis=$redis;\n \\RWKY\\Redis\\RedisSessions::$hash=\"hash\";\n $this->assertEmpty($redis->keys(\"*\"));\n session_start();\n $_SESSION[\"test\"]=1;\n session_write_close();\n $this->assertNotEmpty($redis->keys(\"*\"));\n sleep(5);\n $this->assertTrue(\\RWKY\\Redis\\RedisSessions::gc());\n $this->assertEmpty($redis->keys(\"*\"));\n \\RWKY\\Redis\\RedisSessions::$hash=null;\n session_start();\n $_SESSION[\"test\"]=1;\n session_write_close();\n $this->assertNotEmpty($redis->keys(\"*\"));\n sleep(5);\n $this->assertTrue(\\RWKY\\Redis\\RedisSessions::gc());\n $this->assertEmpty($redis->keys(\"*\"));\n \n }", "public function deleteSession(): void {\n\t\tunset($_SESSION[self::SESSION_NAME]);\n\t}", "static function destroy() {\n\t\tsession_unset();\n\t\tsession_destroy();\n\t\tsession_write_close();\n\t}", "public static function destroy()\n {\n $_SESSION = [];\n session_destroy();\n }", "public function sess_destroy() {\n\t\tsession_unset();\n\t\tif (isset($_COOKIE[session_name()])) {\n\t\t\tsetcookie(session_name(), '', time()-42000, '/');\n }\n session_destroy();\n }", "function destroySession(){\n\t\tforeach ($_SESSION as $key => $value) {\n\t\t\t$_SESSION[$key] = \"\";\n\t\t}\n\t\tsession_unset();\n\t\tsession_destroy();\n\t}", "public function unsetSession();", "function session_clean()\n {\n session_unset();\n }", "public static function destroySession();", "function destroy()\r\n {\r\n unset($_SESSION[$this->_options['sessionVar']]);\r\n }", "function cleanSession ()\n{\n\t$_SESSION = array();\n\t\n\t// Finally, destroy the session.\n//\tsession_destroy();\n}", "function session_clear() {\n $exists = \"no\";\n $session_array = explode(\";\",session_encode());\n for ($x = 0; $x < count($session_array); $x++) {\n $name = substr($session_array[$x], 0, strpos($session_array[$x],\"|\")); \n\tif (session_is_registered($name)) {\n\t session_unregister($name);\n\t $exists = \"yes\";\n\t}\n }\n if ($exists != \"no\") {\n session_destroy();\n }\n}", "public static function invalidate() {\n\t //remove session cookie from browser\n\t if ( isset( $_COOKIE[session_name()] ) ) {\n\t setcookie( session_name(), \"\", time()-3600, \"/\" );\n\t }\n\t //clear session\n\t self::clear();\n\t //clear session from disk\n\t session_destroy();\n\t}", "public function clearCache()\n {\n $tokens = $this->session()->getTokens();\n\n $tokens->deleteAll();\n $this->session()->destroy();\n $this->log()->notice('Your saved machine tokens have been deleted and you have been logged out.');\n }", "public static function destroy(): void\n {\n Session::remove(self::SESSION_KEY);\n }", "public function clear()\n {\n $this->session->sess_destroy();\n }", "public function destroy()\n\t{\n\t\tif (!session_id())\n\t\t\tsession_start();\n\n\t\t$_SESSION = array();\n\t\tsession_destroy();\n\t}", "public function destroy()\n {\n $this->session_open();\n $_SESSION = array();\n session_destroy();\n }", "public static function RemoveStaleSessions()\n {\n global $SESSDB;\n\n $time = time();\n\n // First delete everything in sdat that is data for an expired session\n $q = $SESSDB->prepare(\"DELETE FROM `sdat` WHERE sdat.id IN(SELECT smap.id FROM `smap` WHERE deleteafter < :time)\");\n $q->bindParam(':time', $time);\n $q->execute();\n\n // Now delete the entries in smap\n $q = $SESSDB->prepare(\"DELETE FROM `smap` WHERE deleteafter < :time\");\n $q->bindParam(':time', $time);\n $q->execute();\n }", "public function cleanup(){\n\t\n\t\t$this->_p->user->setSessionVal($this->_session_var_name);\n\t\n\t}", "function clear_expired_sessions() {\n $dbh = DB::connect();\n $timeout = config_get_int('options', 'login_timeout');\n $q = \"DELETE FROM Sessions WHERE ts < (UNIX_TIMESTAMP() - \" . $timeout . \")\";\n $dbh->exec($q);\n}", "public function clear()\n {\n $this->session = array();\n\n if (array_key_exists($this->namespace, $_SESSION)) {\n unset($_SESSION[$this->namespace]);\n }\n }", "public function clear(){\n @session_destroy();\n @session_start();\n }", "public function destroy() {\n $this->closeSession();\n\n $_SESSION = array();\n\n session_destroy();\n\n // Reset cookies\n setcookie(session_name(), '', time()-3600, Route::getDir());\n }", "function destroySession(){\n\t\t//@session_destroy();\n\t\t//unset($_SESSION);\n\t\t$this->unsetSession('User');\n\t}", "static public function flush()\n\t{\n\t\tFactory::getInstance( 'Session' )->remove( self::$session_group );\n\t}", "public function removeSessionData() {}", "public function DeleteAll()\n\t{\n\t\tif (isset($_SESSION))\n\t\t\t$this->Delete($_SESSION);\n\t\t\n\t\tsession_destroy();\n\t}", "public function deleteAll() {\n\n $this->start();\n $_SESSION = array();\n\n }", "public function destroy()\n {\n // no need to destroy new or destroyed sessions\n if ($this->tokenExpiry === null || $this->destroyed === true) {\n return;\n }\n\n // remove session file\n $this->sessions->store()->destroy($this->tokenExpiry, $this->tokenId);\n $this->destroyed = true;\n $this->writeMode = false;\n $this->needsRetransmission = false;\n\n // remove cookie\n if ($this->mode === 'cookie') {\n Cookie::remove($this->sessions->cookieName());\n }\n }", "public function reset()\n\t{\n\t\tforeach ($_SESSION as $name=>$value)\n\t\t\tunset($_SESSION[$name]);\n\t\t\t\n\t\t$this->reset_db_sessions();\n\t}", "public static function killSession (){\n\n $db = new db();\n $db->delete('system_cookie', 'cookie_id', @$_COOKIE['system_cookie']);\n \n setcookie (\"system_cookie\", \"\", time() - 3600, \"/\");\n unset($_SESSION['id'], $_SESSION['admin'], $_SESSION['super'], $_SESSION['account_type']);\n session_destroy();\n }", "public static function unsetAllSessionOnSite() {\n session_unset();\n session_destroy();\n }", "function _gc($life) {\n\t\t$limit = date('Y-m-d G:i:s', strtotime(\"-12 hours\") );\n\t\t#$sessionPath = $_SERVER['DOCUMENT_ROOT'] . '/phpSession';\n\t\t$sessionPath = dirname(__FILE__).\"/../phpSession\";\n\t\t$query = \"Select id from phpSession where lastAccess < '$limit'\";\n\t\t$result = mysql_query ($query, $this->db);\n\t\twhile ( $temp = mysql_fetch_object ($result) ) {\n\t\t\t$this->recursiveDelete (\"$sessionPath/$temp->id\");\n\t\t}\n\t\t$query = \"Delete from phpSession where lastAccess < '$limit'\";\n\t\t$result = mysql_query ($query, $this->db);\n\t\t$query = \"Optimize table phpSession\";\n\t\t$result = mysql_query ($query, $this->db);\n\t\treturn true;\n\t}", "public function gc()\n {\n $this->delete(array(\n 'creation_date < ?' => date('Y-m-d H:i:s', time() - (3600 * 24)),\n ));\n }", "public function clearSession()\n {\n unset($_SESSION['opencast']['files'][$this->name]);\n if(is_array($_SESSION['opencast']['files'])) \n {\n foreach($_SESSION['opencast']['files'] as $key => $file) {\n if($file['time'] < (time() - \n (60 * 60 * 24 * OC_CLEAN_SESSION_AFTER_DAYS )) )\n {\n unset($_SESSION['opencast']['files'][$key]);\n }\n }\n }\n }", "function clear() \n\t{\n\t\t//If there is no session to delete (not started)\n\t\tif (session_id() === '') return;\n\n\t\t// Get the session name\n\t\t$name = session_name();\n\n\t\t// Destroy the session\n\t\tsession_destroy();\n\n\t\t// Delete the session cookie (if exists)\n\t\tif (isset($_COOKIE[$name])) \n\t\t{\n\t\t\t//Get the current cookie config\n\t\t\t$params = session_get_cookie_params();\n\n\t\t\t// Delete the cookie from globals\n\t\t\tunset($_COOKIE[$name]);\n\n\t\t\t//Delete the cookie on the user_agent\n\t\t\tsetcookie($name, '', time()-43200, $params['path'], $params['domain'], $params['secure']);\n\t\t}\n\t}", "protected function clearSession(): void\n {\n $this->get('session')->clear();\n $session = new Session();\n $session->invalidate();\n }", "public static function DestroySession(){\n\t\tself::$_leuser=NULL; \n\t\t//unset(User::$_leuser);\n\t\tunset($_SESSION['user']);\n\t}", "public function destory()\n\t{\n\t\t$key = $this->getKey();\n\t\tif ( isset($_SESSION[$key]) ) unset($_SESSION[$key], $key);\n\t}", "private function clear() {\n $_SESSION = array();\n\n // Destroy the session cookie and cookie header\n $sessionCookie = Cookie::loadCookie(session_name());\n $sessionCookie->unset();\n $sessionCookie->delete();\n\n // Clear out other possible values\n if (isset($_GET[session_name()]))\n unset($_GET[session_name()]);\n\n if (isset($_POST[session_name()]))\n unset($_POST[session_name()]);\n }", "function purge_old_sessions() {\n\t$old_time = time() - (15*60); // time 15 minutes ago\n\t\n\t$query = \"DELETE FROM \" . $GLOBALS['db_name'] . \".sessions WHERE session_time < '$old_time'\";\n\n\tif ($GLOBALS['db_connection'] -> query($query) === TRUE) {\n\t\treturn TRUE;\n\t} else {\n\t \tdisplay_sql_error();\n\t}\n}", "public static function destroy()\n {\n if(!isset($_SESSION)){\n session_start();\n }\n session_destroy();\n }", "public function destroy(){\n\t\tsession_unset();\n\t\t$id = $this->getId();\n\t\tif (!empty($id)) {\n\t\t\tsession_destroy();\n\t\t}\n\t}", "public static function sessionCleanHandler();", "private function destroySession () : void {\n unset($_SESSION);\n session_destroy();\n }", "protected function clearAllPersistentData()\n {\n foreach ($this->_sessionNamespace as $key => $value) {\n unset($this->_sessionNamespace->{$key});\n }\n }", "function unset_sessions() {\n wp_session_unset();\n }", "public function unload()\n {\n // cannot unload started sessions\n if ($this->isStarted()) {\n return;\n }\n $this->_is_loaded = false;\n $this->_store = array();\n $this->_flash = array();\n }", "public static function destroy()\r\n {\r\n if (self::isStarted())\r\n {\r\n session_unset();\r\n session_destroy();\r\n }\r\n }", "protected static function unsetSessionData() {\n if (isset(self::$_session)) {\n self::$_session = array();\n } else {\n unset($_SESSION['salesforce_wsdl']);\n unset($_SESSION['salesforce_location']);\n unset($_SESSION['salesforce_sessionId']);\n }\n }", "function clearConfigSession()\n {\n \t//clear session db info\n\t\t$this->setGeneralSession('db_name', '');\n\t\t$this->setGeneralSession('db_username', '');\n\t\t$this->setGeneralSession('db_password', '');\n\t\t$this->setGeneralSession('status', '');\n }", "function clean_session() {\n\t tep_session_unregister('enroll_lookup_attempted');\n\t tep_session_unregister('authentication_attempted');\n\t tep_session_unregister('transactionId');\n\t tep_session_unregister('enrolled');\n\t tep_session_unregister('acsURL');\n\t tep_session_unregister('payload');\n\t tep_session_unregister('auth_status');\n\t tep_session_unregister('sig_status');\n\t tep_session_unregister('auth_xid');\n\t tep_session_unregister('auth_cavv');\n\t tep_session_unregister('auth_eci');\n\t}", "protected function deleteOtherSessionRecords(): void\n {\n if (config('session.driver') !== 'database') {\n return;\n }\n\n DB::connection(config('session.connection'))->table(config('session.table', 'sessions'))\n ->where('user_id', Auth::user()?->getAuthIdentifier())\n ->where('id', '!=', session()->getId())\n ->delete();\n }", "public function destroy(): void\n {\n if (!empty($_SESSION)) {\n $_SESSION = [];\n session_unset();\n session_destroy();\n }\n }", "function _gc($life=false) {\n\t\t$sessionlife = ($life) ? $life : strtotime('-10 minutes');\n\t\t$qry = \"DELETE FROM \" . TABLEPREFIX . \"sessions WHERE sessiontime < \" . $sessionlife;\n\t\t$result = $this->DbConnection->Query($qry);\n\t\treturn $result;\n\t}", "public static function destroy()\n {\n session_unset();\n session_destroy();\n }", "function __destruct()\n {\n session_write_close();\n }", "public function logout() {\n $s = Session::getInstance();\n $key = $this->sessionId;\n unset($s->$key);\n $this->setAuthed(false);\n }", "public static function destroy() {\n if ('' !== session_id()) {\n $_SESSION = array();\n // If it's desired to kill the session, also delete the session cookie.\n // Note: This will destroy the session, and not just the session data!\n if (ini_get(\"session.use_cookies\")) {\n $params = session_get_cookie_params();\n setcookie(session_name(), '', time() - 42000,\n $params[\"path\"], $params[\"domain\"],\n $params[\"secure\"], $params[\"httponly\"]\n );\n }\n session_destroy();\n }\n }", "public function forgetSession()\n\t{\n\t\tif (isset($_SESSION[$this->getKey()]))\n\t\t{\n\t\t\tunset($_SESSION[$this->getKey()]);\n\t\t}\n\t}", "function clearSession(){\n\tsession_destroy();\n}" ]
[ "0.8319907", "0.8187626", "0.7754206", "0.77426237", "0.7693593", "0.76826644", "0.76817435", "0.7603903", "0.7582027", "0.7472482", "0.74605674", "0.74484473", "0.7440818", "0.7419568", "0.7380221", "0.7361422", "0.73577166", "0.7352371", "0.734091", "0.73347056", "0.73329985", "0.7328329", "0.7324521", "0.7286403", "0.7271661", "0.7254028", "0.7242079", "0.72418827", "0.72390497", "0.7236006", "0.72277844", "0.719263", "0.7191098", "0.7185535", "0.71555394", "0.715053", "0.71479326", "0.7146807", "0.7141666", "0.71146464", "0.7113548", "0.71009195", "0.7096345", "0.7088976", "0.7078052", "0.70755863", "0.70487255", "0.7006647", "0.70055753", "0.69974643", "0.6994001", "0.69923675", "0.6961857", "0.6932327", "0.6924212", "0.69232804", "0.69187236", "0.691612", "0.6915942", "0.691121", "0.69096696", "0.6903658", "0.6888759", "0.68852407", "0.6884338", "0.68734884", "0.6873184", "0.68701166", "0.6857858", "0.6851509", "0.68423885", "0.6841793", "0.6840959", "0.6835991", "0.68320954", "0.6829826", "0.6825139", "0.6802124", "0.6801424", "0.68012965", "0.6796772", "0.67946535", "0.67774475", "0.6764252", "0.6753352", "0.67502475", "0.6747293", "0.6747094", "0.67391956", "0.67373776", "0.67275876", "0.67209834", "0.67185897", "0.6717911", "0.67171514", "0.6714455", "0.67111063", "0.6704842", "0.6704531", "0.669774", "0.66876894" ]
0.0
-1
Sets the $arguments properties.
private function setArguments() { return array( 'labels' => $this->labels, 'public' => $this->public, 'menuIcon' => $this->menuIcon, 'capabilities' => $this->capabilities, 'supports' => $this->supports, ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setArguments($arguments)\n {\n $this->arguments = $arguments;\n }", "public function setArguments(array $arguments);", "public function setArguments(...$arguments) {\n $this->arguments = $arguments;\n return $this;\n }", "public function setArguments(array $arguments = [])\n {\n $this->arguments = [];\n $this->requiredCount = 0;\n $this->lastOptionalArgument = null;\n $this->lastArrayArgument = null;\n $this->addArguments($arguments);\n }", "public function setArguments(array $arguments): self\n {\n $this->_arguments = $arguments;\n return $this;\n }", "public function setArguments(array $arguments): self\n {\n $this->arguments = $arguments;\n\n return $this;\n }", "public function setArguments($args)\n {\n $this->arguments = $args;\n }", "public function setArguments(array $args);", "public function setArguments($args) {\n $this->args= $args;\n }", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function setWrapperArguments($arguments) {\n\t\tforeach ($arguments as $key => $value) {\n\t\t\t$this->setWrapperArgument($key, $value);\n\t\t}\n\t}", "protected function setArguments( array $aArguments=array() ) {\n $this->oProp->aPostTypeArgs = $aArguments;\n }", "public function setArguments(array $arguments = null)\n {\n $this->arguments = $arguments;\n\n return $this;\n }", "public function setArguments(array $arguments)\n {\n $this->getProcessBuilder()->setArguments($arguments);\n\n return $this;\n }", "public function __construct(array $arguments)\n {\n $this->arguments = $arguments;\n }", "public function __construct()\n {\n $this->arguments = func_get_args();\n }", "public function setActionArguments(array $arguments) : static\n {\n \\ksort($arguments);\n $this->actionArguments = $arguments;\n return $this;\n }", "public function __construct(...$arguments)\n {\n $this->arguments = $arguments;\n $this->argumentsCount = count($arguments);\n $this->index = [];\n $this->callables = [];\n }", "public function setArguments(\\Yana\\Http\\Requests\\ValueWrapper $arguments)\n {\n $this->_arguments = $arguments;\n return $this;\n }", "protected function setArgument()\n {\n $this->set('primary_key', false);\n $this->set('length', $this->argument);\n $this->set('autoincrement', false);\n $this->set('unsigned', false);\n $this->set('not_null', false);\n }", "public function prepareArguments() {}", "public function setupSupportedArgs($arguments = [])\n {\n $defaults = [\n 'help' => 'The help menu',\n ];\n\n $arguments = array_merge($defaults, $arguments);\n\n $this->supportedArgs = $arguments;\n\n return $this;\n }", "protected function setArgs($args) {\n $this->args = is_array($args) ? $args : array();\n }", "public function addArguments($arguments)\n\t{\n\t\t$this->arguments->addArguments($arguments);\t\n\t\t\n\t\treturn $this;\n\t}", "private function setArgs(){\n\t\t$this->args = array(\n\t\t\t'label' => $this->label,\n\t\t\t'labels' => $this->labels,\n\t\t\t'description' => $this->description,\n\t\t\t'public' => $this->public,\n\t\t\t'exclude_from_search' => $this->excludeSearch,\n\t\t\t'publicly_queryable' => $this->publiclyQueryable,\n\t\t\t'show_ui' => $this->show_ui ,\n\t\t\t'show_in_nav_menus' => $this->showInNavMenus,\n\t\t\t'show_in_menu' => $this->showInMenu,\n\t\t\t'show_in_admin_bar' => $this->showInAdminBar,\n\t\t\t'menu_position' => $this->menuPosition,\n\t\t\t'menu_icon' => $this->menuIcon,\n\t\t\t'capability_type' => $this->capabilityType,\n\t\t\t'map_meta_cap' => $this->mapMetaCap,\n\t\t\t'hierarchical' => $this->hierarchical,\n\t\t\t'supports' => $this->supports,\n\t\t\t'register_meta_box_cb' => $this->registerMetaBoxCb,\n\t\t\t'taxonomies' => $this->taxonomies,\n\t\t\t'has_archive' => $this->hasArchive,\n\t\t\t'permalink_epmask' => $this->permalinkEpmask,\n\t\t\t'rewrite' => $this->rewrite,\n\t\t\t'query_var' => $this->queryVar,\n\t\t\t'can_export' => $this->canExport,\n\t\t\t'_builtin' => $this->builtin\n\t\t);\n\t}", "protected function setCliArguments() {}", "public function set_props($args)\n {\n }", "public function initCallArguments() {\n\t\t$request = GeneralUtility::_GP('request');\n\t\tif ($request) {\n\t\t\t$this->setRequestArgumentsFromJSON($request);\n\t\t} else {\n\t\t\t$this->setRequestArgumentsFromGetPost();\n\t\t}\n\t\treturn $this->setVendorName($this->requestArguments['vendorName'])\n\t\t\t->setExtensionName($this->requestArguments['extensionName'])\n\t\t\t->setPluginName($this->requestArguments['pluginName'])\n\t\t\t->setControllerName($this->requestArguments['controllerName'])\n\t\t\t->setActionName($this->requestArguments['actionName'])\n\t\t\t->setFormatName($this->requestArguments['formatName'])\n\t\t\t->setArguments($this->requestArguments['arguments']);\n\t}", "private function extractArguments(array $arguments)\n {\n $this->namespace = Arr::get($arguments, 0);\n $this->entity = Arr::get($arguments, 1);\n $this->view = Arr::get($arguments, 2);\n $this->name = Arr::get($arguments, 3);\n }", "public function addArguments(?array $arguments = [])\n {\n if (null !== $arguments) {\n foreach ($arguments as $argument) {\n $this->addArgument($argument);\n }\n }\n }", "protected function initializeCommandMethodArguments() {}", "public function __construct(array $arguments)\n {\n foreach ($arguments as $argumentName => $argumentValue) {\n if (!property_exists($this, $argumentName)) {\n throw new \\LogicException(sprintf('Attempting to set undefined property %s on %s',\n $argumentName, get_class($this))\n );\n }\n $this->$argumentName = $argumentValue;\n }\n }", "public function mergeArguments(array $arguments);", "public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerArgument('section', 'string', 'Section to render - combine with partial to render section in partial', false, null);\n $this->registerArgument('partial', 'string', 'Partial to render, with or without section', false, null);\n $this->registerArgument('arguments', 'array', 'Array of variables to be transferred. Use {_all} for all variables', false, []);\n $this->registerArgument('optional', 'boolean', 'If TRUE, considers the *section* optional. Partial never is.', false, false);\n $this->registerArgument('default', 'mixed', 'Value (usually string) to be displayed if the section or partial does not exist', false, null);\n $this->registerArgument('contentAs', 'string', 'If used, renders the child content and adds it as a template variable with this name for use in the partial/section', false, null);\n }", "public function __construct(array $arguments = array()) {\n\n\t}", "public function testOoCanSetGetArguments()\n {\n $arguments = [new Command\\Argument('all'), new Command\\Argument('list')];\n $command = $this->createInstance();\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n $this->assertSame($arguments, $command->getArguments(), 'Must be able to get and set multiple argument objects');\n }", "public function setArgs($args = array()) {\n if (!is_array($args)) {\n return false;\n }\n \n $this->args = $args;\n }", "private function setArguments()\n {\n $args = $this->data;\n $match = explode(\"/\", $this->routeMatch);\n\n // remove the domain part.\n foreach ($this->domains as $value) {\n // search for domain on url array.\n // array_search(needle, haystack)\n $index = array_search($value, $args);\n unset($args[$index]);\n\n // search for domain on matched route.\n $index = array_search($value, $match);\n unset($match[$index]);\n }\n\n // find the action part in url data and the matched route string.\n // preg_grep(pattern, input)\n $this->action = preg_grep(\"/^{$this->wildcards[':action']}$/\", $args);\n $matchAction = preg_grep(\"/^{$this->wildcards[':action']}$/\", $match);\n if ( !empty($this->action) )\n {\n // convert action from array to string.\n // find action in url data.\n // remove from url data.\n $this->action = array_shift($this->action);\n $index = array_search($this->action, $args);\n unset($args[$index]);\n\n $matchAction = array_shift($matchAction);\n $index = array_search($matchAction, $match);\n unset($match[$index]);\n }\n\n // get the arguments from url data\n // get the key from the wildcard. :id, :yyyy, :dd, etc.\n foreach ($args as $arg) {\n $key = $this->matchWildcard($match, $arg);\n $this->arguments[$key] = $arg;\n }\n }", "public function __call($name, $arguments)\n {\n if (Str::of($name)->contains('set')) {\n $name = Str::of($name)\n ->replace('set', '')\n ->snake();\n\n $this->{$name} = Arr::first($arguments);\n\n $this->touchedBySetter[] = (string) $name;\n\n return $this;\n }\n\n return null;\n }", "public function testCanSetGetArguments()\n {\n $arguments = ['--human-readable', '--all'];\n $command = $this->createInstance();\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n $this->assertSame($arguments, $command->getArguments(), 'Must be able to get and set multiple arguments');\n }", "public function setArguments(array $args) : DefinitionInterface;", "protected function arguments(array $arguments = null): array\n {\n return is_null($arguments)\n ? $this->arguments\n : ($this->arguments = $arguments);\n }", "protected function injectArguments($arguments, &$preparedArguments) {\n\t\tforeach ($arguments as $argument) {\n\t\t\tif ($argument !== NULL) {\n\t\t\t\t$argumentValue = $argument->getValue();\n\t\t\t\tswitch ($argument->getType()) {\n\t\t\t\t\tcase \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_OBJECT:\n\t\t\t\t\t\tif ($argumentValue instanceof \\F3\\FLOW3\\Object\\Configuration\\Configuration) {\n\t\t\t\t\t\t\t$preparedArguments[] = $this->build($argumentValue);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (strpos($argumentValue, '.') !== FALSE) {\n\t\t\t\t\t\t\t\t$settingPath = array_slice(explode('.', $argumentValue), 1);\n\t\t\t\t\t\t\t\t$argumentValue = \\F3\\FLOW3\\Utility\\Arrays::getValueByPath($this->settings['FLOW3'], $settingPath);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$preparedArguments[] = $this->get($argumentValue);\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE:\n\t\t\t\t\t\t$preparedArguments[] = $argumentValue;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_SETTING:\n\t\t\t\t\t\tif (strpos($argumentValue, '.') !== FALSE) {\n\t\t\t\t\t\t\t$settingPath = array_slice(explode('.', $argumentValue), 1);\n\t\t\t\t\t\t\t$value = \\F3\\FLOW3\\Utility\\Arrays::getValueByPath($this->settings['FLOW3'], $settingPath);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($argumentValue !== 'FLOW3') {\n\t\t\t\t\t\t\t\tthrow new \\F3\\FLOW3\\Object\\Exception\\CannotBuildObjectException('Invalid reference to setting \"' . $argumentValue . '\" in object configuration for Dynamic Object Container.', 1265200443);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$value = $this->settings['FLOW3'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$preparedArguments[] = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$preparedArguments[] = NULL;\n\t\t\t}\n\t\t}\n\t}", "public function setArgs(array $args) : self\n {\n $this->initialized['args'] = true;\n $this->args = $args;\n return $this;\n }", "public function setArgs($values) {\n $this->impl->setArgs($this->context, $values);\n return $this;\n }", "function change_arguments( $args ) {\n //$args['dev_mode'] = true;\n\n return $args;\n }", "function change_arguments( $args ) {\n //$args['dev_mode'] = true;\n\n return $args;\n }", "public function __construct($arguments = null) {\n if (!is_null($arguments) && is_array($arguments) && !empty($arguments)) {\n\n // argument count\n $this->argument_count = count($arguments);\n\n // get script name\n $this->name = basename($arguments[0]);\n $this->path = dirname($arguments[0]);\n\n $args = ScriptArgs::arguments($arguments);\n $arg_count = 0;\n \n $this->flags = new DataStore();\n $this->arguments = new DataStore();\n\n // handle the options\n $this->options = new DataStore($args['options']);\n\n // loop over the flags\n foreach ($args['flags'] as $flag) {\n $this->flags->set($flag,true); \n }\n\n // determine which argument group to use\n if (count($args['commands']) > 0) {\n $args_list = $args['commands'];\n }\n else {\n $args_list = $args['arguments'];\n }\n\n // loop over the arguments\n foreach ($args_list as $argument) {\n // increment arg_count\n $arg_count++;\n $this->arguments->set(\"arg\" . $arg_count,new Parameter($argument)); \n }\n }\n\n }", "protected function getArguments()\n {\n\n }", "public function invokeArgs( Array $arguments ) {\n /*\n return $this->forwardCallToReflectionSource( __FUNCTION__, array( $arguments ) );\n /*/\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->invokeArgs( $arguments );\n } else {\n return parent::invokeArgs( $arguments );\n }\n //*/\n }", "public function moveAllOtherUserdefinedPropertiesToAdditionalArguments() {}", "public function addWithArguments(array $arguments = null)\n {\n $this->arguments = array_merge($this->arguments, $arguments);\n\n return $this;\n }", "public function setup( $args = array() ) {\n\t\t\t$this->args = $args;\n\t\t}", "public function __invoke($arguments)\n {\n\n }", "protected function set_up() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n {\n parent::set_up();\n $this->globalArguments = $GLOBALS['argv'];\n }", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "private static function arguments($arguments=false) {\n\t\t//convert arguments to array\n\t\tif (empty($arguments)) return array();\n\n\t\t//arguments can be string for shorthand, class or prepend with # for id\n\t\tif (is_string($arguments)) {\n\t\t\tif ($id = str::starts($arguments, '#')) {\n\t\t\t\t$arguments = array('id'=>$id);\n\t\t\t} else {\n\t\t\t\t$arguments = array('class'=>$arguments);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//clean up classes\n\t\tif (!empty($arguments['class']) && stristr($arguments['class'], ' ')) {\n\t\t\t$arguments['class'] = implode(' ', array_values(array_filter(array_unique(explode(' ', $arguments['class'])))));\n\t\t}\n\t\t\n\t\treturn $arguments;\n\t}", "public function cleanArgs()\n {\n $this->arguments = array();\n\n return $this;\n }", "protected function prepareArgs(array $arguments = [])\n {\n $arguments = $arguments + array_filter(array_map(function ($arg) {\n if (isset($this->args[$arg->getName()])) {\n return $this->args[$arg->getName()];\n }\n\n if ($arg->isDefaultValueAvailable()) {\n return $arg->getDefaultValue();\n }\n\n return null;\n }, $this->reflection->getParameters()));\n\n return $arguments;\n }", "public function setArguments($args)\n {\n if (!is_array($args)) {\n $args = array($args);\n }\n\n if (array_keys($args) === range(0, count($args) - 1)) {\n // sequential array means pass bare arguments, not option=value pairs.\n foreach ($args as $arg) {\n $this->arguments[] = escapeshellarg($arg);\n }\n } else {\n // associative array means pass option=value pairs.\n foreach ($args as $option => $value) {\n if (empty($value)) {\n $this->arguments[$option] = '';\n } else {\n $this->arguments[$option] = escapeshellarg($value);\n }\n }\n }\n }", "public function setArgs(array $args)\n {\n $this->_args = array_merge($this->_args, $args);\n return $this;\n }", "private static function processArgs( $arguments )\n\t {\n\t\t$args = array();\n\t\tforeach ( $arguments as $arg ) {\n\t\t\tif ( is_array( $arg ) ) {\n\t\t\t\t$args = array_merge( $args, $arg );\n\t\t\t} else {\n\t\t\t\t$exp = explode( '=', $arg, 2 );\n\t\t\t\t$args[$exp[0]] = $exp[1];\n\t\t\t}\n\t\t}\n\t\treturn $args;\n\t }", "public function __construct(array $arguments) {\t\t\n\t\tlist ($this->command, \n\t\t\t $this->arguments,\n\t\t\t $this->flags) = $this->parseArguments(array_slice($arguments, 1));\n\t\t\t\n\t\tif (is_null($this->command)) {\n\t\t\tif (in_array('--version', $this->flags)) {\n\t\t\t\techo 'This is Cobweb ' . Cobweb::VERSION;\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\t\n\t\t\t$this->fail('Specify a command to invoke');\n\t\t}\n\t\t\n\t\t$this->command = $this->loadCommand($this->command);\n\t}", "public function handleArguments(array $arguments)\n\t{\n\t\ttry {\n\t\t\t$this->config->useArguments($arguments);\n\t\t}\n\t\tcatch (InvalidArgumentException $e)\n\t\t{\n\t\t\tdie($e->getMessage() . \"\\n\");\n\t\t}\n\t\t\n\t\trequire_once(dirname(__FILE__).'/../../../../www/config.php');\n\t}", "private function specifyParameters(): void\n {\n // We will loop through all of the arguments and options for the command and\n // set them all on the base command instance. This specifies what can get\n // passed into these commands as \"parameters\" to control the execution.\n foreach ($this->getArguments() as $arguments) {\n $this->addArgument(...$arguments);\n }\n\n foreach ($this->getOptions() as $options) {\n $this->addOption(...$options);\n }\n }", "public function distributeArguments(array $arguments)\n {\n return $this->__invoke(...$arguments);\n }", "private function processArguments(array $arguments)\n {\n foreach ($arguments as $k => $argument) {\n if (is_array($argument)) {\n $arguments[$k] = $this->processArguments($argument);\n } elseif ($argument instanceof Reference) {\n $defId = $this->getDefinitionId($id = (string) $argument);\n\n if ($defId !== $id) {\n $arguments[$k] = new Reference($defId, $argument->getInvalidBehavior());\n }\n }\n }\n\n return $arguments;\n }", "public function setArguments($options)\n {\n $this->setOption('filename', $options, null);\n $this->setOption('output', $options, 'output');\n $this->setOption('format', $options, $this->pandocBroken ? 'markdown_github' : 'gfm+raw_html');\n $this->setOption('flatten', $options);\n $this->setOption('addmeta', $options);\n $this->setOption('luafilter', $options);\n $this->setOption('template', $options);\n $this->output = rtrim($this->output, '/') . '/';\n }", "public function getArguments();", "public function getArguments();", "public function getArguments();", "public function getArguments();", "public function getArguments()\n {\n return $this->arguments;\n }", "public function getArguments()\n {\n return $this->arguments;\n }", "public function getArguments()\n {\n return $this->arguments;\n }", "public function withArguments(array $args);", "protected function specifyParameters()\n {\n // We will loop through all of the arguments and options for the command and\n // set them all on the base command instance. This specifies what can get\n // passed into these commands as \"parameters\" to control the execution.\n foreach ($this->getArguments() as $arguments) {\n call_user_func_array([$this, 'addArgument'], $arguments);\n }\n foreach ($this->getOptions() as $options) {\n call_user_func_array([$this, 'addOption'], $options);\n }\n }", "public function finalArguments($self, Arguments $arguments): Arguments\n {\n $finalArguments = $this->arguments->all();\n\n if ($this->prefixSelf) {\n array_unshift($finalArguments, $self);\n }\n if ($this->suffixArgumentsObject) {\n $finalArguments[] = $arguments;\n }\n\n if ($this->suffixArguments && $arguments) {\n $finalArguments = array_merge($finalArguments, $arguments->all());\n }\n\n return new Arguments($finalArguments);\n }", "public function setChildArguments($childArguments)\n {\n $this->childArguments = $childArguments;\n }", "private function _setArgsRegister( $args )\n\t{\t\t\n\t\t$this->argsRegister\t= $args;\t\t\n\t}", "public function __call($name, $arguments)\n {\n // set a property\n $property_prefix = substr($name, 0, 4);\n $property = substr($name, 4);\n if ($property_prefix == 'set_') {\n $this->{$property} = $arguments[0];\n } else if ($property_prefix == 'add_') { // add to an array property\n array_push($this->{$property}, $arguments[0]);\n } else if ($property_prefix == 'get_') { //get a property\n return $this->{$property};\n }\n return $this;\n }", "public function setArgs(array $args)\n {\n $this->args = $args;\n\n return $this;\n }", "public function setArguments(array $args = []) : Route\n {\n foreach ($args as $key => $value) {\n $this->setArgument($key, $value);\n }\n return $this;\n }", "protected function mapArguments(array $arguments): array\n {\n $keys = isset($this->mappableArguments[$this->element()]) ? $this->mappableArguments[$this->element()] : [];\n\n return array_combine(array_slice($keys, 0, count($arguments)), $arguments);\n }", "public function set_properties( $args ) {\n\n\t\t// Reset default property values\n\t\t$reset = array(\n\t\t\t'debug_mode' => false,\n\t\t\t'parant_plugin_slug' => '',\n\t\t\t'view' => plugin_dir_path( __FILE__ ) . 'wpaddons-io-sdk/view/wordpress-plugins.php',\n\t\t);\n\n\t\t// Define properties\n\t\tforeach ( $reset as $name => $default ) {\n\n\t\t\tif ( array_key_exists( $name, $args ) ) {\n\t\t\t\t// If set, use defined values\n\t\t\t\t$this->{$name} = $args[$name];\n\t\t\t} else {\n\t\t\t\t// If not set, use default values\n\t\t\t\t$this->{$name} = $default;\n\t\t\t}\n\n\t\t}\n\n\t}", "public function setArgument($name, $value);", "public function addDumpVars(array $arguments = array())\r\n\t{\r\n\t\t$this->_dumpVars = $arguments;\r\n\t\treturn $this;\r\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function initializeActionMethodArguments() {}", "public function arguments(): Arguments\n {\n return $this->arguments;\n }", "public function arguments(): Arguments\n {\n return $this->arguments;\n }" ]
[ "0.85885125", "0.8538704", "0.82100224", "0.80706704", "0.7905983", "0.7775964", "0.7695404", "0.75620294", "0.7551853", "0.74757326", "0.74757326", "0.74757326", "0.74755543", "0.74308574", "0.74129874", "0.7373583", "0.71355927", "0.70314837", "0.70069045", "0.6903506", "0.67635137", "0.6748323", "0.6738413", "0.6728988", "0.6726356", "0.66764826", "0.66721106", "0.6623753", "0.66126835", "0.6601528", "0.65930396", "0.6576613", "0.65330684", "0.6529362", "0.6515531", "0.65098536", "0.6458704", "0.64560044", "0.6451946", "0.64402133", "0.64040756", "0.63926774", "0.63728803", "0.6335884", "0.6332578", "0.63215286", "0.63202083", "0.62971294", "0.6265856", "0.6254723", "0.6246507", "0.62253207", "0.6224279", "0.6206811", "0.61964244", "0.6196077", "0.61931527", "0.6189856", "0.6155171", "0.6155171", "0.6155171", "0.6155171", "0.6151766", "0.6141164", "0.6121353", "0.61150557", "0.6103119", "0.6087839", "0.6083886", "0.60799146", "0.6053715", "0.6051937", "0.6049429", "0.60425985", "0.60337156", "0.60337156", "0.60337156", "0.60337156", "0.6031084", "0.6031084", "0.6031084", "0.60214055", "0.6021256", "0.60206395", "0.60072476", "0.59865505", "0.59787893", "0.5978661", "0.5938706", "0.5930538", "0.59154516", "0.5907861", "0.59059244", "0.5901373", "0.5901373", "0.5901373", "0.5901373", "0.5897796", "0.5884441", "0.5884441" ]
0.6545601
32
Registers the custom post type with WordPress if it does not already exists.
public function registerCustomPostType() { if (!post_type_exists($this->slug)) { register_post_type($this->slug, $this->arguments); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_post_type() {\n\t\tadd_action( 'init', array( $this, 'post_registration_callback' ), 0, 0 );\n\t}", "public function register_post_type() {\n\t\t// make sure the post type info is set - none of this will work without it!\n\t\tif ( is_null( $this->post_type ) or is_null( $this->post_type_title ) or is_null( $this->post_type_single ) )\n\t\t\treturn false;\n\n\t\t// Register post type\n\t\tregister_post_type( $this->post_type, $this->_post_type_args );\n\n\t\t// Register taxonomy for post type\n\t\tif ( ! $this->disable_post_type_categories ) {\n\t\t\tregister_taxonomy(\n\t\t\t\t$this->taxonomy_name,\n\t\t\t\tarray( $this->post_type ),\n\t\t\t\t$this->_taxonomy_args\n\t\t\t);\n\t\t} // if()\n\t}", "public function flo_reg_custom_post_type(){\n\t\t// call the methods that are registering the post types\n\t\t$this->flo_reg_forms_post_type();\n\t\t$this->flo_reg_entrie_post_type();\n\n\t\t$this->flo_register_form_entries_taxonomy();\n\t}", "public static function register_post_types() {}", "function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }", "public function register_post(): void\n {\n $args = $this->register_post_type_args();\n register_post_type($this->post_type, $args);\n }", "public function register_custom_post_type() {\n $labels = array (\n 'name' => __('Custom', self::$plugin_obj->class_name ),\n 'singular_name' => __('item', self::$plugin_obj->class_name ),\n 'add_new' => __('new item', self::$plugin_obj->class_name ),\n 'add_new_item' => __('new item', self::$plugin_obj->class_name ),\n 'new_item' => __('new item', self::$plugin_obj->class_name ),\n 'edit' => __('edit item', self::$plugin_obj->class_name ),\n 'edit_item' => __('edit item', self::$plugin_obj->class_name ),\n 'view' => __('view item', self::$plugin_obj->class_name ),\n 'view_item' => __('view item', self::$plugin_obj->class_name ),\n 'search_items' => __('search item', self::$plugin_obj->class_name ),\n 'not_found' => __('no item found', self::$plugin_obj->class_name ),\n 'not_found_in_trash' => __('no item in trash', self::$plugin_obj->class_name ),\n 'parent' => __('parent item', self::$plugin_obj->class_name )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => TRUE,\n 'publicly_queryable' => TRUE,\n 'show_ui' => TRUE,\n 'show_in_menu' => TRUE,\n 'query_var' => TRUE,\n 'capability_type' => 'page',\n 'has_archive' => TRUE,\n 'hierarchical' => TRUE,\n 'exclude_from_search' => FALSE,\n 'menu_position' => 100 ,\n 'supports' => array('title','editor','excerpt','custom-fields','revisions','thumbnail','page-attributes'),\n 'taxonomies' => array('category','post_tag')\n );\n\n register_post_type('custom', $args);\n }", "public function register_custom_post() {\n foreach ( $this->posts as $key => $value ) {\n register_post_type( $key, $value );\n }\n }", "function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}", "function register_post_types()\n {\n }", "function register_post_types(){\n }", "public function register_post_type(){\r\n //Capitilize the words and make it plural\r\n $name = ucwords( str_replace( '_', ' ', $this->post_type_name ) );\r\n $plural = $name . 's';\r\n $menupos = $this->post_type_pos;\r\n\r\n // We set the default labels based on the post type name and plural. We overwrite them with the given labels.\r\n $labels = array_merge(\r\n\r\n // Default\r\n array(\r\n 'name' => _x( $plural, 'post type general name' ),\r\n 'singular_name' => _x( $name, 'post type singular name' ),\r\n 'add_new' => _x( 'Add New', strtolower( $name ) ),\r\n 'add_new_item' => __( 'Add New ' . $name ),\r\n 'edit_item' => __( 'Edit ' . $name ),\r\n 'new_item' => __( 'New ' . $name ),\r\n 'all_items' => __( 'All ' . $plural ),\r\n 'view_item' => __( 'View ' . $name ),\r\n 'search_items' => __( 'Search ' . $plural ),\r\n 'not_found' => __( 'No ' . strtolower( $plural ) . ' found'),\r\n 'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash'),\r\n 'parent_item_colon' => '',\r\n 'menu_name' => $plural\r\n ),\r\n\r\n // Given labels\r\n $this->post_type_labels\r\n\r\n );\r\n\r\n // Same principle as the labels. We set some defaults and overwrite them with the given arguments.\r\n $args = array_merge(\r\n\r\n // Default\r\n array(\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'label' => $plural,\r\n 'labels' => $labels,\r\n 'menu_position' => $menupos,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array('slug' => $plural),\r\n 'show_in_nav_menus' => true,\r\n 'show_ui' => true,\r\n 'supports' => array( 'title', 'editor'),\r\n '_builtin' => false,\r\n ),\r\n\r\n // Given args\r\n $this->post_type_args\r\n\r\n );\r\n\r\n // Register the post type\r\n register_post_type( $this->post_type_name, $args );\r\n }", "function register_post_types(){\n\t\trequire('lib/custom-types.php');\n\t}", "function register_post_types(){\n }", "public function register()\n {\n $args = apply_filters( $this->name.'_post_type_config', $this->config );\n $args['labels'] = apply_filters( $this->name.'_post_type_labels', $this->labels);\n\n register_post_type( $this->name, $args );\n }", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "function theme_custom_post_type() {\n\tregister_post_type( 'custom_type',\n\n\t\t// Array with all the options for the custom post type\n\t\tarray( 'labels' => array(\n\t\t\t'name'\t\t\t\t\t=> __( 'Custom Types' ), // Name of the custom post type group\n\t\t\t'singular_name'\t\t\t=> __( 'Custom Post' ), // Name of the custom post type singular\n\t\t\t'all_items'\t\t\t\t=> __( 'All Custom Posts' ),\n\t\t\t'add_new' \t\t\t\t=> __( 'Add New' ),\n\t\t\t'add_new_item' \t\t\t=> __( 'Add New Custom Type' ),\n\t\t\t'edit'\t\t\t\t\t=> __( 'Edit' ),\n\t\t\t'edit_item'\t\t\t\t=> __( 'Edit Post Types' ),\n\t\t\t'new_item'\t\t\t\t=> __( 'New Post Type' ),\n\t\t\t'view_item'\t\t\t\t=> __( 'View Post Type' ),\n\t\t\t'search_items'\t\t\t=> __( 'Search Post Type' ),\n\t\t\t'not_found'\t\t\t\t=> __( 'Nothing found in the Database.' ),\n\t\t\t'not_found_in_trash'\t=> __( 'Nothing found in Trash' ),\n\t\t\t'parent_item_colon' \t=> ''\n\t\t\t),\n\n\t\t\t'description' \t\t\t=> __( 'This is the example custom post type' ), // Custom post type description\n\t\t\t'public' \t\t\t\t=> true,\n\t\t\t'publicly_queryable' \t=> true,\n\t\t\t'exclude_from_search' \t=> false,\n\t\t\t'show_ui' \t\t\t\t=> true,\n\t\t\t'query_var' \t\t\t=> true,\n\t\t\t'menu_position' \t\t=> 5, // The order the custom post type appears on the admin menu\n\t\t\t// 'menu_icon' \t\t\t=> get_stylesheet_directory_uri() . '/assets/images/custom-post-icon.png',\n\t\t\t'rewrite'\t\t\t\t=> array( 'slug' => 'custom_type', 'with_front' => false ), // You may specify its url slug\n\t\t\t'has_archive' \t\t\t=> 'custom_type', // You mary rename the slug here\n\t\t\t'capability_type' \t\t=> 'post',\n\t\t\t'hierarchical' \t\t\t=> false,\n\n\t\t\t// Enable post editor support\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'author',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'trackbacks',\n\t\t\t\t'custom-fields',\n\t\t\t\t'comments',\n\t\t\t\t'revisions',\n\t\t\t\t'sticky'\n\t\t\t)\n\t\t)\n\t);\n\n\t// This adds your post categories to your custom post type\n\tregister_taxonomy_for_object_type( 'category', 'custom_type' );\n\n\t// This adds your post tags to your custom post type\n\tregister_taxonomy_for_object_type( 'post_tag', 'custom_type' );\n\n}", "public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}", "public function add_custom_post_types() {\n //\n }", "function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}", "public function register_post_types() {\n\n\t}", "public static function register_post_type() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Collections', 'post type general name', 'wp-recipe-maker-premium' ),\n\t\t\t'singular_name' => _x( 'Collection', 'post type singular name', 'wp-recipe-maker-premium' ),\n\t\t);\n\n\t\t$args = apply_filters( 'wprm_recipe_collections_post_type_arguments', array(\n\t\t\t'labels' \t=> $labels,\n\t\t\t'public' \t=> false,\n\t\t\t'rewrite' \t=> false,\n\t\t\t'capability_type' \t=> 'post',\n\t\t\t'query_var' \t=> false,\n\t\t\t'has_archive' \t=> false,\n\t\t\t'supports' \t\t\t\t=> array( 'title', 'author' ),\n\t\t\t'show_in_rest'\t\t\t=> true,\n\t\t\t'rest_base'\t\t\t\t=> WPRMPRC_POST_TYPE,\n\t\t\t'rest_controller_class' => 'WP_REST_Posts_Controller',\n\t\t));\n\n\t\tregister_post_type( WPRMPRC_POST_TYPE, $args );\n\t}", "public static function register_post_type()\n {\n\n \t register_post_type( 'books',\n\t\t array(\n\t\t 'labels' => array(\n\t\t 'name' => __( 'Books' ),\n\t\t 'singular_name' => __( 'Books' )\n\t\t ),\n\t\t 'public' => true,\n\t\t 'has_archive' => false,\n\t\t )\n\t\t );\n\n }", "public function register_post_types() {\n require_once('includes/post-types.php');\n }", "public function register_post_type(){\n\t\tif(!class_exists('CPT')) return;\n\t\n\t\t$this->post_type = new CPT(\n\t\t\tarray(\n\t\t\t 'post_type_name' => 'slide',\n\t\t\t 'singular' => 'Slide',\n\t\t\t 'plural' => 'Slides',\n\t\t\t 'slug' => 'slide'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'has_archive' \t\t\t=> \ttrue,\n\t\t\t\t'menu_position' \t\t=> \t8,\n\t\t\t\t'menu_icon' \t\t\t=> \t'dashicons-layout',\n\t\t\t\t'supports' \t\t\t\t=> \tarray('title', 'excerpt', 'content','thumbnail', 'post-formats', 'custom-fields')\n\t\t\t)\n\t\t);\n\t\t\n\t\t$labels = array('menu_name'=>'Types');\n\t\t$this->post_type->register_taxonomy('type',array(\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t),$labels);\n\t}", "public function registered_post_type( $post_type, $args ) {\n\n\t\tglobal $wp_post_types, $wp_rewrite, $wp;\n\n\t\tif( $args->_builtin or !$args->publicly_queryable or !$args->show_ui ){\n\t\t\treturn false;\n\t\t}\n\t\t$permalink = get_option( $post_type.'_structure' );\n\n\t\tif( !$permalink ) {\n\t\t\t$permalink = $this->default_structure;\n\t\t}\n\n\t\t$permalink = '%'.$post_type.'_slug%'.$permalink;\n\t\t$permalink = str_replace( '%postname%', '%'.$post_type.'%', $permalink );\n\n\t\tadd_rewrite_tag( '%'.$post_type.'_slug%', '('.$args->rewrite['slug'].')','post_type='.$post_type.'&slug=' );\n\n\t\t$taxonomies = get_taxonomies( array(\"show_ui\" => true, \"_builtin\" => false), 'objects' );\n\t\tforeach ( $taxonomies as $taxonomy => $objects ):\n\t\t\t$wp_rewrite->add_rewrite_tag( \"%tax-$taxonomy%\", '(.+?)', \"$taxonomy=\" );\n\t\tendforeach;\n\n\t\t$permalink = trim($permalink, \"/\" );\n\t\tadd_permastruct( $post_type, $permalink, $args->rewrite );\n\n\t}", "function bf_register_custom_post_type() {\r\n /* Añado las etiquetas que aparecerán en el escritorio de WordPress */\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Ponentes', 'post type general name', 'text-domain' ),\r\n\t\t'singular_name' => _x( 'Ponente', 'post type singular name', 'text-domain' ),\r\n\t\t'menu_name' => _x( 'Ponentes', 'admin menu', 'text-domain' ),\r\n\t\t'add_new' => _x( 'Añadir nuevo', 'ponente', 'text-domain' ),\r\n\t\t'add_new_item' => __( 'Añadir nuevo ponente', 'text-domain' ),\r\n\t\t'new_item' => __( 'Nuevo Ponente', 'text-domain' ),\r\n\t\t'edit_item' => __( 'Editar Ponente', 'text-domain' ),\r\n\t\t'view_item' => __( 'Ver ponente', 'text-domain' ),\r\n\t\t'all_items' => __( 'Todos los ponentes', 'text-domain' ),\r\n\t\t'search_items' => __( 'Buscar ponentes', 'text-domain' ),\r\n\t\t'not_found' => __( 'No hay ponentes.', 'text-domain' ),\r\n\t\t'not_found_in_trash' => __( 'No hay ponentes en la papelera.', 'text-domain' )\r\n\t);\r\n\r\n /* Configuro el comportamiento y funcionalidades del nuevo custom post type */\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'description' => __( 'Descripción.', 'text-domain' ),\r\n\t\t'public' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'query_var' => true,\r\n\t\t'rewrite' => array( 'slug' => 'ponente' ),\r\n\t\t'capability_type' => 'post',\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => null,\r\n 'menu_icon' => 'dashicons-businessman',\r\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n\t\t'show_in_rest'\t \t => true,\r\n\t\t'public' \t\t\t => true,\r\n\t\t'has_archive' \t\t => true,\r\n\t\t'taxonomies' => array('category','categoria-conferencias')\r\n\t);\r\n\r\n\tregister_post_type('ponentes', $args );\r\n}", "function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail'));\n register_post_type('custompost',$args);\n \n }", "public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}", "private function initCustomPostType(){\n //Instantiate our custom post type object\n $this->cptWPDS = new PostType($this->wpdsPostType);\n \n //Set our custom post type properties\n $this->cptWPDS->setSingularName($this->wpdsPostTypeName);\n $this->cptWPDS->setPluralName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setMenuName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setLabels('Add New', 'Add New '.$this->wpdsPostTypeName, 'Edit '.$this->wpdsPostTypeName, 'New '.$this->wpdsPostTypeName, 'All '.$this->wpdsPostTypeNamePlural, 'View '.$this->wpdsPostTypeNamePlural, 'Search '.$this->wpdsPostTypeNamePlural, 'No '.strtolower($this->wpdsPostTypeNamePlural).' found', 'No '.strtolower($this->wpdsPostTypeNamePlural).' found in the trash');\n $this->cptWPDS->setMenuIcon('dashicons-welcome-write-blog');\n $this->cptWPDS->setSlug($this->wpdsPostType);\n $this->cptWPDS->setDescription('Writings from the universe');\n $this->cptWPDS->setShowInMenu(true);\n $this->cptWPDS->setPublic(true);\n $this->cptWPDS->setTaxonomies([$this->wpdsPostType]);\n $this->cptWPDS->removeSupports(['title']);\n \n //Register custom post type\n $this->cptWPDS->register();\n }", "static function register_post_type ()\n {\n register_post_type(\n 'person',\n array(\n 'labels' => array(\n 'name' => __x( 'People', 'post type general name' ),\n 'singular_name' => __x( 'Person', 'post type singular name' ),\n 'menu_name' => __x( 'People', 'admin menu' ),\n 'name_admin_bar' => __x( 'Person', 'add new on admin bar' ),\n 'add_new' => __x( 'Add New', 'book' ),\n 'add_new_item' => ___( 'Add New Person' ),\n 'new_item' => ___( 'New Person' ),\n 'edit_item' => ___( 'Edit Person' ),\n 'view_item' => ___( 'View Person' ),\n 'all_items' => ___( 'All People' ),\n 'search_items' => ___( 'Search People' ),\n 'parent_item_colon' => ___( 'Parent People:' ),\n 'not_found' => ___( 'No persons found.' ),\n 'not_found_in_trash' => ___( 'No persons found in Trash.' )\n ),\n 'description' => ___( 'Noteworthy people' ),\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'people' ),\n 'capability_type' => 'post',\n 'has_archive' => true,\n 'hierarchical' => false,\n 'menu_position' => null,\n 'menu_icon' => 'dashicons-welcome-learn-more',\n 'supports' => array( 'title', 'editor', 'thumbnail' )\n ));\n }", "public function register_post_type()\n {\n $labels = [\n 'name' => _x('Chiro Quizzes', 'post type general name', $this->token),\n 'singular_name' => _x('Chiro Quiz', 'post type singular name', $this->token),\n 'add_new' => _x('Add New', $this->token, $this->token),\n 'add_new_item' => sprintf(__('Add New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'edit_item' => sprintf(__('Edit %s', $this->token), __('Chiro Quiz', $this->token)),\n 'new_item' => sprintf(__('New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'all_items' => sprintf(__('All %s', $this->token), __('Chiro Quizzes', $this->token)),\n 'view_item' => sprintf(__('View %s', $this->token), __('Chiro Quiz', $this->token)),\n 'search_items' => sprintf(__('Search %a', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found' => sprintf(__('No %s Found', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found_in_trash' => sprintf(__('No %s Found In Trash', $this->token), __('Chiro Quizzes', $this->token)),\n 'parent_item_colon' => '',\n 'menu_name' => __('Chiro Quizzes', $this->token)\n ];\n\n $slug = __('chiro-quiz', 'pf_chiro_quiz');\n $custom_slug = get_option('pf_chiro_quiz_slug');\n if ($custom_slug && strlen($custom_slug) > 0 && $custom_slug != '') {\n $slug = $custom_slug;\n }\n\n $args = [\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => ['slug' => $slug],\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'supports' => ['title'],\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-admin-quiz'\n ];\n\n register_post_type($this->token, $args);\n }", "private function register_post_type() {\n\t\t\t// register the post type\n\t\t\t$args = array('label' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t'description' => '',\n\t\t\t\t\t\t\t\t\t\t'public' => false,\n\t\t\t\t\t\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t\t\t\t\t\t'show_in_menu' => true,\n\t\t\t\t\t\t\t\t\t\t'capability_type' => 'post',\n\t\t\t\t\t\t\t\t\t\t'map_meta_cap' => true,\n\t\t\t\t\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t\t\t\t\t\t'rewrite' => array('slug' => $this->post_type, 'with_front' => false),\n\t\t\t\t\t\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t\t\t\t\t\t'menu_position' => 100,\n\t\t\t\t\t\t\t\t\t\t'menu_icon' => 'dashicons-admin-generic',\n\t\t\t\t\t\t\t\t\t\t'supports' => array('title','custom-fields','revisions'),\n\t\t\t\t\t\t\t\t\t\t'labels' => array('name' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'singular_name' => __('Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'menu_name' =>\t__('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new' => __('Add Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new_item' => __('Add New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit' => __('Edit', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit_item' => __('Edit Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'new_item' => __('New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view_item' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'search_items' => __('Search Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found' => __('No Options Pages Found', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found_in_trash' => __('No Options Pages Found in Trash', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'parent' => __('Parent Options Page', $this->text_domain)));\n\t\t\tregister_post_type($this->post_type, $args);\n\t\t}", "public function registerCustomPostTypes() {\n\n\n }", "function carbon_register_post_types(){\n\n // carbon_register_post_type(array(\n // 'singular' => 'Type', // required\n // 'plural' => 'Types', // required\n // 'type' => 'type', // required\n // 'slug' => 'types/type',\n // 'menu_icon' => 'dashicons-admin-post',\n // 'has_archive' => true,\n // 'exclude_from_search' => true,\n // ));\n }", "public static function registerWPPostType()\n {\n register_post_type\n (\n 'fs_feed_entry',\n array\n (\n 'label' => 'Feed Entries',\n 'labels' => array\n (\n 'name' => 'Feed Entries',\n 'singular_name' => 'Feed Entry',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Feed Entry',\n 'edit_item' => 'Edit Feed Entry',\n 'new_item' => 'New Feed Entry',\n 'view_item' => 'View Feed Entry',\n 'search_items' => 'Search Feed Entries',\n 'not_found' => 'No Feed Entries Found',\n 'not_found_in_trash' => 'No Feed Entries Found In Trash',\n 'parent_item_colon' => 'Parent Feed Entries:',\n 'edit' => 'Edit',\n 'view' => 'View Feed Entry'\n ),\n 'public' => false,\n 'show_ui' => true\n )\n );\n }", "function register_content_type( $singular, $plural, $type, $ns = 'theme' )\n{\n // Hook into the 'init' action\n add_action( 'init', function() use ( $singular, $plural, $type, $ns ) {\n\n $labels = [\n 'name' => _x( $plural, 'Post Type General Name', $ns ),\n 'singular_name' => _x( $singular, 'Post Type Singular Name', $ns ),\n 'menu_name' => __( $plural, $ns ),\n 'parent_item_colon' => __( 'Parent ' . $singular . ':', $ns ),\n 'all_items' => __( 'All ' . $plural, $ns ),\n 'view_item' => __( 'View ' . $singular, $ns ),\n 'add_new_item' => __( 'Add New ' . $singular, $ns ),\n 'add_new' => __( 'Add New', $ns ),\n 'edit_item' => __( 'Edit ' . $singular, $ns ),\n 'update_item' => __( 'Update ' . $singular, $ns ),\n 'search_items' => __( 'Search ' . $plural, $ns ),\n 'not_found' => __( 'Not found', $ns ),\n 'not_found_in_trash' => __( 'Not found in Trash', $ns ),\n ];\n $args = [\n 'label' => __( $singular, $ns ),\n 'description' => __( $plural, $ns ),\n 'labels' => $labels,\n 'supports' => [ 'title', 'editor', 'custom-fields', 'thumbnail' ],\n 'taxonomies' => [ 'category', 'post_tag' ],\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n ];\n register_post_type( $type, $args );\n\n }, 0 );\n}", "public function register_post_type()\n\t{\n\n\t\tregister_taxonomy( $this->post_type_name . '_words', $this->post_type_name, array(\n\t\t\t'label' => 'Words',\n\t\t\t'labels' => array(\n\t\t\t\t'singular_name' => 'Word',\n\t\t\t\t'menu_name' => 'Words',\n\t\t\t\t'all_items' => 'All words',\n\t\t\t\t'edit_item' => 'Edit word',\n\t\t\t\t'view_item' => 'View word',\n\t\t\t\t'update_item' => 'View word',\n\t\t\t\t'add_new_item' => 'Add word',\n\t\t\t\t'new_item_name' => 'New word',\n\t\t\t\t'search_items' => 'Search words',\n\t\t\t\t'popular_items' => 'Popular words',\n\t\t\t\t'separate_items_with_commas' => 'Separate words with commas',\n\t\t\t\t'add_or_remove_items' => 'Add or remove words',\n\t\t\t\t'choose_from_most_used' => 'Choose from most used words',\n\t\t\t\t'not_found' => 'No words found',\n\t\t\t),\n\t\t\t'show_ui' => FALSE,\n\t\t\t'show_admin_column' => FALSE,\n\t\t\t'query_var' => TRUE,\n\t\t\t'rewrite' => array(\n\t\t\t\t'slug' => 'word',\n\t\t\t\t'with_front' => FALSE,\n\t\t\t),\n\t\t));\n\n\t\tregister_taxonomy( $this->post_type_name . '_partsofspeech', $this->post_type_name, array(\n\t\t\t'label' => 'Parts of Speech',\n\t\t\t'labels' => array(\n\t\t\t\t'singular_name' => 'Part of Speech',\n\t\t\t\t'menu_name' => 'Parts of Speech',\n\t\t\t\t'all_items' => 'All parts of speech',\n\t\t\t\t'edit_item' => 'Edit part of speech',\n\t\t\t\t'view_item' => 'View part of speech',\n\t\t\t\t'update_item' => 'View part of speech',\n\t\t\t\t'add_new_item' => 'Add part of speech',\n\t\t\t\t'new_item_name' => 'New part of speech',\n\t\t\t\t'search_items' => 'Search parts of speech',\n\t\t\t\t'popular_items' => 'Popular parts of speech',\n\t\t\t\t'separate_items_with_commas' => 'Separate parts of speech with commas',\n\t\t\t\t'add_or_remove_items' => 'Add or remove parts of speech',\n\t\t\t\t'choose_from_most_used' => 'Choose from most used parts of speech',\n\t\t\t\t'not_found' => 'No parts of speech found',\n\t\t\t),\n\t\t\t'show_ui' => FALSE,\n\t\t\t'show_admin_column' => TRUE,\n\t\t\t'query_var' => TRUE,\n\t\t\t'rewrite' => array(\n\t\t\t\t'slug' => 'partofspeech',\n\t\t\t\t'with_front' => FALSE,\n\t\t\t),\n\t\t));\n\n\t\t// register the damn post type already\n\t\tregister_post_type( \n\t\t\t$this->post_type_name,\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => 'Definitions',\n\t\t\t\t\t'singular_name' => 'Definition',\n\t\t\t\t\t'add_new' => 'Add New',\n\t\t\t\t\t'add_new_item' => 'Add New Definition',\n\t\t\t\t\t'edit_item' => 'Edit Definition',\n\t\t\t\t\t'new_item' => 'New Definition',\n\t\t\t\t\t'all_items' => 'All Definitions',\n\t\t\t\t\t'view_item' => 'View Definitions',\n\t\t\t\t\t'search_items' => 'Search Definitions',\n\t\t\t\t\t'not_found' => 'No definitions found',\n\t\t\t\t\t'not_found_in_trash' => 'No definitions found in Trash',\n\t\t\t\t\t'parent_item_colon' => '',\n\t\t\t\t\t'menu_name' => 'Definitions',\n\t\t\t\t),\n\t\t\t\t'supports' => array(\n\t\t\t\t\t'title',\n\t\t\t\t\t'editor',\n\t\t\t\t\t'thumbnail',\n\t\t\t\t\t'trackbacks',\n\t\t\t\t\t'comments',\n\t\t\t\t\t'revisions',\n\t\t\t\t),\n\t\t\t\t'public' => TRUE,\n\t\t\t\t'has_archive' => 'definitions',\n\t\t\t\t'rewrite' => array(\n\t\t\t\t\t'slug' => 'define',\n\t\t\t\t\t'with_front' => FALSE,\n\t\t\t\t),\n\t\t\t\t'register_meta_box_cb' => array( $this, 'metaboxes' ),\n\t\t\t\t'public' => TRUE,\n\t\t\t\t'taxonomies' => array(\n\t\t\t\t\t$this->post_type_name . '_partsofspeech',\n\t\t\t\t\t$this->post_type_name . '_words',\n\t\t\t\t),\n\t\t\t\t'menu_position' => 5,\n\t\t\t)\n\t\t);\n\t}", "protected function register_post_type() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'geopin', 'geopin-post-type' ),\n\t\t\t'singular_name' => __( 'geopin Member', 'geopin-post-type' ),\n\t\t\t'add_new' => __( 'Add geopin', 'geopin-post-type' ),\n\t\t\t'add_new_item' => __( 'Add geopin', 'geopin-post-type' ),\n\t\t\t'edit_item' => __( 'Edit geopin', 'geopin-post-type' ),\n\t\t\t'new_item' => __( 'New geopin', 'geopin-post-type' ),\n\t\t\t'view_item' => __( 'View geopin', 'geopin-post-type' ),\n\t\t\t'search_items' => __( 'Search geopin', 'geopin-post-type' ),\n\t\t\t'not_found' => __( 'No geopins found', 'geopin-post-type' ),\n\t\t\t'not_found_in_trash' => __( 'No geopins in the trash', 'geopin-post-type' ),\n\t\t);\n\n\t\t$supports = array(\n\t\t\t'title',\n\t\t\t// 'editor',\n\t\t\t'thumbnail',\n\t\t\t// 'custom-fields',\n\t\t\t// 'revisions',\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'supports' => $supports,\n\t\t\t'public' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'rewrite' => array( 'slug' => 'geopin', ), \n\t\t\t'menu_position' => 5,\n\t\t\t'menu_icon' => 'dashicons-admin-site',\n\t\t);\n\n\t\t$args = apply_filters( 'geoPin_post_type_args', $args );\n\n\t\tregister_post_type( $this->post_type, $args );\n\t}", "private function register_post_types()\n {\n // Gather all the post type services\n $post_types = array_merge(\n $this->get_custom_post_type_services(),\n $this->get_extended_post_type_services()\n );\n\n $this->register_service($post_types, 'post_types');\n }", "public function register_post_type()\n\t{\n\n\t\tregister_post_type( 'partner', array(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => _x( 'Partners', 'post type general name', 'custom-post-type-partners' ),\n\t\t\t\t'singular_name' => _x( 'Partner', 'post type singular name', 'custom-post-type-partners' ),\n\t\t\t\t'add_new' => _x( 'Add New', 'Partner', 'custom-post-type-partners' ),\n\t\t\t\t'add_new_item' => __( 'Add New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'edit_item' => __( 'Edit Partner', 'custom-post-type-partners' ),\n\t\t\t\t'new_item' => __( 'New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'all_items' => __( 'All Partners', 'custom-post-type-partners' ),\n\t\t\t\t'view_item' => __( 'View Partner', 'custom-post-type-partners' ),\n\t\t\t\t'search_items' => __( 'Search Partners', 'custom-post-type-partners' ),\n\t\t\t\t'not_found' => __( 'No Partners found', 'custom-post-type-partners' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Partners found in Trash', 'custom-post-type-partners' ),\n\t\t\t\t'parent_item_colon' => '',\n\t\t\t\t'menu_name' => __( 'Partners', 'custom-post-type-partners' )\n\t\t\t),\n\t\t\t'public' => TRUE,\n\t\t\t'publicly_queryable' => TRUE,\n\t\t\t'show_ui' => TRUE,\n\t\t\t'show_in_menu' => TRUE,\n\t\t\t'query_var' => TRUE,\n\t\t\t'rewrite' => TRUE,\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => FALSE,\n\t\t\t'hierarchical' => FALSE,\n\t\t\t'menu_position' => NULL,\n\t\t\t'menu_icon' => 'dashicons-admin-links',\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' )\n\t\t) );\n\n\t}", "public function register_post_type() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Movies', 'Post type general name', 'plugintest' ),\n\t\t\t'singular_name' => _x( 'Movie', 'Post type singular name', 'plugintest' ),\n\t\t\t'menu_name' => _x( 'Movies', 'Admin Menu text', 'plugintest' ),\n\t\t\t'name_admin_bar' => _x( 'Movie', 'Admin Menu Toolbar text', 'plugintest' ),\n\t\t\t'add_new' => __( 'Add New', 'plugintest' ),\n\t\t\t'add_new_item' => __( 'Add New Movie', 'plugintest' ),\n\t\t\t'new_item' => __( 'Aaaaaa', 'plugintest' ),\n\t\t\t'view_item' => __( 'View Movie', 'plugintest' ),\n\t\t\t'edit_item' => __( 'Edit Movie', 'plugintest' ),\n\t\t\t'all_items' => __( 'All Movies', 'plugintest' ),\n\t\t\t'search_items' => __( 'Search Movies', 'plugintest' ),\n\t\t\t'parent_item_colon' => __( 'Parent Movies', 'plugintest' ),\n\t\t\t'not_found' => __( 'No Movies found.', 'plugintest' ),\n\t\t\t'not_found_in_trash' => __( 'No Movies found in Trash.', 'plugintest' ),\n\t\t\t'featured_image' => _x( 'Movie Cover Image', 'Overrides the “Featured Image” phrase for this post type. Added in 4.3', 'plugintest' ),\n\t\t\t'set_featured_image' => _x( 'Set cover image', 'Overrides the “Set featured image” phrase for this post type. Added in 4.3', 'plugintest' ),\n\t\t\t'remove_featured_image' => _x( 'Remove cover image', 'Overrides the “Remove featured image” phrase for this post type. Added in 4.3', 'plugintest' ),\n\t\t\t'use_featured_image' => _x( 'Use as cover image', 'Overrides the “Use as featured image” phrase for this post type. Added in 4.3', 'plugintest' ),\n\t\t\t'item_published' => __( 'New Movie Published.', 'plugintest' ),\n\t\t\t'item_updated' => __( 'Movie post updated.', 'plugintest' ),\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array( 'slug' => 'movie' ),\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t\t'has_archive' => true,\n\t\t\t'menu_position' => null,\n\t\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n\t\t\t'taxonomies' => array( 'category', 'post_tag' ), // Using wordpess category and tags.\n\t\t);\n\n\t\tregister_post_type( 'movie', $args );\n\t\tflush_rewrite_rules();\n\n\t\t$category_labels = array(\n\t\t\t'name' => esc_html__( 'Movies Categories', 'plugintest' ),\n\t\t\t'singular_name' => esc_html__( 'Movie Category', 'plugintest' ),\n\t\t\t'all_items' => esc_html__( 'Movies Categories', 'plugintest' ),\n\t\t\t'parent_item' => null,\n\t\t\t'parent_item_colon' => null,\n\t\t\t'edit_item' => esc_html__( 'Edit Category', 'plugintest' ),\n\t\t\t'update_item' => esc_html__( 'Update Category', 'plugintest' ),\n\t\t\t'add_new_item' => esc_html__( 'Add New Movie Category', 'plugintest' ),\n\t\t\t'new_item_name' => esc_html__( 'New Movie Name', 'plugintest' ),\n\t\t\t'menu_name' => esc_html__( 'Genre', 'plugintest' ),\n\t\t\t'search_items' => esc_html__( 'Search Categories', 'plugintest' ),\n\t\t);\n\n\t\t$category_args = array(\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'labels' => $category_labels,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'rewrite' => array( 'slug' => 'genre' ),\n\t\t);\n\n\t\tregister_taxonomy( 'genre', array( self::$post_type ), $category_args );\n\t}", "public function customPostType()\n {\n\n if (empty($this->custom_post_types)) {\n return;\n }\n\n foreach ($this->custom_post_types as $post_type) {\n register_post_type(\n $post_type['post_type'],\n [\n 'labels' => [\n 'name' => __($post_type['name'], 'vrcoder'),\n 'singular_name' => __($post_type['singular_name'], 'vrcoder'),\n 'menu_name' => __($post_type['name'], 'vrcoder'),\n 'name_admin_bar' => __($post_type['singular_name'], 'vrcoder'),\n 'archives' => __($post_type['singular_name'] . ' Archives', 'vrcoder'),\n 'attributes' => __($post_type['singular_name'] . ' Attributes', 'vrcoder'), \n 'parent_item_colon' => __('Parent ' . $post_type['singular_name'], 'vrcoder'),\n 'all_items' => __('All ' . $post_type['name'], 'vrcoder'),\n 'add_new_item' => __('Add new ' . $post_type['singular_name'], 'vrcoder'),\n 'add_new' => __('Add new', 'vrcoder'),\n 'new_item' => __('New ' . $post_type['singular_name'], 'vrcoder'),\n 'edit_item' => __('Edit ' . $post_type['singular_name'], 'vrcoder'),\n 'update_item' => __('Update' . $post_type['singular_name'], 'vrcoder'),\n 'view_item' => __('View' . $post_type['singular_name'], 'vrcoder'),\n 'view_items' => __('View' . $post_type['name'], 'vrcoder'),\n 'search_items' => __('Search' . $post_type['name'], 'vrcoder'),\n 'not_found' => __('No' . $post_type['singular_name'] . ' Found', 'vrcoder'),\n 'not_found_in_trash' => __('No' . $post_type['singular_name'] . ' Found in Trash', 'vrcoder'),\n 'featured_image' => __('Featured Image', 'vrcoder'),\n 'set_featured_image' => __('Set Featured Image', 'vrcoder'),\n 'remove_featured_image' => __('Remove Featured Image', 'vrcoder'),\n 'use_featured_image' => __('Use Featured Image', 'vrcoder'),\n 'insert_into_item' => __('Insert into' . $post_type['singular_name'], 'vrcoder'),\n 'uploaded_to_this_item' => __('Upload to this' . $post_type['singular_name'], 'vrcoder'),\n 'items_list' => __($post_type['name'] . ' List', 'vrcoder'),\n 'items_list_navigation' => __($post_type['name'] . ' List Navigation', 'vrcoder'),\n 'filter_items_list' => __('Filter' . $post_type['name'] . ' List', 'vrcoder'),\n ],\n 'label' => __($post_type['singular_name'], 'vrcoder'),\n 'description' => __($post_type['name'] . ' Custom Post Type', 'vrcoder'),\n 'supports' => $post_type['supports'],\n 'show_in_rest' => $post_type['show_in_rest'],\n 'taxonomies' => $post_type['taxonomies'],\n 'hierarchical' => $post_type['hierarchical'],\n 'public' => $post_type['public'],\n 'show_ui' => $post_type['show_ui'],\n 'show_in_menu' => $post_type['show_in_menu'],\n 'menu_position' => $post_type['menu_position'],\n 'show_in_admin_bar' => $post_type['show_in_admin_bar'],\n 'show_in_nav_menus' => $post_type['show_in_nav_menus'],\n 'can_export' => $post_type['can_export'],\n 'has_archive' => $post_type['has_archive'],\n 'exclude_from_search' => $post_type['exclude_from_search'],\n 'publicly_queryable' => $post_type['publicly_queryable'],\n 'capability_type' => $post_type['capability_type'],\n 'menu_icon' => $post_type['menu_icon']\n ]\n );\n }\n\n }", "function registerPostTypes()\n{\n register_post_type('destination', [\n 'public' => true,\n 'label' => 'Destinations',\n 'supports' => ['title', 'editor', 'thumbnail']\n ]);\n register_post_type('review', [\n 'public' => true,\n 'label' => 'Reviews',\n 'supports' => ['title', 'editor']\n ]);\n}", "function carbon_register_post_type($settings){\n\n $labels = array(\n 'name' => _x($settings['plural'],'post type plural name','carbon'),\n 'singular_name' => _x($settings['singular'],'post type singular name','carbon'),\n 'add_new' => _x('Add New',$settings['singular'],'carbon'),\n 'add_new_item' => __('Add New ' .$settings['singular']),\n 'edit_item' => __('Edit ' .$settings['singular']),\n 'new_item' => __('New ' .$settings['singular']),\n 'all_items' => __('All ' .$settings['plural']),\n 'view_item' => __('View ' .$settings['singular']),\n 'search_items' => __('Search ' .$settings['plural']),\n 'not_found' => __('No ' .$settings['plural'].' found'),\n 'not_found_in_trash' => __('No ' .$settings['plural'].' found in Trash'),\n 'parent_item_colon' => ':',\n 'menu_name' => $settings['plural'],\n );\n\n $args = array(\n 'labels' => $labels,\n 'can_export' => (isset($settings['can_export']) ? $settings['can_export'] : true), // defaults true\n 'capability_type' => (isset($settings['capability_type']) ? $settings['behavior'] : 'post'), // default post\n // 'capabilities' // default capability_type\n 'exclude_from_search' => (isset($settings['exclude_from_search']) ? $settings['exclude_from_search'] : false), // default opposite of public\n 'hierarchical' => (isset($settings['hierarchical']) ? $settings['hierarchical'] : false), // default false\n 'has_archive' => (isset($settings['has_archive']) ? $settings['has_archive'] : false), // default false\n // 'permalink_epmask' // default EP_PERMALINK\n 'public' => (isset($settings['public']) ? $settings['public'] : true), // default false\n 'publicly_queryable' => (isset($settings['publicly_queryable']) ? $settings['publicly_queryable'] : true), // default public\n 'query_var' => (isset($settings['query_var']) ? $settings['query_var'] : true), // default true type\n 'show_ui' => (isset($settings['show_ui']) ? $settings['show_ui'] : true), // default public\n 'show_in_menu' => (isset($settings['show_in_menu']) ? $settings['show_in_menu'] : true), // default public\n 'show_in_admin_bar' => (isset($settings['show_in_admin_bar']) ? $settings['show_in_admin_bar'] : true), // default show_in_menu\n 'menu_position' => (isset($settings['menu_position']) ? $settings['menu_position'] : null), // default null\n 'menu_icon' => (isset($settings['menu_icon']) ? $settings['menu_icon'] : 'dashicons-admin-post'),\n 'supports' => (isset($settings['supports']) ? $settings['supports'] : array('title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'page-attributes')), // default title editor\n 'taxonomies' => (isset($settings['taxonomies']) ? $settings['taxonomies'] : array()), // default none\n // 'register_meta_box_cb' // default none\n 'rewrite' => (isset($settings['rewrite']) ? $settings['rewrite'] : array( // default true name\n 'slug' => (isset($settings['slug']) ? $settings['slug'] : $settings['type']), // default type\n 'with_front' => (isset($settings['with_front']) ? $settings['with_front'] : false), // default true\n 'feeds' => (isset($settings['feeds']) ? $settings['feeds'] : false), // default has_archive\n 'pages' => (isset($settings['pages']) ? $settings['pages'] : true), // defaults true\n // 'ep_mask' // default permalink_epmask EP_PERMALINK\n )),\n );\n register_post_type($settings['type'], $args);\n }", "public static function register_post_type( $json = [], $override = [] ) {\n if ( (is_string($json)) and (ends_with($json, '.json')) ) {\n $json = import($json);\n }\n\n // Combine json with override\n $args = array_merge($json, $override);\n\n // Look for $name inside $args\n if (is_array($json)) {\n $name = ($args['name']) ?? false;\n }\n\n // If no name has been passed, bail out\n // if ( empty($name) ) return false;\n\n // If no name passed, determine one from the classname\n if ( empty($name) ) {\n $name = underscore(preg_replace('/^.*\\\\\\s*/', '', get_called_class()));\n }\n\n // Generate names from $name\n $names = static::generate_names( $name, $args['names'] ?? [] );\n $name = $names['key_single']; // update $name arg in case it got modified \n unset($args['names']);\n\n // If this post type has already been registered, bail out\n if ( isset( self::$post_types[$name] ) ) return false;\n self::$post_types[$name] = $name;\n \n // Save $names, $name and reset $args, $props\n static::$names = $names;\n static::$name = $name;\n static::$args = [];\n static::$props = [];\n\n // Add to classmap (Timber classes)\n self::$classmap = array_merge(self::$classmap, [ $name => $names['class'] ]);\n add_filter( 'timber/post/classmap', function( $classmap ) use( $name, $names) {\n return array_merge( $classmap, [ $name => $names['class'] ] );\n } );\n\n // Post Meta\n static::$props['meta'] = $args['meta'] ?? [];\n unset($args['meta']);\n\n // Blocks\n static::$props['blocks'] = $args['blocks'] ?? true;\n unset($args['blocks']);\n\n // Custom Metaboxes CMB2\n // https://github.com/CMB2/CMB2/wiki/Field-Types\n static::$props['metaboxes'] = $args['metaboxes'] ?? [];\n unset($args['metaboxes']);\n\n // https://github.com/johnbillion/extended-cpts/wiki/Registering-taxonomies\n static::$props['taxonomies'] = $args['taxonomies'] ?? [];\n unset($args['taxonomies']);\n\n\n // No archive pages by default\n static::$props['has_archive'] = false;\n\n // If has_archive is set, use the plural slug\n if ( ( isset($args['has_archive']) ) && ( $args['has_archive'] !== false ) ) {\n static::$props['has_archive'] = $names['slug_plural'];\n } \n unset($args['has_archive']);\n\n\n // Save args to object\n static::$args = $args;\n\n static::before_register_post_type();\n\n // Finally register or customize the post type\n if ( static::is_native_post_type() ) {\n static::register_native_post_type();\n } else {\n static::register_custom_post_type();\n }\n\n static::register_taxonomies();\n static::register_post_meta();\n static::register_allowed_block_types();\n static::register_block_categories();\n static::register_custom_meta_boxes();\n\n static::after_register_post_type();\n\n static::activate();\n\n }", "function register_post_types()\n {\n do_action('wc_pos_register_post_type');\n\n if (!post_type_exists('pos_temp_register_or')) {\n\n wc_register_order_type(\n 'pos_temp_register_or',\n apply_filters('wc_pos_register_post_type_pos_temp_register_or',\n array(\n 'label' => __('POS temp orders', 'wc_point_of_sale'),\n 'capability_type' => 'shop_order',\n 'public' => false,\n 'hierarchical' => false,\n 'supports' => false,\n 'exclude_from_orders_screen' => false,\n 'add_order_meta_boxes' => false,\n 'exclude_from_order_count' => true,\n 'exclude_from_order_views' => true,\n 'exclude_from_order_reports' => true,\n 'exclude_from_order_sales_reports' => true,\n //'class_name' => ''\n )\n )\n );\n }\n if (!post_type_exists('pos_custom_product')) {\n register_post_type('pos_custom_product',\n apply_filters('wc_pos_register_post_type_pos_custom_product',\n array(\n 'label' => __('POS custom product', 'wc_point_of_sale'),\n 'public' => false,\n 'hierarchical' => false,\n 'supports' => false\n )\n )\n );\n }\n }", "function register_type( $post_type_singular, $post_type_plural, $options = array() ) {\n\n\t$text_domain = 'sgdf';\n\n\t$labels = array(\n\t\t'name' => _x( ucwords( $post_type_plural ), 'post type general name', $text_domain ),\n\t\t'singular_name' => _x( ucwords( $post_type_singular ), 'post type singular name', $text_domain ),\n\t\t'menu_name' => _x( ucwords( $post_type_plural ), 'admin menu', $text_domain ),\n\t\t'name_admin_bar' => _x( ucwords( $post_type_singular ), 'add new on admin bar', $text_domain ),\n\t\t'add_new' => _x( 'Add New', 'book', $text_domain ),\n\t\t'add_new_item' => __( 'Add New ' . ucwords( $post_type_singular ), $text_domain ),\n\t\t'new_item' => __( 'New ' . ucwords( $post_type_singular ), $text_domain ),\n\t\t'edit_item' => __( 'Edit ' . ucwords( $post_type_singular ), $text_domain ),\n\t\t'view_item' => __( 'View ' . ucwords( $post_type_singular ), $text_domain ),\n\t\t'all_items' => __( 'All ' . ucwords( $post_type_plural ), $text_domain ),\n\t\t'search_items' => __( 'Search ' . ucwords( $post_type_plural ), $text_domain ),\n\t\t'parent_item_colon' => __( 'Parent ' . ucwords( $post_type_plural ) . ':', $text_domain ),\n\t\t'not_found' => __( 'No ' . $post_type_plural . ' found.', $text_domain ),\n\t\t'not_found_in_trash' => __( 'No ' . $post_type_plural . ' found in Trash.', $text_domain )\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => $post_type_singular ),\n\t\t'capability_type' => 'post',\n\t\t'has_archive' => true,\n\t\t'hierarchical' => false,\n\t\t'menu_position' => null,\n\t\t'menu_icon' \t => null,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )\n\t);\n\n\tforeach ($options as $key => $option) {\n\t\t$args[$key] = $option;\n\t}\n\n\treturn register_post_type( $post_type_singular, $args );\n}", "function stock_toolkit_custom_post()\n\t{\n\tregister_post_type('slide', array(\n\t\t'labels' => array(\n\t\t\t'name' => __('Slides') ,\n\t\t\t'singular_name' => __('Slide')\n\t\t) ,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'custom-fields',\n\t\t\t'thumbnail',\n\t\t\t'page-attributes'\n\t\t) ,\n\t\t'public' => false,\n\t\t'show_ui' => true\n\t));\n\t}", "function add_custom_post_type() {\n\tregister_post_type( 'learning_resource',\n array(\n 'labels' => array(\n 'name' => __( 'Learning Resources' ),\n 'singular_name' => __( 'Learning Resource' )\n ),\n 'public' => true,\n 'has_archive' => true,\n )\n );\n}", "public static function init() {\n\t\tadd_action( 'init', array( __CLASS__, 'register_post_type' ), 1 );\n\t}", "public function register_content_type() {\n\t\t$labels = array(\n\t\t\t'name' => 'Honor Rolls',\n\t\t\t'singular_name' => 'Honor Roll',\n\t\t\t'add_new' => 'Add New',\n\t\t\t'add_new_item' => 'Add New Honor Roll',\n\t\t\t'edit_item' => 'Edit Honor Roll',\n\t\t\t'new_item' => 'New Honor Roll',\n\t\t\t'all_items' => 'All Honor Rolls',\n\t\t\t'view_item' => 'View Honor Rolls',\n\t\t\t'search_items' => 'Search Honor Rolls',\n\t\t\t'not_found' => 'No Honor Rolls found',\n\t\t\t'not_found_in_trash' => 'No Honor Rolls found in Trash',\n\t\t\t'menu_name' => 'Honor Rolls',\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => false,\n\t\t\t'publicly_queryable' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => false,\n\t\t\t'has_archive' => false,\n\t\t\t'hierarchical' => false,\n\t\t\t'supports' => array( 'title' ),\n\t\t);\n\t\tregister_post_type( $this::$content_type_slug, $args );\n\t}", "static function register_post_type() {\n\n $args = array(\n 'labels' => array(\n\t\t'name' => __( 'Forms', 'pwp' ),\n\t\t'singular_name' => __( 'Form', 'pwp' ),\n\t\t'add_new' => __( 'Add New', 'pwp' ),\n\t\t'add_new_item' => __( 'Add New Form', 'pwp' ),\n\t\t'edit_item' => __( 'Edit Form', 'pwp' ),\n\t\t'new_item' => __( 'New Form', 'pwp' ),\n\t\t'all_items' => __( 'All Forms', 'pwp' ),\n\t\t'view_item' => __( 'View Form', 'pwp' ),\n\t\t'search_items' => __( 'Search Forms', 'pwp' ),\n\t\t'not_found' => __( 'No forms found', 'pwp' ),\n\t\t'not_found_in_trash' => __( 'No forms found in Trash', 'pwp' ),\n\t\t'parent_item_colon' => __( ':', 'pwp' ),\n\t\t'menu_name' => __( 'Forms', 'pwp' )\n\t ),\n 'public' => false,\n 'show_ui' => true,\n 'query_var' => false,\n 'supports' => array( 'title', 'custom-fields', 'editor' )\n );\n\tregister_post_type( 'form', $args );\n }", "function compendium_register_type($slug, $name, $pname, $dicon) {\n $pt_slug = $slug;\n $tax_slug = $slug . '-category';\n\n register_post_type($pt_slug, array(\n 'labels' => array(\n 'name' => $pname,\n 'singular_name' => $name,\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New '.$name,\n 'edit_item' => 'Edit '.$name,\n 'new_item' => 'New '.$name,\n 'view_item' => 'View '.$name,\n 'search_items' => 'Search '.$pname,\n 'not_found' => 'No '.$pname.' found',\n 'not_found_in_trash' => 'No '.$pname.' found in trash',\n ),\n 'public' => true,\n 'menu_position' => 35,\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => $dicon,\n 'rewrite' => array(\n 'slug' => 'resource-center/' . $pt_slug,\n 'with_front' => true\n ),\n ));\n\n register_taxonomy($tax_slug, $pt_slug, array(\n 'labels' => array(\n 'name' => 'Categories',\n 'singular_name' => 'Category',\n ),\n 'hierarchical' => true,\n ));\n}", "function custom_widgets_register() {\n register_post_type('custom_widgets', array(\n 'labels' => array(\n 'name' => __('Custom Widgets'),\n 'singular_name' => __('Custom Widget'),\n ),\n 'public' => false,\n 'show_ui' => true,\n 'has_archive' => false,\n 'exclude_from_search' => true,\n ));\n}", "public function registerPostTypes()\n {\n // Get the post types from the config.\n $postTypes = config('post-types');\n\n $translater = new Translater($postTypes, 'post-types');\n $postTypes = $translater->translate([\n '*.label',\n '*.labels.*',\n '*.names.singular',\n '*.names.plural',\n ]);\n\n // Iterate over each post type.\n collect($postTypes)->each(function ($item, $key) {\n\n // Check if names are set, if not keep it as an empty array\n $names = $item['names'] ?? [];\n\n // Unset names from item\n unset($item['names']);\n\n // Register the extended post type.\n register_extended_post_type($key, $item, $names);\n });\n }", "function my_custom_post_registry() {\n\t$registry_labels = array(\n\t\t'name' => 'Registrations',\n\t\t'singular_name' => 'Cozmeena Shawl Registration',\n\t\t'add_new' => 'Add New',\n\t\t'all_items' => 'All Registrations',\n\t\t'add_new_item' => 'Add New Registration',\n\t\t'edit_item' => 'Edit Registration',\n\t\t'new_item' => 'New Registration',\n\t\t'view_item' => 'View Registration',\n\t\t'search_items' => 'Search Registrations',\n\t\t'not_found' => 'No Registrations found',\n\t\t'not_found_in_trash' => 'No Registrations found in trash',\n\t\t'parent_item_colon' => '',\n\t\t'menu_name' => 'Cozmeena Shawl Registrations'\n\t);\n\t$registry_args = array(\n\t\t'labels' => $registry_labels,\n\t\t'description' => \"The International Cozmeena Registry is the official record of Cozmeena Shawls\",\n\t\t'public' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => '',\n\t\t'supports' => array('title','author', 'editor','thumbnail'),\n\t\t'capability_type' => 'coz_registry', // need to assign capabilities via plugin\n\t\t'map_meta_cap' => true,\n\t\t'has_archive' => true,\n\t); \n\tregister_post_type('coz_registry',$registry_args);\n}", "function pluginprefix_setup_post_type()\n{\n register_post_type('post-nasa-gallery', [\n 'label' => 'Nasa Images Posts',\n 'public' => true\n ]);\n}", "function add_custom_post_type() \n {\n // add custom type evenementen\n $labels = array(\n 'name' => _x('Quotes', 'post type general name', $this->localization_domain),\n 'singular_name' => _x('Quote', 'post type singular name', $this->localization_domain),\n 'add_new' => _x('Add Quote', 'event', $this->localization_domain),\n 'add_new_item' => __('Add New Quote', $this->localization_domain),\n 'edit_item' => __('Edit Quote', $this->localization_domain),\n 'new_item' => __('New Quote', $this->localization_domain),\n 'view_item' => __('View Quote', $this->localization_domain),\n 'search_items' => __('Search Quotes', $this->localization_domain),\n 'not_found' => __('No Quotes found', $this->localization_domain),\n 'not_found_in_trash' => __('No Quotes found in Trash', $this->localization_domain), \n 'parent_item_colon' => ''\n );\n $type_args = array(\n 'labels' => $labels,\n 'description' => __('bbQuotations offers a simple quotes custom post type. Useful for pull quotes or just random quotes on your site.',\n $this->localization_domain),\n 'public' => false,\n 'publicly_queryable' => false,\n 'show_ui' => true, \n 'query_var' => true,\n 'rewrite' => array('slug' => $this->options['bbquotations-slug']),\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => 5,\n 'supports' => array('title','editor','author')\n ); \n register_post_type( $this->custom_post_type_name, $type_args);\n }", "function create_post_type() {\n\n // register external_post as a Custom Post Type\n register_post_type( 'external_post', \n array( \n 'labels' => array( \n 'name' => __('External Posts'), \n 'singular_name' => __('External Post') \n ),\n 'public' => true,\n 'menu_position' => 5,\n 'supports' => array('title', 'excerpt'),\n 'rewrite' => array('slug' => 'external','with_front' => false) \n ) \n ); \n\n // connect external_post to category taxonomy\n register_taxonomy_for_object_type('category', 'external_post');\n register_taxonomy_for_object_type('post_tag', 'external_post');\n\n\n // register wp_tool as a Custom Post Type\n register_post_type('wp_tool',\n array( \n 'labels' => array( \n 'name' => __('WordPress Tools'), \n 'singular_name' => __('WordPress Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'tool','with_front' => false) \n ) \n );\n\n // connect wp_tool to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'wp_tool');\n register_taxonomy_for_object_type('category', 'wp_tool');\n\n\n // reregister default post so we can set a custom slug\n register_post_type('post', array(\n 'labels' => array(\n 'name_admin_bar' => _x('Post', 'add new on admin bar' ),\n ),\n 'public' => true,\n '_builtin' => false, \n '_edit_link' => 'post.php?post=%d', \n 'capability_type' => 'post',\n 'map_meta_cap' => true,\n 'show_in_menu' => false,\n 'hierarchical' => false,\n 'rewrite' => array('slug' => 'article'),\n 'query_var' => false,\n 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats', 'column_info'),\n )); \n\n // register external_tool as a Custom Post Type\n register_post_type('external_tool',\n array(\n 'labels' => array( \n 'name' => __('External Tools'), \n 'singular_name' => __('External Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'special','with_front' => false) \n ) \n ); \n\n // connect external_tool to category taxonomy\n register_taxonomy_for_object_type('category', 'external_tool');\n register_taxonomy_for_object_type('meta_info', 'external_tool');\n\n\n // register city_journal as a Custom Post Type\n register_post_type('city_journal',\n array(\n 'labels' => array( \n 'name' => __('CityJournal Entry'),\n 'singular_name' => __('CityJournal Entry')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'cityjournal','with_front' => false) \n ) \n ); \n\n // connect city_journal to category taxonomy\n register_taxonomy_for_object_type('category', 'city_journal');\n register_taxonomy_for_object_type('meta_info', 'city_journal'); \n\n\n // register people_project as a Custom Post Type\n register_post_type('people_project',\n array(\n 'labels' => array( \n 'name' => __('People & Projects'),\n 'singular_name' => __('People & Project')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'excerpt', 'thumbnail', 'meta_info'),\n ) \n ); \n\n // connect people_project to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'people_project'); \n\n\n register_post_type('discussion',\n array( \n 'labels' => array( \n 'name' => __('Discussions'), \n 'singular_name' => __('Discussion') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'discussion','with_front' => false) \n ) \n );\n\n // connect discussion to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'discussion');\n register_taxonomy_for_object_type('category', 'discussion');\n\n}", "function bs_configure_custom_post_types($args)\n{\n function bs_custom_post_types()\n {\n global $bs_config;\n\n foreach ($bs_config[\"custom-post-types\"] as $key => $type) {\n $type = bs_defaults($type, [\n \"public\" => true,\n ]);\n\n if (isset($type[\"name\"])) {\n $type[\"labels\"][\"name\"] = $type[\"name\"];\n }\n\n if (isset($type[\"slug\"])) {\n $type[\"rewrite\"][\"slug\"] = $type[\"slug\"];\n }\n\n if (isset($type[\"admin_only\"]) && $type[\"admin_only\"]) {\n $type[\"public\"] = false;\n $type[\"show_ui\"] = true;\n }\n\n register_post_type($key, bs_array_omit($type, [\"slug\", \"name\", \"admin_only\"]));\n }\n }\n add_action(\"init\", \"bs_custom_post_types\");\n}", "public function register_post_types() {\n\n\t\t/***********************\n\t\t * Custom Post Types *\n\t\t ***********************/\n\n\t\t$labels = $this->get_default_names();\n\t\t$labels = $labels['wampum_program'];\n\n\t\tregister_post_type( 'wampum_program',\n\t\t\tapply_filters( 'wampum_program_args', array(\n\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t'has_archive' => apply_filters( 'wampum_program_has_archive', false ),\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => $labels['plural'],\n\t\t\t\t\t'singular_name' => $labels['singular'],\n\t\t\t\t\t'menu_name' => $labels['plural'],\n\t\t\t\t\t'name_admin_bar' => $labels['singular'],\n\t\t\t\t\t'add_new' => _x( 'Add New', 'wampum programs' , 'wampum-programs' ),\n\t\t\t\t\t'add_new_item' => sprintf( __( 'Add New %s', 'wampum-programs' ), $labels['singular'] ),\n\t\t\t\t\t'new_item' => sprintf( __( 'New %s' , 'wampum-programs' ), $labels['singular'] ),\n\t\t\t\t\t'edit_item' => sprintf( __( 'Edit %s' , 'wampum-programs' ), $labels['singular'] ),\n\t\t\t\t\t'view_item' => sprintf( __( 'View %s' , 'wampum-programs' ), $labels['singular'] ),\n\t\t\t\t\t'all_items' => sprintf( __( 'All %s', 'wampum-programs' ), $labels['singular'] ),\n\t\t\t\t\t'search_items' => sprintf( __( 'Search %s', 'wampum-programs' ), $labels['singular'] ),\n\t\t\t\t\t'parent_item_colon' => sprintf( __( 'Parent %s:', 'wampum-programs' ), $labels['singular'] ),\n\t\t\t\t\t'not_found' => sprintf( __( 'No %s found.', 'wampum-programs' ), $labels['singular'] ),\n\t\t\t\t\t'not_found_in_trash' => sprintf( __( 'No %s found in Trash.', 'wampum-programs' ), $labels['singular'] ),\n\t\t\t\t),\n\t\t\t\t'menu_icon' => 'dashicons-feedback',\n\t\t\t\t'public' => true,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'rewrite' => array( 'slug' => $labels['slug'], 'with_front' => false ),\n\t\t\t\t'supports' => apply_filters( 'wampum_program_supports', array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes', 'genesis-cpt-archives-settings', 'genesis-layouts' ) ),\n\t\t\t\t// 'taxonomies' => array( 'wampum_program_template' ),\n\t\t\t)\n\t\t));\n\n\t\t/***********************\n\t\t * Custom Taxonomies *\n\t\t ***********************/\n\n\t\tregister_taxonomy( 'wampum_program_template', 'wampum_program',\n\t\t\tapply_filters( 'wampum_program_template_args', array(\n\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t'has_archive' => false,\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => _x( 'Templates' , 'wampum programs template general name', 'wampum-programs' ),\n\t\t\t\t\t'singular_name' => _x( 'Template' , 'wampum programs template singular name' , 'wampum-programs' ),\n\t\t\t\t\t'search_items' => __( 'Search Templates' , 'wampum-programs' ),\n\t\t\t\t\t'popular_items' => __( 'Popular Templates' , 'wampum-programs' ),\n\t\t\t\t\t'all_items' => __( 'All Categories' , 'wampum-programs' ),\n\t\t\t\t\t'edit_item' => __( 'Edit Template' , 'wampum-programs' ),\n\t\t\t\t\t'update_item' => __( 'Update Template' , 'wampum-programs' ),\n\t\t\t\t\t'add_new_item' => __( 'Add New Template' , 'wampum-programs' ),\n\t\t\t\t\t'new_item_name' => __( 'New Template Name' , 'wampum-programs' ),\n\t\t\t\t\t'separate_items_with_commas' => __( 'Separate Templates with commas' , 'wampum-programs' ),\n\t\t\t\t\t'add_or_remove_items' => __( 'Add or remove Templates' , 'wampum-programs' ),\n\t\t\t\t\t'choose_from_most_used' => __( 'Choose from the most used Templates' , 'wampum-programs' ),\n\t\t\t\t\t'not_found' => __( 'No Templates found.' , 'wampum-programs' ),\n\t\t\t\t\t'menu_name' => __( 'Templates' , 'wampum-programs' ),\n\t\t\t\t\t'parent_item' => null,\n\t\t\t\t\t'parent_item_colon' => null,\n\t\t\t\t),\n\t\t\t\t'public' => false,\n\t\t\t\t'rewrite' => false,\n\t\t\t\t'show_admin_column' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'show_in_nav_menus' => false,\n\t\t\t\t'show_tagcloud' => false,\n\t\t\t\t'show_ui' => true,\n\t\t\t)\n\t\t));\n\n\t}", "public function add_post_type( $name ) {\n\t\t$this->post_types[] = $name;\n\t}", "private static function register_form_post_type() {\n\t\tif ( post_type_exists( self::$forms_post_type ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$post_type_args = apply_filters(\n\t\t\t'wphf_register_post_type_' . self::$forms_post_type,\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'Forms', 'fff-rest-contact-form' ),\n\t\t\t\t\t'singular_name' => __( 'Form', 'fff-rest-contact-form' ),\n\t\t\t\t),\n\t\t\t\t'public' => true,\n\t\t\t\t'supports' => array( 'title' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_post_type( self::$forms_post_type, $post_type_args );\n\t}", "function food_specials_custompost() {\r\n\t$args = array(\r\n\t\t'label' => 'Daily Food Specials',\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'capability_type' => 'post',\r\n\t\t'rewrite' => array('slug' => 'food_specials'),\r\n\t\t'query_var' => true,\r\n\t\t'supports' => array(\r\n\t\t\t'title', 'editor', 'excerpt', 'comments', 'thumbnail', 'author',)\r\n\t\t);\r\n\tregister_post_type('food_specials', $args);\r\n}", "function wpcp_custom_post_type()\n{\n register_post_type('wpcp_server',\n array(\n 'labels' => array(\n 'name' => __('Servers', 'textdomain'),\n 'singular_name' => __('Server', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'delete_with_user' => false,\n \"supports\" => array(\"customer\", \"author\"),\n 'menu_icon' => 'dashicons-cloud'\n )\n );\n}", "public function create_post_type() {\n\t\t\n \t\tregister_post_type(self::POST_TYPE,\n \t\t\tarray(\n \t\t\t\t'labels' => array(\n \t\t\t\t\t'name' => \"Custom\",\n \t\t\t\t\t'singular_name' => __(ucwords(str_replace(\"_\", \" \", self::POST_TYPE)))\n \t\t\t\t),\n \t\t\t\t'public' => true,\n \t\t\t\t'has_archive' => true,\n \t\t\t\t'description' => __(\"This is WP Custom Post Type\"),\n \t\t\t\t'supports' => array('title', 'editor', 'excerpt','thumbnail','custom-fields'),\n \t\t\t)\n \t\t);\n\n\t\t\tregister_taxonomy(\n\t\t\t\t'custom-category',\n\t\t\t\tself::POST_TYPE,\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Category' ),\n\t\t\t\t\t'rewrite' => array( 'slug' => 'custom-category' ),\n\t\t\t\t\t'hierarchical' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function register_post_types() {\n\n\t\t// FAQ\n\t\tif (!MKB_Options::option('disable_faq')) {\n\t\t\t$this->register_faq_cpt();\n\t\t\t$this->register_faq_taxonomy();\n\t\t}\n\t}", "protected function addPostType()\n {\n WordPress::registerType('lbwp-nl', 'Newsletter', 'Newsletter', array(\n 'show_in_menu' => 'newsletter',\n 'publicly_queryable' => false,\n 'exclude_from_search' => true,\n 'supports' => array('title')\n ), 'n');\n }", "function custom_post_type() {\n $labels = array(\n 'name' => _x( 'Ort', 'Post Type General Name', 'twentythirteen' ),\n 'singular_name' => _x( 'Ort', 'Post Type Singular Name', 'twentythirteen' ),\n 'menu_name' => __( 'Orter', 'twentythirteen' ),\n 'all_items' => __( 'Alla Orter', 'twentythirteen' ),\n 'view_item' => __( 'View Ort', 'twentythirteen' ),\n 'add_new_item' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'add_new' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'edit_item' => __( 'Redigera Ort', 'twentythirteen' ),\n 'update_item' => __( 'Upddatera Ort', 'twentythirteen' ),\n 'search_items' => __( 'Sök Ort', 'twentythirteen' ),\n 'not_found' => __( 'Not Found', 'twentythirteen' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ),\n );\n \n $args = array(\n 'label' => __( 'cities', 'twentythirteen' ),\n 'description' => __( 'City Post Page', 'twentythirteen' ),\n 'labels' => $labels,\n 'supports' => array('title','thumbnail',),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n register_post_type( 'cities', $args );\n\n }", "public function register_estate_post_type() {\r\n $options = get_option( 'myhome_redux' );\r\n // define post type slug\r\n if ( ! empty( $options['mh-estate-slug'] ) ) {\r\n $slug = $options['mh-estate-slug'];\r\n } else {\r\n $slug = 'properties';\r\n }\r\n\r\n register_post_type( 'estate', array(\r\n 'labels' => array(\r\n 'name'\t\t\t => esc_html__( 'Properties', 'myhome-core' ),\r\n 'singular_name'\t => esc_html__( 'Property', 'myhome-core' ),\r\n 'menu_name' => esc_html__( 'Properties', 'myhome-core' ),\r\n 'name_admin_bar' => esc_html__( 'Add New Property', 'myhome-core' ),\r\n 'add_new' => esc_html__( 'Add New Property', 'myhome-core' ),\r\n 'add_new_item' => esc_html__( 'Add New Property', 'myhome-core' ),\r\n 'new_item' => esc_html__( 'New Property', 'myhome-core' ),\r\n 'edit_item' => esc_html__( 'Edit Property', 'myhome-core' ),\r\n 'view_item' => esc_html__( 'View Property', 'myhome-core' ),\r\n 'all_items' => esc_html__( 'Properties', 'myhome-core' ),\r\n 'search_items' => esc_html__( 'Search property', 'myhome-core' ),\r\n 'not_found' => esc_html__( 'No Property Found found.', 'myhome-core' ),\r\n 'not_found_in_trash' => esc_html__( 'No Property found in Trash.', 'myhome-core' )\r\n ),\r\n 'show_in_rest' => true,\r\n 'query_var' => true,\r\n 'public'\t\t => true,\r\n 'has_archive'\t => true,\r\n 'menu_position' => 21,\r\n 'menu_icon' => 'dashicons-admin-home',\r\n 'capability_type' => array( 'estate', 'estates' ),\r\n 'map_meta_cap' => true,\r\n 'rewrite'\t\t => array( 'slug' => $slug ),\r\n 'supports'\t\t => array(\r\n 'title',\r\n 'author',\r\n 'editor',\r\n 'thumbnail',\r\n )\r\n ) );\r\n }", "public function registerPostTypes()\n {\n $projectLabels = array(\n 'name' => __( 'Projects'),\n 'singular_name' => __( 'Project'),\n 'menu_name' => __( 'Projects'),\n 'parent_item_colon' => __( 'Parent Project'),\n 'all_items' => __( 'All Projects'),\n 'view_item' => __( 'View Project'),\n 'add_new_item' => __( 'Add New Project'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit Project'),\n 'update_item' => __( 'Update Project'),\n 'search_items' => __( 'Search Project'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n $componentLabels = array(\n 'name' => __( 'Components'),\n 'singular_name' => __( 'Component'),\n 'menu_name' => __( 'Components'),\n 'parent_item_colon' => __( 'Parent Component'),\n 'all_items' => __( 'All Components'),\n 'view_item' => __( 'View Component'),\n 'add_new_item' => __( 'Add New Component'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit Component'),\n 'update_item' => __( 'Update Component'),\n 'search_items' => __( 'Search Component'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n $componentTypeTaxLabels = array(\n 'name' => __('Component types'),\n 'singular_name' => __('Component type'),\n 'search_items' => __( 'Search Component types' ),\n 'popular_items' => __( 'Popular Component types' ),\n 'all_items' => __( 'All Component types' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Component type' ),\n 'update_item' => __( 'Update Component type' ),\n 'add_new_item' => __( 'Add New Component type' ),\n 'new_item_name' => __( 'New Component type Name' ),\n 'separate_items_with_commas' => __( 'Separate component types with commas' ),\n 'add_or_remove_items' => __( 'Add or remove component types' ),\n 'choose_from_most_used' => __( 'Choose from the most used ones' ),\n 'menu_name' => __( 'Component types' ),\n ); \n \n // Set other options for custom post types\n $projectArgs = array(\n 'label' => __( 'projects'),\n 'description' => __( 'Stuff that you have done or used'),\n 'labels' => $projectLabels,\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 6,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n $componentArgs = array(\n 'label' => __( 'components'),\n 'description' => __( 'Things used in projects'),\n 'labels' => $componentLabels,\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'taxonomies' => array('components'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 7,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n $componentTypeTaxArgs = array(\n 'hierarchical' => false,\n 'labels' => $componentTypeTaxLabels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'type' ),\n );\n \n // Registering your Custom Post Type\n register_taxonomy('component_type', 'component', $componentTypeTaxArgs);\n register_post_type('component', $componentArgs);\n register_post_type( 'project', $projectArgs );\n }", "function register_post_type(){\n \n $capability = acf_get_setting('capability');\n \n if(!acf_get_setting('show_admin'))\n $capability = false;\n \n register_post_type($this->post_type, array(\n 'label' => 'Options Page',\n 'description' => 'Options Page',\n 'labels' => array(\n 'name' => 'Options Pages',\n 'singular_name' => 'Options Page',\n 'menu_name' => 'Options Pages',\n 'edit_item' => 'Edit Options Page',\n 'add_new_item' => 'New Options Page',\n ),\n 'supports' => array('title'),\n 'hierarchical' => true,\n 'public' => false,\n 'show_ui' => true,\n 'show_in_menu' => 'edit.php?post_type=acf-field-group',\n 'menu_icon' => 'dashicons-layout',\n 'show_in_admin_bar' => false,\n 'show_in_nav_menus' => false,\n 'can_export' => false,\n 'has_archive' => false,\n 'rewrite' => false,\n 'exclude_from_search' => true,\n 'publicly_queryable' => false,\n 'capabilities' => array(\n 'publish_posts' => $capability,\n 'edit_posts' => $capability,\n 'edit_others_posts' => $capability,\n 'delete_posts' => $capability,\n 'delete_others_posts' => $capability,\n 'read_private_posts' => $capability,\n 'edit_post' => $capability,\n 'delete_post' => $capability,\n 'read_post' => $capability,\n ),\n 'acfe_admin_orderby' => 'title',\n 'acfe_admin_order' => 'ASC',\n 'acfe_admin_ppp' => 999,\n ));\n \n }", "public static function register_post_type() {\n\t\tregister_post_type( 'drsa_ad', self::arguments() );\n\t}", "function create_post_type() {\r\n register_post_type( 'nyheter',\r\n array(\r\n 'labels' => array(\r\n 'name' => __( 'Nyheter' ),\r\n 'singular_name' => __( 'Nyheter' )\r\n ),\r\n 'public' => true,\r\n 'has_archive' => true,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n )\r\n );\r\n}", "function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}", "public function register_location_content_type(){\n\t\t //Labels for post type\n\t\t $labels = array(\n 'name' => 'Add Portfolio',\n 'singular_name' => 'Portfolio',\n 'menu_name' => 'Add Portfolio',\n 'name_admin_bar' => 'Add Portfolio',\n 'add_new' => 'Add New', \n 'add_new_item' => 'Add New Portfolio Item',\n 'new_item' => 'New Portfolio Item', \n 'edit_item' => 'Edit Portfolio Item',\n 'view_item' => 'View Portfolio Item',\n 'all_items' => 'All Portfolio Items',\n 'search_items' => 'Search Portfolio Items',\n 'parent_item_colon' => 'Parent Portfolio Item: ', \n 'not_found' => 'No Portfolio Items found.', \n 'not_found_in_trash' => 'No Portfolio Items found in Trash.',\n );\n //arguments for post type\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable'=> true,\n 'show_ui' => true,\n 'show_in_nav' => true,\n 'query_var' => true,\n 'hierarchical' => false,\n 'supports' => array('title','thumbnail','editor'),\n 'has_archive' => true,\n 'menu_position' => 20,\n 'show_in_admin_bar' => true,\n 'menu_icon' => 'dashicons-location-alt',\n 'rewrite'\t\t\t=> array('slug' => 'locations', 'with_front' => 'true')\n );\n //register post type\n register_post_type('wp_locations', $args);\n\t}", "public function add()\r\n {\r\n // Create mandatory instances\r\n $objSingleSiteInstall = new Install($this->conf, $this->lang, $this->blogId);\r\n\r\n if($objSingleSiteInstall->checkDataExists() === FALSE)\r\n {\r\n // We register post types here only because we want to run 'flush_rewrite_rules()' bellow.\r\n // First, we \"add\" the custom post type via the above written function.\r\n // Note: \"add\" is written with quotes, as CPTs don't get added to the DB,\r\n // They are only referenced in the post_type column with a post entry,\r\n // when you add a post of this CPT.\r\n // Note 2: Registering of these post types has to be inside the sql query, because if there is a slug in db, we should use init section instead\r\n $objPostType = new PageType($this->conf, $this->lang, $this->conf->getExtensionPrefix().'page');\r\n $objPostType->register($this->lang->getText('NRS_INSTALL_DEFAULT_PAGE_URL_SLUG_TEXT'), 95);\r\n\r\n $objPostType = new ItemType($this->conf, $this->lang, $this->conf->getExtensionPrefix().'item');\r\n $objPostType->register($this->lang->getText('NRS_INSTALL_DEFAULT_ITEM_URL_SLUG_TEXT'), 96);\r\n\r\n $objPostType = new LocationType($this->conf, $this->lang, $this->conf->getExtensionPrefix().'location');\r\n $objPostType->register($this->lang->getText('NRS_INSTALL_DEFAULT_LOCATION_URL_SLUG_TEXT'), 97);\r\n\r\n // Delete any old content if exists\r\n $objSingleSiteInstall->deleteContent();\r\n\r\n // Then insert all content\r\n $objSingleSiteInstall->insertContent($this->conf->getExtensionSQLsPath('install.InsertSQL.php', TRUE));\r\n $this->processDebug($objSingleSiteInstall->getDebugMessages());\r\n $this->throwExceptionOnFailure($objSingleSiteInstall->getErrorMessages());\r\n\r\n // Add Roles\r\n $objPartnerRole = new Partner($this->conf, $this->lang, $this->conf->getExtensionPrefix().'partner');\r\n $objPartnerRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n $objPartnerRole->add();\r\n\r\n $objAssistantRole = new Assistant($this->conf, $this->lang, $this->conf->getExtensionPrefix().'assistant');\r\n $objAssistantRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n $objAssistantRole->add();\r\n\r\n $objManagerRole = new Manager($this->conf, $this->lang, $this->conf->getExtensionPrefix().'manager');\r\n $objManagerRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n $objManagerRole->add();\r\n\r\n // Add all plugin capabilities to WordPress admin role\r\n $objWPAdminRole = get_role('administrator');\r\n $capabilitiesToAdd = $objManagerRole->getCapabilities();\r\n foreach($capabilitiesToAdd AS $capability => $grant)\r\n {\r\n $objWPAdminRole->add_cap($capability, $grant);\r\n }\r\n\r\n // ATTENTION: This is *only* done during plugin activation hook!\r\n // You should *NEVER EVER* do this on every page load!!\r\n // And this function is important, because otherwise it was really not working (new url)\r\n // @note - It flushes rules only for current site:\r\n // https://iandunn.name/2015/04/23/flushing-rewrite-rules-on-all-sites-in-a-multisite-network/\r\n flush_rewrite_rules();\r\n }\r\n\r\n // Check if the database is up to date\r\n if($objSingleSiteInstall->isDatabaseVersionUpToDate())\r\n {\r\n // Then insert all content\r\n $objSingleSiteInstall->resetContent($this->conf->getExtensionSQLsPath('reset.ReplaceSQL.php', TRUE));\r\n $this->processDebug($objSingleSiteInstall->getDebugMessages());\r\n $this->throwExceptionOnFailure($objSingleSiteInstall->getErrorMessages());\r\n\r\n // Even if the data existed before, having this code out of IF scope, means that we allow\r\n // to re-register language text to WMPL and elsewhere (this will help us to add not-added texts if some is missing)\r\n $objLanguagesObserver = new LanguagesObserver($this->conf, $this->lang);\r\n if($this->lang->canTranslateSQL())\r\n {\r\n // If WPML is enabled\r\n $objLanguagesObserver->registerAllForTranslation();\r\n }\r\n }\r\n }", "public function create_post_types() {\n }", "function cptui_register_my_cpts_how_it_works() {\n\n\t$labels = array(\n\t\t\"name\" => __( \"How It Works\", \"esoftkulo\" ),\n\t\t\"singular_name\" => __( \"How it Work\", \"esoftkulo\" ),\n\t);\n\n\t$args = array(\n\t\t\"label\" => __( \"How It Works\", \"esoftkulo\" ),\n\t\t\"labels\" => $labels,\n\t\t\"description\" => \"\",\n\t\t\"public\" => true,\n\t\t\"publicly_queryable\" => true,\n\t\t\"show_ui\" => true,\n\t\t\"delete_with_user\" => false,\n\t\t\"show_in_rest\" => true,\n\t\t\"rest_base\" => \"\",\n\t\t\"rest_controller_class\" => \"WP_REST_Posts_Controller\",\n\t\t\"has_archive\" => false,\n\t\t\"show_in_menu\" => true,\n\t\t\"show_in_nav_menus\" => true,\n\t\t\"exclude_from_search\" => false,\n\t\t\"capability_type\" => \"post\",\n\t\t\"map_meta_cap\" => true,\n\t\t\"hierarchical\" => false,\n\t\t\"rewrite\" => array( \"slug\" => \"how_it_works\", \"with_front\" => true ),\n\t\t\"query_var\" => true,\n\t\t\"supports\" => array( \"title\", \"editor\", \"thumbnail\" ),\n\t);\n\n\tregister_post_type( \"how_it_works\", $args );\n}", "function myplugin_add_libro_post_type() {\n\n\t$args = array(\n\t\t'labels' => array( 'name' => 'Libros' ),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'libros' ),\n\t\t'capability_type' => 'post',\n\t\t'has_archive' => true,\n\t\t'hierarchical' => false,\n\t\t'menu_position' => null,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n );\n\n\tregister_post_type( 'libros', $args );\n\n}", "private function installCustomPostTypesFromPHP()\n {\n if (! file_exists($this->rootPath.'/config/types.php')) {\n return;\n }\n\n $types = include $this->rootPath.'/config/types.php';\n foreach ($types as $cpt => $details) {\n register_post_type($cpt, $details);\n }\n }", "function BH_register_posttypes() {\r\n\r\n\tBH_register_posttype_event();\r\n\tBH_register_posttype_gallery();\r\n\r\n}", "function tt_register_cpt($single, $plural = '') {\n if (empty($plural)) {\n $plural = $single.'s';\n }\n register_post_type(\n strtolower($single),\n array(\n 'label' => $plural,\n 'labels' => array(\n 'add_new_item' => \"Add New $single\",\n 'edit_item' => \"Edit $single\",\n 'new_item' => \"New $single\",\n 'view_item' => \"View $single\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $plural found\",\n 'not_found_in_trash' => \"No $plural found in Trash\",\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields',\n 'excerpt',\n ),\n 'taxonomies' => array('category'),\n )\n );\n}", "function rp_registriere_post_type_spieler() {\n register_taxonomy(\n 'rp_spieler_mannschaft',\n 'rp_spieler', array(\n 'labels' => array(\n 'name' => 'Mannschaften',\n 'singular_name' => 'Mannschaft',\n 'search_items' => 'Mannschaft suchen',\n 'all_items' => 'Alle Mannschaften',\n 'add_new_item' => 'Neue Mannschaft hinzufügen',\n ),\n 'hierarchical' => true,\n 'show_ui' => true,\n 'public'=> true,\n 'rewrite' => array(\n 'slug' => 'spieler',\n 'with_front' => true\n )\n )\n );\n\n /*\n * Registriere den Post Type rp_spieler\n */\n register_post_type('rp_spieler', array(\n 'label' => 'Spieler',\n 'description' => 'Post Type: Spieler',\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'capability_type' => 'post',\n 'capabilities' => array(\n 'create_posts' => false, // Entferne \"Neuer Spieler\" Support\n ),\n 'map_meta_cap' => true,\n 'hierarchical' => false,\n 'rewrite' => array(\n 'slug' => 'spieler/%rp_spieler_mannschaft%',\n 'with_front' => true\n ),\n 'has_archive' => 'spieler',\n 'query_var' => true,\n 'menu_icon' => 'dashicons-groups',\n 'supports' => array(\n 'title',\n 'editor',\n 'custom-fields',\n 'revisions',\n 'thumbnail',\n 'page-attributes',\n 'post-formats'),\n 'labels' => array(\n 'name' => 'Spieler',\n 'singular_name' => 'Spieler',\n 'menu_name' => 'Spieler',\n 'add_new' => 'Spieler hinzufügen',\n 'add_new_item' => 'Neuen Spieler hinzufügen',\n 'edit' => 'Spieler bearbeiten',\n 'edit_item' => 'Edit Spieler',\n 'new_item' => 'Neuer Spieler',\n 'view' => 'Spieler anzeigen',\n 'view_item' => 'View Spieler',\n 'search_items' => 'Search Spieler',\n 'not_found' => 'Kein Spieler gefunden',\n 'not_found_in_trash' => 'Kein Spieler gefunden',\n 'parent' => 'Parent Spieler',\n )\n ));\n}", "static function register() {\n // register the post type\n register_post_type('sale-flat', array(\n\t\t\n\t\t\t'labels'=> array(\n\t\t\t\t'name' => _x( 'Eladó ingatlanok', 'theme-phrases' ),\n\t\t\t\t'singular_name' => _x( 'Eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'menu_name' => _x( 'Eladó ingatlanok', 'theme-phrases' ),\n\t\t\t\t'name_admin_bar' => _x( 'Eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'add_new' => _x( 'Új eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'add_new_item' => __( 'Új eladó ingatlan hozzáadása', 'theme-phrases' ),\n\t\t\t\t'new_item' => __( 'Új eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'edit_item' => __( 'Eladó ingatlan szerkesztése', 'theme-phrases' ),\n\t\t\t\t'view_item' => __( 'Eladó ingatlan megtekintése', 'theme-phrases' ),\n\t\t\t\t'all_items' => __( 'Összes eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'search_items' => __( 'Eladó ingatlan keresése', 'theme-phrases' ),\n\t\t\t\t'parent_item_colon' => __( 'Parent eladó ingatlan:', 'theme-phrases' ),\n\t\t\t\t'not_found' => __( 'Nincsenek eladó ingatlanok.', 'theme-phrases' ),\n\t\t\t\t'not_found_in_trash' => __( 'Nincsenek eladó ingatlanok a kukában.', 'theme-phrases' )\n\t\t\t),\n 'description' => __('Eladó ingatlanok', 'theme-phrases'),\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'public' => true,\n 'show_ui' => true,\n 'auto-draft' => false,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'menu_position' => 4,\n 'menu_icon'\t=> 'dashicons-tag',\n 'revisions' => false,\n 'hierarchical' => true,\n 'has_archive' => true,\n\t\t\t'supports' => array('title','editor','thumbnail'),\n 'rewrite' => false,\n 'can_export' => false,\n 'capabilities' => array (\n 'create_posts' => 'edit_posts',\n 'edit_post' => 'edit_posts',\n 'read_post' => 'edit_posts',\n 'delete_posts' => 'edit_posts',\n 'delete_post' => 'edit_posts',\n 'edit_posts' => 'edit_posts',\n 'edit_others_posts' => 'edit_posts',\n 'publish_posts' => 'edit_posts',\n 'read_private_posts' => 'edit_posts',\n ),\n 'register_meta_box_cb' => array('SaleFlatPostType', 'add_metabox') \n ));\n }", "private function registerPostType() {\n\t global $superfood_elated_global_Framework;\n\n\t $menuPosition = 5;\n\t $menuIcon = 'dashicons-admin-post';\n\n\t if(eltd_core_theme_installed()) {\n\t\t $menuPosition = $superfood_elated_global_Framework->getSkin()->getMenuItemPosition('masonry-gallery');\n\t\t $menuIcon = $superfood_elated_global_Framework->getSkin()->getMenuIcon('masonry-gallery');\n\t }\n\n register_post_type($this->base,\n array(\n 'labels' \t\t=> array(\n 'name' \t\t\t\t=> esc_html__('Masonry Gallery', 'eltdf-core' ),\n 'all_items'\t\t\t=> esc_html__('Masonry Gallery Items', 'eltdf-core'),\n 'singular_name' \t=> esc_html__('Masonry Gallery Item', 'eltdf-core' ),\n 'add_item'\t\t\t=> esc_html__('New Masonry Gallery Item', 'eltdf-core'),\n 'add_new_item' \t\t=> esc_html__('Add New Masonry Gallery Item', 'eltdf-core'),\n 'edit_item' \t\t=> esc_html__('Edit Masonry Gallery Item', 'eltdf-core')\n ),\n 'public'\t\t=>\tfalse,\n 'show_in_menu'\t=>\ttrue,\n 'rewrite' \t\t=> \tarray('slug' => 'masonry-gallery'),\n\t\t\t\t'menu_position' => \t$menuPosition,\n 'show_ui'\t\t=>\ttrue,\n 'has_archive'\t=>\tfalse,\n 'hierarchical'\t=>\tfalse,\n 'supports'\t\t=>\tarray('title', 'thumbnail'),\n\t\t\t\t'menu_icon' => $menuIcon\n )\n );\n }", "public function init_post_type() {\n\t\t\t\n\t\t\t$labels = array(\n\t\t\t\t'name'\t\t\t\t=> 'Meetups',\n\t\t\t\t'new_item'\t\t\t=> 'Neues Meetup',\n\t\t\t\t'singular_name'\t\t=> 'Meetup',\n\t\t\t\t'view_item'\t\t\t=> 'Zeige Meetups',\n\t\t\t\t'edit_item'\t\t\t=> 'Editiere Meetup',\n\t\t\t\t'add_new_item'\t\t=> 'Meetup hinzuf&uuml;gen',\n\t\t\t\t'not_found'\t\t\t=> 'Kein Meetup gefunden',\n\t\t\t\t'search_items'\t\t=> 'Durchsuche Meetups',\n\t\t\t\t'parent_item_colon' => ''\n\t\t\t);\n\t\t\t\n\t\t\t$supports = array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'comments',\n\t\t\t);\n\t\t\t\n\t\t\t$args = array(\n\t\t\t\t'public'\t\t\t\t=> TRUE,\n\t\t\t\t'publicly_queryable'\t=> TRUE,\n\t\t\t\t'show_ui'\t\t\t\t=> TRUE, \n\t\t\t\t'query_var'\t\t\t\t=> TRUE,\n\t\t\t\t'capability_type'\t\t=> 'post',\n\t\t\t\t'hierarchical'\t\t\t=> FALSE,\n\t\t\t\t'menu_position'\t\t\t=> NULL,\n\t\t\t\t'supports'\t\t\t\t=> $supports,\n\t\t\t\t'has_archive'\t\t\t=> TRUE,\n\t\t\t\t'rewrite'\t\t\t\t=> TRUE,\n\t\t\t\t'labels'\t\t\t\t=> $labels\n\t\t\t);\n\t\t\t\n\t\t\tregister_post_type( 'wpmeetups', $args );\n\t\t}", "function press_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Press', 'Post Type General Name'),\n\t\t'singular_name' => _x( 'Press', 'Post Type Singular Name'),\n\t\t'menu_name' => __( 'Press'),\n\t\t'all_items' => __( 'All Press'),\n\t\t'view_item' => __( 'View Press'),\n\t\t'add_new_item' => __( 'Add New Press'),\n\t\t'add_new' => __( 'Add New'),\n\t\t'edit_item' => __( 'Edit Press'),\n\t\t'update_item' => __( 'Update Press')\n\n\t\t\n\t);\n\t\n// Set other options for Custom Post Type\n\t\n\t$args = array(\n\t\t'label' => __( 'press'),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor', 'thumbnail'),\n \n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/\t\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n 'rewrite' => array(\"slug\" => \"press\"),\n 'register_meta_box_cb' => 'add_press_metaboxes' // function hooking up metaboxes\n\t);\n\t\n\t// Registering your Custom Post Type\n\tregister_post_type( 'press', $args );\n\n}", "function testimonials_register_post_type() {\n\n $labels = [\n 'name' => __('Testimonials'),\n 'singular_name' => __('Testimonial'),\n 'add_new' => __('Add new', 'Testimonials'),\n 'add_new_item' => __('Add new Testimonial'),\n 'edit_item' => __('Edit Testimonial'),\n 'new_item' => __('New Testimonial'),\n 'view_item' => __('View Testimonial'),\n 'search_item' => __('Search Testimonials'),\n 'not_found' => __('No Testimonial found'),\n 'not_found_in_trash' => __('No Testimonial found in trash'),\n 'parent_item_colon' => ''\n ];\n\n register_post_type(TESTIMONIAL_TYPE, [\n 'labels' => $labels,\n 'public' => true,\n 'exclude_from_search' => true,\n 'has_archive' => true,\n 'hierarchical' => false,\n 'supports' => ['title', 'editor', 'custom-fields']\n ]);\n\n register_taxonomy_for_object_type(CRAFT_TAX_NAME, TESTIMONIAL_TYPE);\n}", "function add_my_custom_posttype_waarden(){\n //LABELS DIFINIËREN\n $labels = array(\n 'add_new' => 'Voeg nieuwe waarde toe',\n 'add_new_item' => 'Voeg nieuwe waarde toe',\n 'name' => 'waarden',\n 'singular_name' => 'waarden',\n );\n //ARGUMENTEN DIFINIËREN\n $args = array(\n 'labels' => $labels, // de array labels van hier boven linken aan het argument labels\n 'Description' => 'waarden van Ben & Jerry',\n 'public' => true,\n 'menu_position' => 6,\n 'menu_icon' => 'dashicons-layout', //Een icoon kiezen\n 'supports' => array('title', 'editor', 'thumbnail'), \n 'has_archive' => true, //Maak een archief aan (opsomming van alle elementen), anders gaan we archive-waarden.php nooit kunnen aanspreken.\n 'show_in_nav_menus' => TRUE,\n \n );\n register_post_type( 'waarden', $args ); \n }", "function wpmudev_create_post_type() {\n\t$labels = array(\n \t\t'name' => 'Actividades',\n \t'singular_name' => 'Actividad',\n \t'add_new' => 'Añade Nueva Actividad',\n \t'add_new_item' => 'Añade una nueva Actividad',\n \t'edit_item' => 'Edita la Actividad',\n \t'new_item' => 'Nueva Actividad',\n \t'all_items' => 'Todas las Actividades',\n \t'view_item' => 'Ver Actividad',\n \t'search_items' => 'Buscar Actividades',\n \t'not_found' => 'No se han encontrado Actividades',\n \t'not_found_in_trash' => 'No se han encontrado Actividades en la Papelera', \n \t'parent_item_colon' => '',\n \t'menu_name' => 'Actividades',\n );\n \n $args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n \t\t'public' => true,\n\t\t'supports' => array( 'title', 'custom-fields', 'thumbnail', 'comments', 'page-attributes', 'author' ),\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t//'map_meta_caps' => true,\n\t\t'rewrite' => array( 'slug' => 'actividades' ),\n\t);\n\t\n\tregister_post_type( 'actividad', $args );\n}", "public function register() {\r\n add_action('post_updated', array($this, 'save_meta'), null, 2 );\r\n\r\n $original_config = $this->get_config();\r\n // push it through a filter so a theme can change the terminology\r\n $filtered_config = apply_filters('ah-wp-dl-res-config',$original_config);\r\n register_post_type(self::POST_TYPE, $filtered_config);\r\n\r\n register_taxonomy(self::POST_TYPE . '_cat',\r\n array(self::POST_TYPE),\r\n array('hierarchical' => true,\r\n 'labels' => array(\r\n 'name' => __( 'Categories' ),\r\n 'singular_name' => __( 'Category' ),\r\n 'search_items' => __( 'Search Categories' ),\r\n 'all_items' => __( 'All Categories' ),\r\n 'parent_item' => __( 'Parent Category' ),\r\n 'parent_item_colon' => __( 'Parent Category:' ),\r\n 'edit_item' => __( 'Edit Category' ),\r\n 'update_item' => __( 'Update Category' ),\r\n 'add_new_item' => __( 'Add New Category' ),\r\n 'new_item_name' => __( 'New Category Name')\r\n ),\r\n 'show_ui' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => 'documents/categories' ),\r\n )\r\n );\r\n }", "function register_post_types($post_types = null) {\n\n\t\t\tif($post_types) {\n\n\t\t\t\tforeach($post_types as $post_type) {\n\n\t\t\t\t\tregister_post_type($post_type['post_type'], $post_type['args']);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "function add_my_custom_posttype_smaken(){\n //LABELS DIFINIËREN\n $labels = array(\n 'add_new' => 'Voeg nieuwe smaak toe',\n 'add_new_item' => 'Voeg nieuwe smaak toe',\n 'name' => 'Smaken',\n 'singular_name' => 'Smaak',\n );\n //ARGUMENTEN DIFINIËREN\n $args = array(\n 'labels' => $labels, // de array labels van hier boven linken aan het argument labels\n 'Description' => 'Lactosevrije smaken van B & J',\n 'public' => true,\n 'menu_position' => 4,\n 'menu_icon' => 'dashicons-carrot', //Een icoon kiezen\n 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'), \n 'has_archive' => true, //Maak een archief aan (opsomming van alle elementen), anders gaan we archive-waarden.php nooit kunnen aanspreken.\n 'show_in_nav_menus' => TRUE,\n );\n register_post_type( 'smaken', $args ); \n }", "function create_volunteer_custom_post() {\n register_post_type( 'volunteers',\n array(\n 'labels' => array(\n 'name' => __( 'Board Members' ),\n 'singular_name' => __( 'Board Member' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields'\n )\n ));\n}", "public function cws_register_cpt() {\n\n\t\tforeach ( $this->cpts as $key => $value ) {\n\n\t\t\tregister_post_type( $key, $value );\n\n\t\t}\n\n\t}", "public function post_type() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'Departamentos'),\n\t\t\t'singular_name' => __( 'Departamento' ),\n\t\t\t'add_new' => __('Añadir nuevo'),\n\t\t\t'add_new_item' => __('Añadir nuevo Departamento'),\n\t\t\t'edit_item' => __('Editar Departamento'),\n\t\t\t'new_item' => __('Nuevo Departamento'),\n\t\t\t'view_item' => __('Ver Departamento'),\n\t\t\t'search_items' => __('Buscar'),\n\t\t\t'not_found' => __('No se encontraron Departamentos'),\n\t\t\t'not_found_in_trash' => __('No se encontraron Departamentos en la Papelera'), \n\t\t\t'parent_item_colon' => ''\n\t\t );\n\t\t \n\t\t $args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true, \n\t\t\t'query_var' => true,\n\t 'has_archive' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => true,\n\t\t 'show_ui' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t 'show_in_menu' => 'bn_config',\n\t\t\t'menu_position' => 57,\n\t\t\t'menu_icon' => 'dashicons-clipboard',\n\t\t\t'rewrite' => array('slug' => __( $this->post_type )),\n\t\t\t'supports' => array('title', 'excerpt', 'page-attributes') //,'editor'\n\t\t );\n\t\t \n\t\t register_post_type(__( $this->post_type ), $args);\n\t}", "function add_my_custom_posttype_recepten(){\n //LABELS DIFINIËREN\n $labels = array(\n 'add_new' => 'Voeg nieuw recept toe',\n 'add_new_item' => 'Voeg nieuw recept toe',\n 'name' => 'Recepten',\n 'singular_name' => 'recept',\n );\n //ARGUMENTEN DIFINIËREN\n $args = array(\n 'labels' => $labels, // de array labels van hier boven linken aan het argument labels\n 'Description' => 'Lactosevrije recepten van B & J',\n 'public' => true,\n 'menu_position' => 4,\n 'menu_icon' => 'dashicons-book-alt', //Een icoon kiezen\n 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes', 'comments'), \n 'has_archive' => true, //Maak een archief aan (opsomming van alle elementen), anders gaan we archive-recepten.php nooit kunnen aanspreken.\n 'show_in_nav_menus' => TRUE,\n\n );\n\n register_post_type( 'recepten', $args ); \n \n }" ]
[ "0.7911114", "0.7758154", "0.7661058", "0.7630418", "0.7593939", "0.7571871", "0.7562517", "0.75430495", "0.7474007", "0.7469335", "0.74665034", "0.746017", "0.7450408", "0.7431948", "0.7394482", "0.7367333", "0.7367333", "0.73577774", "0.7355499", "0.7352057", "0.7351799", "0.7349739", "0.7298846", "0.7270663", "0.726875", "0.72578156", "0.72385615", "0.72353554", "0.72109306", "0.71867454", "0.71692884", "0.71654636", "0.71598387", "0.71482265", "0.71021897", "0.7095623", "0.7086074", "0.7079466", "0.70764416", "0.70735", "0.70594406", "0.7016418", "0.70153755", "0.6990915", "0.6988079", "0.6952915", "0.6929513", "0.6927574", "0.6927254", "0.69083214", "0.6903613", "0.68839484", "0.6883763", "0.6872886", "0.68664974", "0.6863594", "0.6855469", "0.68546826", "0.68456095", "0.6835774", "0.68290484", "0.68245125", "0.68232715", "0.6823228", "0.6811159", "0.68046993", "0.6792648", "0.6779857", "0.67704767", "0.67655176", "0.67627007", "0.6761353", "0.6756507", "0.67553455", "0.6736221", "0.6733711", "0.6725303", "0.6708419", "0.67016053", "0.66901493", "0.66890574", "0.668222", "0.6662583", "0.6646221", "0.6645011", "0.6641223", "0.6621986", "0.66193837", "0.6618863", "0.66166776", "0.6611526", "0.6611037", "0.66039234", "0.65996546", "0.65979326", "0.6595866", "0.65929806", "0.65807563", "0.65780234", "0.6570524" ]
0.8714965
0
Test that an invalid page cannot be passed to the constructor.
public function testInvalidPage() { $this->setExpectedException(\InvalidArgumentException::class); new XmlSitemapWriter($this->sitemap, 'invalid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetShowPageWithInvalidData()\n {\n $resp = $this->getMockBuilder('Acme\\Http\\Response')\n ->setConstructorArgs([$this->request, $this->signer,\n $this->blade, $this->session])\n ->setMethods(['render'])\n ->getMock();\n\n // override render method to return true\n $resp->method('render')\n ->willReturn(true);\n\n // mock the controller and make getUri a stub\n $controller = $this->getMockBuilder('Acme\\Controllers\\PageController')\n ->setConstructorArgs([$this->request, $resp, $this->session,\n $this->blade, $this->signer])\n ->setMethods(['getUri', 'getShow404'])\n ->getMock();\n\n // orverride getUri to return just the slug from the uri\n $controller->expects($this->once())\n ->method('getUri')\n ->will($this->returnValue('missing-page'));\n\n $controller->expects($this->once())\n ->method('getShow404')\n ->will($this->returnValue(true));\n\n // call the method we want to test\n $result = $controller->getShowPage();\n // should get true back if we called 404\n\n $this->assertTrue($result);\n }", "public function testRestrictPage()\n {\n $this->assertTrue(true);\n }", "public function testConstructionShouldOnlyRequireLabel()\n {\n try {\n $page = new Zym_Navigation_Page_Mvc(array(\n 'label' => 'foo'\n ));\n \n } catch (Exception $e) {\n $this->fail('Should throw exception for missing label');\n }\n }", "function test_basic_nonexistentpage(){\n global $ID,$conf;\n $ID = 'wiki:start';\n\n $info = $this->_get_expected_pageinfo();\n $info['id'] = 'wiki:start';\n $info['namespace'] = 'wiki';\n $info['filepath'] = $conf['datadir'].'/wiki/start.txt';\n\n $this->assertEquals($info, pageinfo());\n }", "public function testNonLoggedUserCannotVisitArticleCreatePage(string $page)\n {\n // Prepare\n $article = factory(Post::class)->create([\n 'status' => 'draft',\n ]);\n\n $page = TestUtils::createEndpoint($page, ['id' => $article->id, 'slug' => $article->slug,]);\n\n // Request\n $response = $this->call('GET', $page);\n\n // Asserts\n $response->assertRedirect($this->loginUrl);\n }", "public function testUserNonAdministratorCannotVisitPages(string $page)\n {\n // Prepare\n /** @var User $user */\n $user = factory(User::class)->create(['is_admin' => false,]);\n $article = factory(Post::class)->create([\n 'status' => 'draft',\n ]);\n\n $page = TestUtils::createEndpoint($page, ['id' => $article->id, 'slug' => $article->slug,]);\n\n // Request\n $response = $this->actingAs($user)->call('GET', $page);\n\n // Asserts\n $response->assertStatus(404);\n }", "public function testDontIndexNewPrivatePage()\n {\n\n // Add a private page.\n $page = $this->_simplePage(false);\n\n // Should not add a Solr document.\n $this->_assertNotRecordInSolr($page);\n\n }", "public function testInvalidURL(string $url) : void\n {\n $this->expectException(UrlParserException::class);\n new UrlParser($url);\n $this->fail('Valid url syntax: ' . $url);\n }", "public function testAdminCanNotAddAPageWithBlankTitle()\n {\n $params = [];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/blog/pages', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasErrors();\n\n $errors = session('errors');\n\n $this->assertEquals('The title field is required.', $errors->get('title')[0]);\n }", "public function test_it_should_throw_an_exception_on_invalid_url()\n {\n SourceFactory::create('unknown');\n }", "public function testErrorIsThrownIfURLIsInvalid()\n {\n self::$importer->get('invalid-google-url', now()->subYear(), now()->addYear());\n }", "public function test_i_can_see_404_error_page(AcceptanceTester $I) {\n\t\t$I->amOnPage('invalid_page');\n\t\t$I->see('404');\n\t\t$I->see('page not found');\n\t}", "public function testConstructorInvalidPdfEngine()\n {\n new TestablePaymentSlipPdf('FooBar');\n }", "public function testConstructorWithBadDefaultOptions2()\n {\n try {\n $test = new Zend_Cache_Frontend_Page(['default_options' => ['cache' => true, 1 => 'bar']]);\n } catch (Exception $e) {\n return;\n }\n $this->fail('Zend_Cache_Exception was expected but not thrown');\n }", "public function testFindPageThrowsErrorMessageForInvalidItemNumber()\n\t{\n\t\t$this->mock('Item')->shouldReceive('search')->once()->andReturn(Null);\n\t\t$this->getActionWithException('ItemsController@show', 1, 404, 'Item 1 was not found');\n\t}", "public function testError404WithBadExhibitPageSlug()\n {\n $exhibits = get_records('Exhibit');\n $this->assertEquals(1, count($exhibits));\n $exhibit = $exhibits[0];\n $exhibit->slug = 'goodexhibitslug';\n $exhibit->save();\n $this->assertEquals('goodexhibitslug', $exhibit->slug, 'Bad exhibit slug.');\n\n $exhibitPage = new ExhibitPage;\n $exhibitPage->title = 'Test Page';\n $exhibitPage->order = 1;\n $exhibitPage->layout = 'image-list-left-thumbs';\n $exhibitPage->slug = 'goodexhibitpageslug';\n $exhibitPage->exhibit_id = $exhibit->id;\n $exhibitPage->save();\n $this->assertTrue($exhibitPage->exists());\n\n $badExhibitPage = $this->db->getTable('ExhibitPage')->findBySlug('badexhibitpageslug');\n $this->assertEquals(null, $badExhibitPage);\n\n $this->setExpectedException('Omeka_Controller_Exception_404');\n $this->dispatch('exhibits/show/goodexhibitslug/goodexhibitslug/badexhibitpageslug');\n }", "function validate_page()\n {\n }", "function validate_page()\n {\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function testNonPublicPages()\n {\n $this->get('/home')->assertStatus(302);\n $this->get('/routes')->assertStatus(302);\n $this->get('/themes')->assertStatus(302);\n $this->get('/users')->assertStatus(302);\n $this->get('/users/create')->assertStatus(302);\n $this->get('/phpinfo')->assertStatus(302);\n $this->get('/profile/create')->assertStatus(302);\n }", "public function it_cant_create_invalid()\n {\n $this->shouldThrow('\\Aspire\\DIC\\Exception\\NotFoundException')->duringGet('SomeClassThatDoesNotExist');\n }", "public function testConstructorWithBadRegexps3()\n {\n $array = [\n '^/$' => ['cache' => true],\n '^/index/' => ['cache' => true],\n '^/article/' => ['cache' => false],\n '^/article/view/' => [\n 1 => true,\n 'cache_with_post_variables' => true,\n 'make_id_with_post_variables' => true,\n ]\n ];\n try {\n $test = new Zend_Cache_Frontend_Page(['regexps' => $array]);\n } catch (Exception $e) {\n return;\n }\n $this->fail('Zend_Cache_Exception was expected but not thrown');\n }", "public function testEmptyPages() {\n\t\t$page = $this->objFromFixture('UserDefinedForm', 'empty-page');\n\t\t$this->assertEquals(5, $page->Fields()->count());\n\t\t$controller = ModelAsController::controller_for($page);\n\t\t$form = new UserForm($controller);\n\t\t$this->assertEquals(2, $form->getSteps()->count());\n\t}", "public function test_that_a_new_user_cannot_register_with_invalid_information()\n {\n $this->browse(function ($browser) {\n $browser->visit('/register')\n ->type('name', 'Ben Gates')\n ->type('email', 'ben@')\n ->type('password', 'password')\n ->type('password_confirmation', 'password')\n ->type('description', 'This is just a short description about Ben Gates')\n ->press('Register')\n ->screenshot('register')\n ->assertPathIs('/register');\n });\n }", "public function actionIsNotAllowed()\n {\n throw new NotFoundException(__('Page not found.'));\n }", "function shShouldRedirectFromNonSef($pageInfo)\n{\n\tdie('voluntary die in ' . __METHOD__ . ' of class ' . __CLASS__);\n}", "public function test_IndexError(){\n\t\t$this->validateTestException(\n\t\t\t$this->fullURL,\n\t\t\t'GET',\n\t\t\t$this->data,\n\t\t\t'NotImplementedException',\n\t\t\t'index'\n\t\t);\n\t}", "public function test_err404_2()\n {\n $this->request('GET', ['pages/test', 'index']);\n $this->assertResponseCode(404);\n }", "public function testConstructInvalidArgument($content)\n {\n (new Dom($content));\n }", "public function testValidationFail() {\n $nbRecords = $this->Links->find('all')->count();\n //Build bad data with an empty token\n $badData = $this->goodData;\n $badData['title'] = '';\n\n $this->Links->save($this->Links->newEntity($badData));\n //Check no data has been inserted\n $this->assertEquals($nbRecords, $this->Links->find('all')->count(),\n 'Bad data has not been inserted');\n }", "public function testConstructorInvalidType()\n\t{\n\t\t$this->expectException(\\RuntimeException::class);\n\t\tnew Builder('foo');\n\t}", "function errorMessageIllegal( $page, $crewid, $expected, $actual ) {\n\techo \"<div class='body'>\";\n\t\techo \"<span class='fontTitle'>Warning!</span><br /><br />\";\n\t\techo \"You have attempted an illegal operation!\";\n\techo \"</div>\";\n}", "public function test404PagesLoggedIn()\n {\n $this->loginAsSuperadmin();\n $testUrls = [\n $this->Slug->getProductDetail(4234, 'not valid product name'),\n $this->Slug->getCategoryDetail(4234, 'not valid category name')\n ];\n $this->assertPagesFor404($testUrls);\n $this->logout();\n }", "public function testNonAdminUserCannotViewThePageIndex()\n {\n $response = $this\n ->actingAs($this->user)\n ->get('/admin/blog/pages');\n\n $response->assertStatus(403);\n }", "function testInvalidGet() {\n $this->get('/something/def');\n $this->assertEqual(api_response::getInstance()->getCode(), 404);\n $this->assertText('/error/code', '100');\n $this->assertText('/error/msg', 'Bucket not defined: something');\n }", "function _quail_server_is_error_page($url, $page, $website) {\n\treturn ($url == $website->ac_server['404_url'] || md5(trim($page)) == $website->ac_server['404_hash']);\n}", "public function checkPageUnavailableHandler() {}", "public function testFinderRangeLifeErrors() {\n $this->setExpectedException('BadFunctionCallException');\n $this->Links->find('rangeLife');\n }", "public function cestBadParams(\\FunctionalTester $I)\n {\n /**\n * @todo IMPLEMENT THIS\n */\n $I->amOnPage([\n 'base/api',\n 'users' => [ ],\n 'platforms' => [ ]\n ]);\n\n $I->seeResponseCodeIs(400);\n\n }", "public function testInvalid(): void\n {\n $validator = new PropertyValidator('foo');\n $result = $validator->validate((object)[\n 'bar' => 'foo',\n ]);\n\n $this->assertFalse($result->isValid());\n }", "public function pageNotFound() {\n\n $this->page->getPage('page_not_found.tpl');\n }", "public function testConstructor_invalidClass()\n {\n new DataPoint('uniqueid', 'an offense', new \\DateTime(), 'Gotham', ['lat' => 0, 'lon' => 0], 'FELONY', '1337');\n }", "public function testCreatePage()\n {\n // 1. Create Page\n $this->createPage();\n\n // 2. Test if content is created\n $this->assertTrue(Content::first() ? true : false);\n }", "public function testInvalid(): void\n {\n $validator = new ControlValidator();\n\n $this->assertFalse($validator->validate('arf12')->isValid());\n }", "public function testOfficeDetailsPageIsValidWithoutCrawls() {\n // but at least in our dev/test environments, no crawls have run yet, so the DB should be empty.\n $this->request('GET', 'offices/detail/49015');\n $this->assertResponseCode(200);\n }", "public function invalidAction($action) {\t\r\n\t\t$this->render(array('default', 'pageNotFound'));\r\n\t}", "public function test404()\n {\n $this->get('/')->assertStatus(404);\n $this->get('non-existing-page')->assertStatus(404);\n }", "public function testParseError(): void\n {\n $this->expectException(MissingRouteException::class);\n\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);\n Router::parseRequest($this->makeRequest('/nope', 'GET'));\n }", "public function testConstructor_invalidCategory()\n {\n new DataPoint('uniqueid', 'an offense', new \\DateTime(), 'Gotham', ['lat' => 0, 'lon' => 0], 'invalid', '1');\n }", "public function testCreateFailPrivateConstructor() {\n $this->expectException(Exception::class);\n $this->_createCreator()->create(ConstructTest\\PrivateConstruct::class);\n }", "public function testCaseFailureFrontEnd()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/contact')\n ->type('fullname', 'john doe')\n ->type('phone', '12321321')\n ->type('email', '[email protected]')\n ->type('message', 'Demo message')\n ->press('singlebutton')\n ->assertSee('The phone must be 10 digits.',10);\n });\n $this->browse(function (Browser $browser) {\n $browser->visit('/contact')\n ->type('fullname', 'john doe')\n ->type('phone', '12321321')\n ->type('email', 'shanti.gola@s')\n ->type('message', 'Demo message')\n ->click('button')\n ->assertSee('The email must be a valid email address.');\n });\n\n\n }", "public function testConstructorErrorLocationNotWriteable()\n {\n return true;\n }", "public function testConstructorErrorLocationNotWriteable()\n {\n return true;\n }", "public function test_it_should_not_throw_en_exception_on_valid_url($url = '', $expected = '')\n {\n $actual = SourceFactory::create($url);\n $this->assertInstanceOf($expected, $actual);\n }", "final public function itShouldNotBeInstantiable(): void\n {\n $this->expectException(Error::class);\n\n new Pure();\n }", "public function testConstructInvalidHTML(string $html)\n {\n (new Dom($html));\n }", "public function test_invalid_user() {\n\n $client = new GuzzleHttp\\Client();\n $crawler = new InstagramCrawler($client,$this->access_token,[/*no tags*/],[\"worng.user.never.exi7ste31d\"]);\n\n $this->setExpectedException('Instagram2Vk\\Exceptions\\InstagramException');\n $data = $crawler->crawl();\n\n }", "public function testNoError404WithGoodExhibitPageSlug()\n {\n $exhibits = get_records('Exhibit');\n $this->assertEquals(1, count($exhibits));\n $exhibit = $exhibits[0];\n $exhibit->slug = 'goodexhibitslug';\n $exhibit->save();\n $this->assertEquals('goodexhibitslug', $exhibit->slug, 'Bad exhibit slug.');\n\n $exhibitPage = new ExhibitPage;\n $exhibitPage->title = 'Test Page';\n $exhibitPage->order = 1;\n $exhibitPage->layout = 'image-list-left-thumbs';\n $exhibitPage->slug = 'goodexhibitpageslug';\n $exhibitPage->exhibit_id = $exhibit->id;\n $exhibitPage->save();\n $this->assertTrue($exhibitPage->exists());\n\n try {\n $this->dispatch('exhibits/show/goodexhibitslug/goodexhibitpageslug');\n } catch (Exception $e) {\n $this->fail('Should not have thrown a 404 error for a good exhibit page slug.');\n }\n }", "public function pageAddressNot($page)\n {\n $this->assertSession()->addressNotEquals($this->locatePath($page));\n }", "public function testInvalidParams()\n {\n $distance = new Distance();\n\n $distance->between('1', 1, 'not a float', 'invalid');\n }", "public function FrontControllerIsVisitedOrDie() {\n\t\t\n\t\tglobal $gPage; // Always defined in frontcontroller\n\t\t\n\t\tif(!isset($gPage)) {\n\t\t\tdie('No direct access to pagecontroller is allowed.');\n\t\t}\n\t}", "public function testShowInvalid(): void\n {\n $response = $this->json('GET', '/api/menus/test');\n\n $response->assertStatus(400);\n }", "public function test__constructThrowsInvalidAdapterException()\n {\n $mockAdapter = $this->getMock('MphpFlickrBase\\Adapter\\Interfaces\\Result\\ResultAdapterInterface');\n $this->assertInstanceOf('MphpFlickrBase\\Adapter\\Interfaces\\Result\\ResultAdapterInterface', $mockAdapter);\n $this->assertNotInstanceOf('MphpFlickrPhotosGetInfo\\Adapter\\Interfaces\\Result\\TagResultAdapterInterface', $mockAdapter);\n\n $urlResult = new \\MphpFlickrPhotosGetInfo\\Result\\UrlResult($mockAdapter);\n }", "public function isMenuValidBlankCallExpectFalse() {}", "public function testGuestNotAccessHomePage()\n\t{\n\t\t$this->open('/');\n\t\t$this->assertTextNotPresent('Home');\n\t}", "public function test_an_invalid_source_location_returns_an_invalid_certificate()\n {\n $web = new Web('somesource');\n $cert = $web->load();\n $this->assertFalse($cert->isValid());\n }", "public function test_it_cannot_create_invalid_model()\n {\n // we attempt to create an invalid model\n //\n // $forms = [\n // 'Name' => [ 'text' => 'Kelt' ],\n // 'Email' => [ 'text' => '[email protected]' ],\n // ];\n\n // $model = $this->ModelMapper->create('DvsUser', $pageVersionId = 1, $forms);\n\n // dd($model->toArray());\n }", "public function pageDontExist()\n\t{\n\t\theader(\"Location: /core/pages/404.php\");\n\n\t\treturn (bool)false;\n\t}", "public function testUrlError() {\n\t\t$this->Helper->url('nope.js');\n\t}", "static function show_404($page = '')\n\t{ \t\n\t\tself::initCoreComponent('SHIN_Exceptions');\n\t\tself::$_exceptions->show_404($page);\n\t\texit;\n\t}", "public function testValidationException()\n {\n $random = new Random($this->getValidatorStubFail());\n\n $random->validate();\n }", "public function testUnauthorizedPageAccess($url): void\n {\n $client = static::createClient();\n $client->request('GET', $url);\n\n self::assertTrue($client->getResponse()->isRedirection());\n }", "public function testIsValidNoValue()\n {\n $this->assertTrue($this->uut->isValid());\n }", "public function __construct($page)\n {\n $this->page = $page;\n }", "public function isErrorPage() {\n return $this->uri === $this->kirby->options['error'];\n }", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "public function test_it_should_throw_an_exception_on_invalid_mapping()\n {\n SourceFactory::create('unknown://www.google.com');\n }", "public function testInvalidTokenToConstruct()\n {\n $this->expectException(\\InvalidArgumentException::class);\n $slackAPIObject = new Webhook(null);\n }", "public function testInvalidConstruct($invalidArgument)\n {\n $validator = $this->validatorClass;\n new $validator($invalidArgument);\n }", "public function pageNotExists()\n {\n $action = __NAMESPACE__ . '\\actions\\PageNotExists';\n\n $result = $this->actionController->executeAction($action);\n $content = ($result->getSuccess()) ?:\n 'A Page With That Name Already Exists';\n\n $result->setContent($content)\n ->Render();\n }", "public function testFacebookPagesRequest()\n {\n $stream = $this->getStream('FacebookPages', '27469195051');\n $response = $stream->getResponse();\n\n $this->checkResponseIntegrity('FacebookPages', $response);\n\n $errors = $stream->getErrors();\n $this->assertTrue(empty($errors));\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\tlibxml_use_internal_errors(true);\n\t\tif (filter_var($GLOBALS['TL_CONFIG']['portal64Link'], FILTER_VALIDATE_URL) === false) {\n\t\t\tthrow new \\Exception('No valid URL for portal64 is configured.');\n\t\t}\n\t}", "public function testInvalidVersionNumber(): void\n\t{\n\t\t$this->expectException(LycheeInvalidArgumentException::class);\n\t\tVersion::createFromInt(1000000);\n\t}", "public function getFormErrorPage();", "public function testGuestNotAccessUsersPage()\n\t{\n\t\t$this->open('user');\n\t\t$this->assertTextNotPresent('Users');\n\t}", "public function testCreateCategoryFail()\n { \n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/category/create')\n ->type('name', '')\n ->press('Submit')\n ->assertSee('The name field is required.')\n ->assertPathIs('/admin/category/create');\n });\n }", "public function __construct($strPage, $strMessage, $intCode = 0, Exception $previous = null) {\n $this->_strPage = $strPage;\n parent::__construct($strMessage, $intCode, $previous);\n }", "public function testGetResetPasswordPageInvalidArgumentError()\n\t{\n\t\t$this->call('orchestra::forgot@reset', array('hello world', ''));\n\t\t$this->assertResponseNotFound();\n\t}", "public function testCreateUnsuccessfulReason()\n {\n }", "public function testAdminCanNotAddADuplicatedPageTitle()\n {\n $existPage = Post::factory()->create(['post_type' => Post::PAGE]);\n\n $params = [\n 'title' => $existPage->title,\n ];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/blog/pages', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasErrors();\n\n $errors = session('errors');\n $this->assertEquals('The title has already been taken.', $errors->get('title')[0]);\n }", "public function testFindPageThrowsErrorMessageForMissingFieldName()\n\t{\n\t\t$e = $this->mockException(404, 'Unknown field');\n\t\t$this->mock('Item')->shouldReceive('search')->once()->andThrow($e);\n $this->getActionWithException('ItemsController@show', 'somethingThatDoesNotExist', 404, 'Unknown field');\n\t}", "public function test_err404()\n {\n $this->request('GET', ['err404', 'index']);\n $this->assertResponseCode(404);\n }", "function valid_page($id) {\n $id = trim($id);\n if(page_exists($id) && isVisiblePage($id) && ! (auth_quickaclcheck($id) < AUTH_READ)) {\n return true;\n } else {\n return false;\n }\n}", "private function setNotFoundPage()\n {\n $this->design->setRedirect(\n Uri::get(\n 'newsletter',\n 'admin',\n 'browse'\n ),\n null,\n null,\n self::REDIRECTION_DELAY_IN_SEC\n );\n $this->displayPageNotFound(t('Sorry, Your search returned no results!'));\n }", "public static function page_404($message = '')\n {\n $message = $message ? $message : 'Page not found';\n $response = new static($message);\n $response->set_status(404);\n return $response;\n }", "public function test_cannot_fetch_link_from_invalid_shortlink()\n {\n $this->get(route('shortlink.fetch.link', ['code' => 'invalid']))->assertStatus(404);\n }", "public function __construct ()\n {\n if ($this->webIsEnabled()) {\n $this->thePage();\n } else {\n if (! Helper::urlContains('_administrator')) {\n echo '<p>Sorry we will be back soon.</p>';\n } else {\n $this->thePage();\n }\n }\n }", "private function throw404IfNotFound($page)\n {\n if (is_null($page)) {\n $this->app->abort('404');\n }\n }", "public function test_cannot_fetch_hits_of_invalid_shortlink()\n {\n $this->get(route('shortlink.fetch.hits', ['code' => 'invalid']))->assertStatus(404);\n }", "protected function assertPageNotContain($string)\n {\n // Set error message\n $message = 'Page contain \"'.$string.'\"';\n \n $this->assertFalse(strpos($this->response->getContent(), $string) !== false, $message);\n }" ]
[ "0.6741501", "0.66459084", "0.64610624", "0.6359607", "0.6358735", "0.62769055", "0.6220618", "0.61645335", "0.6139091", "0.61272395", "0.60980564", "0.6085131", "0.60685724", "0.6056345", "0.60298026", "0.6008254", "0.5976627", "0.5976627", "0.59700674", "0.59246576", "0.5911391", "0.5893601", "0.58791864", "0.5876691", "0.58678657", "0.58392847", "0.580888", "0.5798821", "0.5792525", "0.5777033", "0.577022", "0.5769321", "0.5761142", "0.57531315", "0.5742612", "0.5735658", "0.5732575", "0.5720715", "0.5702155", "0.5692734", "0.5690545", "0.5687888", "0.567126", "0.5668101", "0.5646957", "0.5646615", "0.5630576", "0.5629593", "0.56295854", "0.5625023", "0.5623318", "0.5617683", "0.5617683", "0.561111", "0.5603636", "0.55960065", "0.55945987", "0.55879414", "0.55875665", "0.5558967", "0.55562377", "0.5532814", "0.55295396", "0.5522642", "0.5522591", "0.55199695", "0.55103666", "0.55091935", "0.5503816", "0.55031997", "0.55010897", "0.5499628", "0.54896754", "0.54852825", "0.5483658", "0.54828846", "0.54811347", "0.5476388", "0.54742014", "0.54706603", "0.5467897", "0.5455629", "0.54435235", "0.544166", "0.54353875", "0.5429827", "0.542544", "0.5421577", "0.5420657", "0.5419015", "0.5409754", "0.540591", "0.5402937", "0.5402393", "0.5402114", "0.54001534", "0.5399575", "0.5398854", "0.5398249", "0.5389815" ]
0.7546506
0
Tests the writeElement() method.
public function testWriteElement() { $writer = new XmlSitemapWriter($this->sitemap, '1'); $writer->openMemory(); $writer->writeElement('url', [ 'item1' => 'value1', [ 'key' => 'item2', 'value' => '<value2>', ], [ 'key' => 'item3', 'value' => [ 'subkey' => 'subvalue', ], 'attributes' => [ 'attr1key' => 'attr1value', 'attr2key' => '<attr2value>', ], ], ]); $output = $writer->outputMemory(); $expected = '<url><item1>value1</item1><item2>&lt;value2&gt;</item2><item3 attr1key="attr1value" attr2key="&lt;attr2value&gt;"><subkey>subvalue</subkey></item3></url>' . PHP_EOL; $this->assertEquals($expected, $output); $writer->writeElement('url', [ 'loc' => 'https://www.example.com/test', 'image:image' => [ 'image:loc' => Url::fromUri('https://www.example.com/test.jpg'), 'image:title' => new TranslatableMarkup('The image title'), 'image:caption' => "'The image & its \"caption.\"'", ], ]); $output = $writer->outputMemory(); $expected = '<url><loc>https://www.example.com/test</loc><image:image><image:loc>https://www.example.com/test.jpg</image:loc><image:title>The image title</image:title><image:caption>&#039;The image &amp; its &quot;caption.&quot;&#039;</image:caption></image:image></url>' . PHP_EOL; $this->assertSame($expected, $output); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testWrite()\n {\n //Tries some values\n foreach ([\n ['first', 'second'],\n [],\n [true],\n [false],\n [null],\n ] as $value) {\n $this->assertTrue($this->SerializedArray->write($value));\n $result = safe_unserialize(file_get_contents($this->file));\n $this->assertEquals($value, $result);\n $this->assertIsArray($result);\n }\n }", "public function write()\n {\n $this->assertEquals('', $this->memoryOutputStream->getBuffer());\n $this->assertEquals(5, $this->memoryOutputStream->write('hello'));\n $this->assertEquals('hello', $this->memoryOutputStream->getBuffer());\n }", "abstract protected function _write();", "protected function _write() {}", "abstract protected function write();", "public function write();", "public function write();", "public function write()\n {\n }", "public function testBinaryWrite()\n {\n $binary = new BinaryGenerator();\n\n $binary->start($this->writeFile, BinaryGenerator::WRITE);\n $binary->writeData('some data.1');\n $binary->writeData('some data.2');\n $binary->finish();\n\n $this->assertFileExists($this->writeFile);\n }", "public function testWriteXml() {\n\n /* @var $export \\MDN_Antidot_Model_Export_Article */\n $export = Mage::getModel('Antidot/export_article');\n\n $context = Mage::getModel('Antidot/export_context', array('fr', 'PHPUNIT'));\n //Store id 3 : site FR, id5 : site FR discount\n $context->addStore(Mage::getModel('core/store')->load(3));\n $context->addStore(Mage::getModel('core/store')->load(5));\n\n $type = MDN_Antidot_Model_Observer::GENERATE_FULL;\n\n $filename = sys_get_temp_dir().DS.sprintf(MDN_Antidot_Model_Export_Article::FILENAME_XML, 'jetpulp', $type, $context->getLang());\n\n $items = $export->writeXml($context, $filename, $type);\n\n /*\n * test three articles are exported, number returned by the method: 2 articles, one one 2 websites => 3 article exported\n */\n $this->assertEquals(3, $items);\n\n //replace generated_at by the one in the expected result\n $result = file_get_contents($filename);\n\n /**\n * test the xml contains the correct owner tag\n */\n $xml = new SimpleXMLElement($result);\n $this->assertEquals(\"JETPULP\", (string)$xml->header->owner);\n\n /**\n * test the xml contains the correct feed tag\n */\n $this->assertEquals('article PHPUNIT v'.Mage::getConfig()->getNode()->modules->MDN_Antidot->version, (string)$xml->header->feed);\n\n /**\n * test the xml contains the correct websites tag\n */\n $this->assertEquals('3', $xml->article[0]->websites->website[0]['id']);\n $this->assertEquals('French Website', (string)$xml->article[0]->websites->website[0]);\n $this->assertEquals('3', $xml->article[1]->websites->website[0]['id']);\n $this->assertEquals('French Website', (string)$xml->article[1]->websites->website[0]);\n $this->assertEquals('5', $xml->article[2]->websites->website[0]['id']);\n $this->assertEquals('France Website_discount', (string)$xml->article[2]->websites->website[0]);\n\n /**\n * test the xml contains the correct name tag\n */\n $this->assertEquals('Article A', (string)$xml->article[0]->title);\n $this->assertEquals('Article B', (string)$xml->article[1]->title);\n $this->assertEquals('Article B', (string)$xml->article[2]->title);\n\n\n /**\n * test the xml contains the correct text tag\n */\n $this->assertEquals('test contenu A test', (string)$xml->article[0]->text);\n $this->assertEquals('test contenu B test', (string)$xml->article[1]->text);\n $this->assertEquals('test contenu B test', (string)$xml->article[2]->text);\n\n\n /**\n * test the xml contains the correct url tags\n */\n $this->assertEquals('http://www.monsiteweb.fr/AA/', (string)$xml->article[0]->url);\n $this->assertEquals('http://www.monsiteweb.fr/BB/', (string)$xml->article[1]->url);\n $this->assertEquals('http://www.monsitediscount.fr/BB/', (string)$xml->article[2]->url);\n\n\n /**\n * test the xml contains the identifier\n */\n $this->assertEquals('identifier', $xml->article[0]->identifiers->identifier[0]['type']);\n $this->assertEquals('identifier', $xml->article[1]->identifiers->identifier[0]['type']);\n $this->assertEquals('identifier', $xml->article[2]->identifiers->identifier[0]['type']);\n $this->assertEquals('AA', $xml->article[0]->identifiers->identifier[0]);\n $this->assertEquals('BB', $xml->article[1]->identifiers->identifier[0]);\n $this->assertEquals('BB', $xml->article[2]->identifiers->identifier[0]);\n\n\n\n\n }", "public function testElement()\n {\n $layer = new Layer($this->fivePieces);\n $this->assertTrue($layer->element(0)->id === 961);\n $this->assertTrue($layer->element(6) === null);\n }", "public function write($xml);", "function write()\n {\n }", "abstract public function write( $value );", "public function testSetElement()\n {\n $this->todo('stub');\n }", "function writeXMLFile($node, $filename) {\n\tglobal $gui_writedir;\n\t$previous_dir = getcwd();\n\tchdir($gui_writedir);\n\t$file = fopen($filename, 'w+');\n\t$result = fwrite($file, $node->asXML());\n\tif (!$result) {\n\t\tfclose($file);\n\t\tdie(\"Failed to write $filename\\n\");\n\t}\n\techo \"Successfully wrote $filename<br />\";\n\tfclose($file);\n\tchdir($previous_dir);\n}", "public function saveElement(CacheElement $element)\n {\n $path = $element->getPath() . '/index.' . $element->getType(); //Type contains extension\n\n return $this->finder->writeFile($path, $element->getContent());\n }", "public function testSimpleXmlElement(): void\n {\n $handler = new SimpleXMLElementHandler();\n $result = $handler->handle('<test>data</test>');\n $this->assertEquals(new \\SimpleXMLElement('<test>data</test>'), $result);\n }", "abstract public function write($data);", "function writeDom($dom, $file_name){\n @$dom->validate();\n if(!$handle=fopen(dirname(__FILE__).\"/\".$file_name, 'w')){\n exit(\"Cannot open $filename\");\n }\n\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = false;\n if (fwrite($handle, $dom->saveXML()) === FALSE) {\n fclose($handle);\n exit(\"Cannot write to $file_name\");\n }\n}", "public function testBoolWrite(): void\n {\n // opening spreadsheet in Excel 2007-2016. Test verifies that\n // value field is written correctly for those versions.\n $outputFilename = File::temporaryFilename();\n $spreadsheet = new Spreadsheet();\n $worksheet = $spreadsheet->getActiveSheet();\n $worksheet->fromArray(['A', 'B', 'C', 'D']);\n $worksheet->getCell('A2')->setValue('=A1<>\"A\"');\n $worksheet->getCell('A3')->setValue('=A1=\"A\"');\n $worksheet->getCell('B2')->setValue('=LEFT(B1, 0)');\n $worksheet->getCell('B3')->setValue('=B2=\"\"');\n\n $writer = new Writer($spreadsheet);\n $writer->save($outputFilename);\n $zipfile = \"zip://$outputFilename#xl/worksheets/sheet1.xml\";\n $contents = file_get_contents($zipfile);\n unlink($outputFilename);\n if ($contents === false) {\n self::fail('Unable to open file');\n } else {\n self::assertStringContainsString('<c r=\"A2\" t=\"b\"><f>A1&lt;&gt;&quot;A&quot;</f><v>0</v></c>', $contents);\n self::assertStringContainsString('<c r=\"A3\" t=\"b\"><f>A1=&quot;A&quot;</f><v>1</v></c>', $contents);\n self::assertStringContainsString('<c r=\"B2\" t=\"str\"><f>LEFT(B1, 0)</f><v></v></c>', $contents);\n self::assertStringContainsString('<c r=\"B3\" t=\"b\"><f>B2=&quot;&quot;</f><v>1</v></c>', $contents);\n }\n }", "public function writeTo(XmlWriter $w) { }", "public function testInvalidElementName()\n {\n $writer = new XMLWriter();\n $writer->openMemory();\n $writer->setIndent(true);\n $writer->startDocument('1.0', 'UTF-8');\n\n $key = '';\n for ($i = 0; $i <= 0x7F; $i++) {\n $key.= chr($i);\n }\n\n $record = Record::fromArray([\n $key => 'foo'\n ]);\n\n $graph = new GraphTraverser();\n $graph->traverse($record, new XmlWriterVisitor($writer));\n\n $expect = <<<XML\n<?xml version=\"1.0\"?>\n<record>\n <________________________________________________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz_____>foo</________________________________________________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz_____>\n</record>\nXML;\n\n $this->assertXmlStringEqualsXmlString($expect, $writer->outputMemory());\n }", "public function _write($data)\n {\n }", "public function write(): bool\n {\n }", "public function write(): bool\n {\n }", "public function testWriteIsCalled()\n {\n // Mock the SentryLogWriter\n $spy = \\Phockito::spy('phptek\\Sentry\\SentryLogWriter');\n\n // Register it\n \\SS_Log::add_writer($spy, \\SS_Log::ERR, '<=');\n\n // Invoke SentryLogWriter::_write()\n \\SS_Log::log('You have one minute to reach minimum safe distance.', \\SS_Log::ERR);\n\n // Verificate\n \\Phockito::verify($spy, 1)->_write(arrayValue());\n }", "public function writeable();", "public function testWrite() {\n $writer = new \\Nimbles\\Core\\Log\\Writer\\Mock(array(\n 'formatter' => array(\n 'simple' => array(\n 'format' => '%message%'\n )\n )\n ));\n\n $writer->write(new \\Nimbles\\Core\\Log\\Entry('This is a test message 1'));\n $writer->write(new \\Nimbles\\Core\\Log\\Entry('This is a test message 2'));\n $entries = $writer->getEntries();\n\n $this->assertEquals('This is a test message 1', $entries[0]);\n $this->assertEquals('This is a test message 2', $entries[1]);\n }", "function write($offset, $data) {}", "public function testSetElements()\n {\n $this->todo('stub');\n }", "public function write() {\n var_dump($this->as_array());\n }", "function saveHTML()\n{\n global $html;\n global $root;\n global $body;\n\n # create stat of passed tests\n createStats();\n\n $root->appendChild($body);\n $html->appendChild($root);\n echo \"Wrote: \" . $html->saveHTMLFile(\"testResults.html\") . \" bytes\\n\";\n #echo $html->saveHTML();\n\n}", "public function writeToFile(): bool;", "public function testAddingAnElementWillReturnTrue()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 2';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $response = $Collection->add($element1);\n $this->assertTrue($response);\n\n $elements = \\PHPUnit_Framework_Assert::readAttribute($Collection, 'elements');\n $this->assertEquals(array($element1), $elements);\n }", "protected function assertRenderedElement(array $element, string $xpath, array $xpath_args = []): void {\n $this->render($element);\n\n $xpath = $this->buildXPathQuery($xpath, $xpath_args);\n $element += ['#value' => NULL];\n $this->assertFieldByXPath($xpath, $element['#value'], new FormattableMarkup('#type @type was properly rendered.', [\n '@type' => var_export($element['#type'], TRUE),\n ]));\n }", "public function testBuildElementElementCreateEltWhenAll(): void\n {\n $this->sut->buildElementElement();\n $this->sut->endElement();\n $this->sut->buildElementElement();\n $sch = $this->sut->getSchema();\n \n static::assertAncestorsNotChanged($sch);\n \n $all = static::getCurrentElement($sch);\n self::assertElementNamespaceDeclarations([], $all);\n self::assertAllElementHasNoAttribute($all);\n self::assertCount(2, $all->getElements());\n \n $elts = $all->getElementElements();\n \n self::assertElementNamespaceDeclarations([], $elts[0]);\n self::assertElementElementHasNoAttribute($elts[0]);\n self::assertSame([], $elts[0]->getElements());\n \n self::assertElementNamespaceDeclarations([], $elts[1]);\n self::assertElementElementHasNoAttribute($elts[1]);\n self::assertSame([], $elts[1]->getElements());\n }", "public function writeXML($file)\r\n \t{\r\n \t\t$doc = new DOMDocument();\r\n \t\t$doc->formatOutput = true;\r\n \r\n \t\t$tests = $doc->createElement(\"tests\");\r\n \t\t$doc->appendChild($tests);\r\n \r\n \t \t//get the array of results\r\n \t\t$resultsArray = $this->suite->getTestCases();\r\n \t\tforeach($resultsArray as $testCase)\r\n \t\t{\r\n\t \t\t//create the test element \r\n\t \t\t$test = $doc->createElement(\"test\");\r\n \t\r\n\t \t\t//attach test's elements\r\n\t \t\t$result = $testCase->getResult(); \r\n\t \t\t$resultElement = $doc ->createElement(\"result\");\r\n\t \t\t$resultElement ->appendChild($doc->createTextNode($result));\r\n \t\t\r\n \t\t\t$category = $testCase->getCategory(); \r\n \t\t\t$categoryElement = $doc ->createElement(\"category\");\r\n \t\t\t$categoryElement ->appendChild($doc->createTextNode($category));\r\n \t\r\n \t\t\t$name = $testCase->getName(); \r\n \t\t\t$nameElement = $doc ->createElement(\"name\");\r\n \t\t\t$nameElement ->appendChild($doc->createTextNode($name));\r\n \t\r\n \t\t\t$description = $testCase->getDescription(); \r\n \t\t\t$descriptionElement = $doc ->createElement(\"description\");\r\n \t\t\t$descriptionElement ->appendChild($doc->createTextNode($description));\r\n \t\r\n \t\t\t//attach elements to their parent's\r\n \t\t\t$test ->appendChild($resultElement);\r\n \t\t\t$test ->appendChild($categoryElement);\r\n \t\t\t$test ->appendChild($nameElement);\r\n \t\t\t$test ->appendChild($descriptionElement);\r\n \t\t\t$tests ->appendChild($test); \r\n \t\t\t$doc ->appendChild($tests);\r\n \t\t}\r\n \r\n\t\t //writes the string to disk\r\n \t\t$xmlString = $doc->saveXML();\r\n \t\t$openFile = fopen($file, 'w');\r\n \t\tif(!$openFile) \r\n \t\t\tthrow new Exception(\"Could not open XML file\");\r\n \r\n \t\telse\r\n \t\t{\r\n \t\t\tfputs($openFile, $xmlString);\r\n \t \t fclose($openFile);\r\n\t \t}\r\n\t }", "function exportXML(&$a_xml_writer, $a_inst, &$expLog)\n\t{\n\t\tglobal $ilBench;\n\n\t\t$expLog->write(date(\"[y-m-d H:i:s] \").\"Structure Object \".$this->getId());\n\t\t$attrs = array();\n\t\t$a_xml_writer->xmlStartTag(\"StructureObject\", $attrs);\n\n\t\t// MetaData\n\t\t$ilBench->start(\"ContentObjectExport\", \"exportStructureObject_exportMeta\");\n\t\t$this->exportXMLMetaData($a_xml_writer);\n\t\t$ilBench->stop(\"ContentObjectExport\", \"exportStructureObject_exportMeta\");\n\n\t\t// StructureObjects\n\t\t$ilBench->start(\"ContentObjectExport\", \"exportStructureObject_exportPageObjects\");\n\t\t$this->exportXMLPageObjects($a_xml_writer, $a_inst);\n\t\t$ilBench->stop(\"ContentObjectExport\", \"exportStructureObject_exportPageObjects\");\n\n\t\t// PageObjects\n\t\t$this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);\n\n\t\t// Layout\n\t\t// not implemented\n\n\t\t$a_xml_writer->xmlEndTag(\"StructureObject\");\n\t}", "public function testWriteShort()\n {\n $filename = tmp_path(uid());\n $data = [\n 'foo' => 'bar',\n 'empty' => [],\n 'bar' => [\n 'foo' => 'bar',\n 'bar' => [\n 'foo' => 'bar',\n 'empty' => [],\n ]\n ]\n ];\n $file = new PhpFile();\n $file->write($filename, $data, ['short' => true]);\n\n $this->assertSame($data, $file->read($filename));\n }", "public function addElement(TestInterface $element);", "protected function write_xml($element, array $data, array $attribs = array(), $parent = '/') {\n\n if (!$this->has_xml_writer()) {\n throw new moodle1_convert_exception('write_xml_without_writer');\n }\n\n $mypath = $parent . $element;\n $myattribs = array();\n\n // detect properties that should be rendered as element's attributes instead of children\n foreach ($data as $name => $value) {\n if (!is_array($value)) {\n if (in_array($mypath . '/' . $name, $attribs)) {\n $myattribs[$name] = $value;\n unset($data[$name]);\n }\n }\n }\n\n // reorder the $data so that all sub-branches are at the end (needed by our parser)\n $leaves = array();\n $branches = array();\n foreach ($data as $name => $value) {\n if (is_array($value)) {\n $branches[$name] = $value;\n } else {\n $leaves[$name] = $value;\n }\n }\n $data = array_merge($leaves, $branches);\n\n $this->xmlwriter->begin_tag($element, $myattribs);\n\n foreach ($data as $name => $value) {\n if (is_array($value)) {\n // recursively call self\n $this->write_xml($name, $value, $attribs, $mypath);\n } else {\n $this->xmlwriter->full_tag($name, $value);\n }\n }\n\n $this->xmlwriter->end_tag($element);\n }", "private function registerWriter() : void\n {\n $this->fixture->offsetSet('index', $this->writer);\n }", "public function testComplexTypeElementWhenAddedToElementElement(): void\n {\n $parent = new ElementElement();\n $parent->setTypeElement($this->sut);\n self::assertTrue($this->sut->hasParent());\n self::assertSame($parent, $this->sut->getParent());\n }", "function writeToFile($testname, $testdesc, $array) {\n\tif($handler = fopen(\"/datafiles/testscriptjson/\" . $testname . '.json', 'w+')){\n\t\t// encode array to JSON format\n\t\t$jsonArray = json_encode($array);\n\t\t\n\t\t// write json string to the file\n\t\tif(fwrite($handler, $jsonArray) === FALSE){\n\t\t\techo \"Cannot write to file ($testname.json)\";\n\t\t\texit;\n\t\t} else {\n\t\t\t// if successful, close the handler\n\t\t\tfclose($handle);\n\t\t}\n\t} else {\n\t\techo \"Cannot open file ($testname.json)\";\n\t\texit;\n\t}\n\t\n\t// open a file for writing to xml file, if it does not exist, create one\n\tif($handler = fopen(\"/datafiles/testscriptfiles/\" . $testname . '.xml', 'w+')){\n\t\t// decode JSON to an array\n\t\t$arrayJson = json_decode($jsonArray);\n\t\t\n\t\t// make a string according to invader+ xml format\n\t\t$xmlString = \"<test id=\\\"$testname\\\" des=\\\"$testdesc\\\">\";\n\t\t\n\t\tforeach ($arrayJson as $item) {\n\t\t\t// remove return key\n\t\t\t$targetItem = preg_replace(\"/\\n/\", \"\", $item->target);\n\t\t\t$companionItem = preg_replace(\"/\\n/\", \"\", $item->companion);\n\t\t\t\n\t\t\tif (strlen($targetItem) > 0 And strlen($companionItem) > 0) {\n\t\t\t\t$xmlString = $xmlString . \"<block concurrent=\\\"true\\\" id=\\\"$testname\\\">\";\n\t\t\t} else {\n\t\t\t\t$xmlString = $xmlString . \"<block id=\\\"$testname\\\">\";\n\t\t\t}\n\t\t\t\n\t\t\t// write target field\n\t\t\tif (strlen($targetItem) > 0) {\n\t\t\t\t$xmlString = $xmlString .\n\t\t\t\t\t\t\t\"\\t<module method=\\\"\" . getMethod($targetItem) . \"\\\" class=\\\"\" . getClass($targetItem) . \"\\\" id=\\\"$testname\\\"\" .\n\t\t\t\t\t\t\tgetConfig($targetItem, \"delay=\") . \">\" .\n\t\t\t\t\t\t\t\"\\t\\t<param name=\\\"deviceID\\\">TARGET_DEV</param>\";\n\t\t\t\t\n\t\t\t\t$xmlString = $xmlString . parseParameterValues($targetItem) . \"</module>\";\n\t\t\t}\n\t\t\t\n\t\t\t// write companion field\n\t\t\tif (strlen($companionItem) > 0) {\n\t\t\t\t$xmlString = $xmlString .\n\t\t\t\t\t\t\t \"\\t<module method=\\\"\" . getMethod($companionItem) . \"\\\" class=\\\"\" . getClass($companionItem) . \"\\\" id=\\\"$testname\\\"\" .\n\t\t\t\t\t\t\t getConfig($companionItem, \"delay=\") . \">\" .\n\t\t\t\t\t\t\t \"\\t\\t<param name=\\\"deviceID\\\">COMPANION_DEV</param>\";\n\t\t\t\t\n\t\t\t\t$xmlString = $xmlString . parseParameterValues($companionItem) . \"</module>\";\n\t\t\t}\n\t\t\t\n\t\t\t$xmlString = $xmlString . \"</block>\";\n\t\t}\n\t\t\n\t\t$xmlString = $xmlString . \"</test>\";\n\t\t\n\t\t// convert & to &amp; to be compatible with html special characters\n\t\t$xmlString = str_replace(\"&\", \"&amp;\", $xmlString);\n\n\t\t// write xml string to the file\n\t\tif(fwrite($handler, $xmlString) === FALSE){\n\t\t\techo \"Cannot write to file ($testname.xml)\";\n\t\t\texit;\n\t\t} else {\n\t\t\t// if successful, close the handler\n\t\t\tfclose($handle);\n\t\t\t\n\t\t\t// write xml string to temp XML file for XML Viewer: Script Viewer\n\t\t\tif($handler = fopen(\"../../tempdata/testscript.xml\", 'w+')) {\n\t\t\t\tif(fwrite($handler, $xmlString) === FALSE){\n\t\t\t\t\techo \"Cannot write to temp file (testscript.xml)\";\n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\t\t\t\tfclose($handler);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \"Cannot open temp file (testscript.xml)\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\techo \"Successfully saved ($testname.xml)\";\n\t\t}\n\t} else {\n\t\techo \"Cannot open file ($testname.xml)\";\n\t\texit;\n\t}\n}", "public function testElement()\n {\n $element = new MultipleFileUpload();\n\n $this->assertEquals('Upload file', $element->getLabel());\n\n $this->assertTrue($element->has('list'));\n $this->assertTrue($element->has('__messages__'));\n $this->assertTrue($element->has('file-controls'));\n $this->assertTrue($element->get('file-controls')->has('file'));\n $this->assertTrue($element->get('file-controls')->has('upload'));\n }", "public function testAttributeElementWhenAddedToSchemaElement(): void\n {\n $parent = new SchemaElement();\n $parent->addAttributeElement($this->sut);\n self::assertTrue($this->sut->hasParent());\n self::assertSame($parent, $this->sut->getParent());\n }", "public function write($data);", "public function write($data);", "public function write($data);", "public function write($data);", "public function testSetTextFoo()\n {\n $document = $this->createDomDocument();\n $element = $document->createElementNS(Atom::NS, 'content');\n $document->documentElement->appendChild($element);\n $content = new Content($this->createFakeNode(), $element);\n $content->setContent('Less: <', 'text/foo');\n static::assertEquals(\n '<content type=\"text/foo\">Less: &lt;</content>',\n $document->saveXML($element)\n );\n }", "static function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, $checkAttributes = false, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertEqualXMLStructure', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function test__toString()\n\t{\n\t\t$expect = <<<DOM\n<option>foo</option>\n<option>bar</option>\n<rdf:metaData>\n\t<rdf:name>\n\tSimon\n\t</rdf:name>\n</rdf:metaData>\nDOM;\n\n\t\t$this->assertEquals(\n\t\t\tDomHelper::minify($expect),\n\t\t\tDomHelper::minify($this->instance)\n\t\t);\n\t}", "protected function _writeFileBody() {}", "public function testPersist(): void\n {\n $this->document->getStructure()->willReturn($this->structure->reveal());\n $this->persistEvent->getDocument()->willReturn($this->document->reveal());\n $this->persistEvent->getOptions()->willReturn([\n 'ignore_required' => false,\n ]);\n\n // map the structure type\n $this->persistEvent->getLocale()->willReturn('fr');\n $this->encoder->contentName('template')->willReturn('i18n:fr-template');\n $this->node->setProperty('i18n:fr-template', 'foobar')->shouldBeCalled();\n\n // map the content\n $this->inspector->getStructureMetadata($this->document->reveal())->willReturn($this->structureMetadata->reveal());\n $this->inspector->getWebspace($this->document->reveal())->willReturn('webspace');\n $this->structureProperty->getType()->willReturn('content_type');\n $this->structureMetadata->getProperties()->willReturn([\n 'prop1' => $this->structureProperty->reveal(),\n ]);\n $this->setupPropertyWrite();\n\n $this->subscriber->saveStructureData($this->persistEvent->reveal());\n }", "public function testWrite()\n\t{\n\t\tCatapult\\Log::write(time(), \"ERROR_CODE\", \"TEST\");\n\t}", "public function write(string $data): bool {}", "public function testGetBackupWithElement()\n {\n $this->backups->expects($this->once())\n ->method('getFinishedBackups')\n ->with('database')\n ->willReturn([$this->backup]);\n\n $this->backup->expects($this->once())\n ->method('getUrl')\n ->willReturn('http://download');\n\n $output = $this->command->getBackup('mysite.dev', ['element' => 'db',]);\n $this->assertEquals($output, 'http://download');\n }", "public function writeContentTo(XmlWriter $w) { }", "public function test1()\n {\n $document = $this->getHTMLDocument();\n $element = $document->createElement('div');\n $document->body->appendChild($element);\n $this->assertSame($document->URL, $element->baseURI);\n }", "public function testWriteWithDefaults(): void\n {\n $fields = [\n 'message' => 'foo',\n 'priority' => 42,\n ];\n\n $this->writer->write($fields);\n\n // insert should be called once...\n $this->assertContains('query', array_keys($this->db->calls));\n $this->assertEquals(1, count($this->db->calls['query']));\n $this->assertContains('execute', array_keys($this->db->calls));\n $this->assertEquals(1, count($this->db->calls['execute']));\n $this->assertEquals([$fields], $this->db->calls['execute'][0]);\n }", "public function write($data) {\n\t}", "public function isOk($element, $msg = \"Excepción generada desde isOK\"){\n if(!$element):\n throw new \\Exception($msg);\n endif;\n }", "public function writeElementIf($condition, $element, $attribute = null, $value = null)\n {\n if ($condition == true) {\n if (is_null($attribute)) {\n $this->xmlWriter->writeElement($element, $value);\n } else {\n $this->xmlWriter->startElement($element);\n $this->xmlWriter->writeAttribute($attribute, $value);\n $this->xmlWriter->endElement();\n }\n }\n }", "function write_xml($json_data,$xml,$opt){\n\n if (is_array($json_data)) { // received data as array handle as array\n write_array($json_data,$xml,$opt); // like this [1,2,3]\n return;\n }\n foreach ($json_data as $key => $value) {// iterate through data\n\n if ($opt->substitute_element) { //substitute element -c\n $key = replace_invalid_keys($key,$opt);\n }\n if (check_element_validity($key,$opt)) {\n err(\"Invalid element\",51);\n }\n $xml->startElement($key); //<key>\n\n if (is_object($value)){\n\n write_xml($value,$xml,$opt);\n }\n else if (is_array($value)) {\n write_array($value,$xml,$opt);\n }\n else{\n write_value($value,$xml,$opt);\n }\n $xml->endElement(); //<key>\n }\n}", "public function assertWritableFile($path);", "public function write($string)\n {\n }", "abstract protected function write(array $record);", "function writeMutToDb($mysqli, $elements, $table, $genId) {\n\n\t$query = \"insert into $table values( 0, '$elements[0]','$elements[1]','$elements[2]','$elements[3]','$elements[4]','$elements[5]', '$elements[6]',$genId )\";\n\tif ($result = $mysqli -> query($query)) {\n\t\tsetStatus(\"Geänderte Zeilen: \" . $mysqli -> affected_rows . \"\\n\");\n\t} else {\n\t\tsetStatus(\"Fehler in der Abfrage.\\nQuery: \" . $query . \"\\n\" . $mysqli -> error . \"\\n\");\n\t}\n\n}", "function ElementTabToXML($nameLineElement,$lineElement,$xmlSolution,$solutionElementXML):bool{\n //TODO LABEL IN OUTPUT union label part ect\n //print_r($nameLineElement);\n if($lineElement == \"[]\"){\n return false;\n }\n if($nameLineElement == \"group\"){\n $elementSub = $xmlSolution->createElement(\"class\");\n foreach(transformDznToArray($lineElement) as $element){\n $subSubElement = $xmlSolution->createElement(\"group\");\n ElementStringToXML(\"refId\",$element,$xmlSolution,$subSubElement);\n $elementSub->appendChild($subSubElement);\n }\n $solutionElementXML->appendChild($elementSub);\n }\n elseif(in_array($nameLineElement,[\"rooms\",\"teachers\"])){\n\n $elementSub = $xmlSolution->createElement(\"choose\".ucfirst($nameLineElement));\n foreach(transformDznToArray($lineElement) as $element){\n $subSubElement = $xmlSolution->createElement(substr($nameLineElement,0,-1));\n ElementStringToXML(\"refId\",$element,$xmlSolution,$subSubElement);\n $elementSub->appendChild($subSubElement);\n }\n $solutionElementXML->appendChild($elementSub);\n\n }\n elseif($nameLineElement==\"equipements\"){\n\n }\n elseif($nameLineElement==\"slot\"){\n $elementSub = $xmlSolution->createElement(\"schedule\");\n\n $tabResult = transformDznToArray($lineElement);\n $subSubElement1 = $xmlSolution->createAttribute(\"slot\");\n $subSubElement1->value = cleanString($tabResult[0]);\n $subSubElement2 = $xmlSolution->createAttribute(\"sessionLength\");\n $subSubElement2->value = cleanString($tabResult[1]);\n\n $elementSub->appendChild($subSubElement1);\n $elementSub->appendChild($subSubElement2);\n \n $solutionElementXML->appendChild($elementSub);\n\n }\n else{exit (\"ERROR FIELD DON'T EXIST\");}\n return true;\n\n}", "protected function readElementNode()\n {\n $this->element = $this->createVirtualElement();\n\n if ($this->reader->hasAttributes) {\n foreach ($this->readElementAttributes() as $attribute => $value) {\n $this->element->put($attribute, $value);\n }\n }\n }", "public function testInfoBackupWithElement()\n {\n $this->backups->expects($this->once())\n ->method('getFinishedBackups')\n ->with('database')\n ->willReturn([$this->backup,]);\n\n $output = $this->command->info('mysite.dev', ['element' => 'db',]);\n $this->assertInstanceOf(PropertyList::class, $output);\n $this->assertEquals($this->expected_data, $output->getArrayCopy());\n }", "public function writeXmlContents($writer)\r\n {\r\n if ($this->survivorResources) {\r\n foreach ($this->survivorResources as $i => $x) {\r\n $writer->startElementNs('fs', 'survivorResource', null);\r\n $x->writeXmlContents($writer);\r\n $writer->endElement();\r\n }\r\n }\r\n if ($this->duplicateResources) {\r\n foreach ($this->duplicateResources as $i => $x) {\r\n $writer->startElementNs('fs', 'duplicateResource', null);\r\n $x->writeXmlContents($writer);\r\n $writer->endElement();\r\n }\r\n }\r\n if ($this->conflictingResources) {\r\n foreach ($this->conflictingResources as $i => $x) {\r\n $writer->startElementNs('fs', 'conflictingResource', null);\r\n $x->writeXmlContents($writer);\r\n $writer->endElement();\r\n }\r\n }\r\n if ($this->survivor) {\r\n $writer->startElementNs('fs', 'survivor', null);\r\n $this->survivor->writeXmlContents($writer);\r\n $writer->endElement();\r\n }\r\n if ($this->duplicate) {\r\n $writer->startElementNs('fs', 'duplicate', null);\r\n $this->duplicate->writeXmlContents($writer);\r\n $writer->endElement();\r\n }\r\n }", "protected function setUp()\n {\n $this->object = new Element('test_element');\n\n $this->doc = new \\DOMDocument;\n $this->doc->appendChild($this->object);\n }", "public function write(): void\n {\n $this->writeAndReturnAffectedNumber();\n }", "function test_write_once()\n {\n if (get_class($this) != 'Test_ActiveSupport_Cache_FileStore')\n {\n $this->assert_true($this->cache->write_once('uniq_token', 'foo'));\n $this->assert_false($this->cache->write_once('uniq_token', 'bar'));\n $this->assert_equal($this->cache->read('uniq_token'), 'foo');\n }\n }", "abstract public function writeAttribute($name, $value);", "public function SaveXMLFile();", "public function test2()\n {\n $document = $this->getHTMLDocument();\n $element = $document->createElement('div');\n $this->assertSame($document->URL, $element->baseURI);\n }", "public function testRead()\n {\n //For now file doesn't exist\n $this->assertFileNotExists($this->file);\n $result = $this->SerializedArray->read();\n $this->assertEmpty($result);\n $this->assertIsArray($result);\n\n //Tries some values\n foreach ([\n ['first', 'second'],\n [],\n [true],\n [false],\n [null],\n ] as $value) {\n $this->assertTrue($this->SerializedArray->write($value));\n $result = $this->SerializedArray->read();\n $this->assertEquals($value, $result);\n $this->assertIsArray($result);\n }\n\n //Creates an empty file. Now is always empty\n file_put_contents($this->file, null);\n $result = $this->SerializedArray->read();\n $this->assertEmpty($result);\n $this->assertIsArray($result);\n\n //Creates a file with a string\n file_put_contents($this->file, 'string');\n $result = $this->SerializedArray->read();\n $this->assertEmpty($result);\n $this->assertIsArray($result);\n }", "public function testSerializeEntity(): void\n {\n $entity = new Entity();\n $entity->value = 'something';\n $this->storage->write('key', serialize($entity));\n $data = $this->getTableLocator()->get('Sessions')->get('key')->data;\n $this->assertSame(serialize($entity), stream_get_contents($data));\n }", "abstract public function write(\\SetaPDF_Core_Writer_WriterInterface $writer);", "public function saveElement($elementName, $elementType)\n {\n /* @var $connection PDO */\n $connection = $this->connection;\n \n //trim whitespace\n $elementName = trim($elementName);\n $elementType = trim($elementType);\n \n //check if element already exists\n $sql = \"SELECT ID FROM Elements WHERE Name = ? AND Type = ?\";\n $query = $connection->prepare($sql);\n $query->execute(array($elementName, $elementType));\n $result = $query->fetch(PDO::FETCH_ASSOC);\n \n if(!$result) {\n //element doesnt exist, save it and return its ID\n $sql = \"INSERT INTO Elements (Name, Type) VALUES (?, ?)\";\n $query = $connection->prepare($sql);\n $query->execute(array($elementName, $elementType));\n \n $elementID = $connection->lastInsertId();\n } else {\n //browser exists, return its ID\n $elementID = $result[\"ID\"];\n }\n \n return $elementID;\n }", "public function testOutput()\n\t{\n\t\t$transform = new Transform_Replace(array('template'=>'<body>\n<div>###title###</div>\n<div>###content###</div>\n<div>###note###</div>\n</body>', 'marker' => '###%s###'));\n\t\tob_start();\n\t\ttry {\n $transform->output(array('content'=>'>This is the content', 'title'=>'This is the title', 'note'=>'This is the footer'));\n } catch (Expresion $e) {\n ob_end_clean();\n throw $e;\n }\n $contents = ob_get_contents();\n ob_end_clean();\n\n $this->assertEquals('<body>\n<div>This is the title</div>\n<div>>This is the content</div>\n<div>This is the footer</div>\n</body>', $contents);\n\t}", "public function testSetText()\n {\n $document = $this->createDomDocument();\n $element = $document->createElementNS(Atom::NS, 'content');\n $document->documentElement->appendChild($element);\n $content = new Content($this->createFakeNode(), $element);\n $content->setContent('Less: <', 'text');\n static::assertEquals(\n '<content type=\"text\">Less: &lt;</content>',\n $document->saveXML($element)\n );\n }", "function write_file($opt,$xml)\n {\n if ($opt->write_to_file) { //write to file\n if (($out_file = fopen($opt->out_filename, \"w\")) === false) {\n err(\"Could not open file $opt->out_filename\",3);\n }\n if ((fwrite($out_file,$xml->outputMemory(TRUE))) === false){\n err(\"Could not write to file\",3);\n }\n if (!fclose($out_file)) {\n err(\"Could not close the file\",3);\n }\n }\n else fwrite(STDOUT,$xml->outputMemory(TRUE)); //write to stdout\n\n }", "function saveDomDocument($doc, $filename)\n {\n }", "public function testExport() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this\n\t\t->array($arrayResult)\n\t\t->hasKey(0)\n\t\t->size->isEqualTo(1)\n\n\t\t->integer($arrayResult[0]['left'])\n\t\t->isEqualTo(0)\n\n\t\t->integer($arrayResult[0]['right'])\n\t\t->isEqualTo(1)\n\n\t\t->integer($arrayResult[0]['id'])\n\t\t->isEqualTo(0)\n\t\t;\n\n\t\t$this->array($arrayResult[0])\n\t\t\t->hasKeys(array('id', 'left', 'right', 'parent'))\n\t\t\t->size->isEqualTo(4)\n\t\t;\n\t}", "public function onWrite();", "public function testBuild()\n {\n $this->instance->setVersion('1.0');\n $this->instance->addFile('filename', 'sourceLanguage', 'targetLanguage');\n $this->instance->addTransUnit('filename', 'source', 'target', 'note');\n\n $this->assertInstanceOf('DOMDocument', $this->instance->build());\n }", "public function write($content);", "private function write($key,$value) {\r\n}", "protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n file_put_contents($this->file, json_encode([\n 'network' => $this->network,\n 'epoch' => static::$epoch,\n 'iteration' => static::$iteration,\n 'a' => $this->a,\n 'e' => $this->e\n ]));\n }", "public function testSelf()\n {\n $this->assertTrue( file_exists( $this->getTempDir() ) ); \n\n $file = $this->getTempDir() . \"/\" . $this->logFile;\n $fh = fopen ($file, \"w+\");\n $this->assertEquals( 11, fwrite( $fh, \"Hello world\" ) );\n fclose($fh);\n\n $fh = fopen ($file, \"r\");\n $this->assertEquals( \"Hello world\", fread( $fh, 1024 ) );\n fclose($fh);\n }", "public function write($contents);", "public function testSerialize()\n {\n $data = $expected = [\n 'id' => 'payment method uuid',\n 'label' => 'HamEx - 1111',\n ];\n $data['some_other_crap'] = 'a value';\n $payment_method = new PaymentMethod((object)$data);\n $this->assertEquals($expected, $payment_method->serialize());\n }", "public function testAddText()\n {\n $element = new Element();\n $element->addText('text');\n\n // expected\n $expected = [\n [\n 'type' => 'mrkdwn',\n 'text' => 'text',\n 'verbatim' => false,\n ],\n ];\n\n // assert\n $this->assertEquals($expected, $element->elements);\n }", "abstract function write ($message);", "public function write($node, $path, $prettyPrint = false) {\n\t\treturn file_put_contents($path, $this->saveXML($node, $prettyPrint)) !== false;\n\t}" ]
[ "0.6594411", "0.62281907", "0.6161681", "0.61572105", "0.610757", "0.59129375", "0.59129375", "0.578263", "0.5731701", "0.5684551", "0.5590043", "0.557673", "0.55603814", "0.5523057", "0.5517346", "0.55029833", "0.5499105", "0.54597044", "0.5455645", "0.5354365", "0.5336838", "0.5315399", "0.5312846", "0.53027904", "0.52864265", "0.52864265", "0.52647156", "0.5259041", "0.5232204", "0.5218314", "0.5213543", "0.519157", "0.5186419", "0.5158626", "0.5148756", "0.5129549", "0.5101252", "0.5089344", "0.5057082", "0.50474083", "0.50472075", "0.5029832", "0.5007057", "0.500007", "0.4992206", "0.4979735", "0.49677163", "0.49676037", "0.49676037", "0.49676037", "0.49676037", "0.49610758", "0.49587834", "0.49577084", "0.49547142", "0.49533343", "0.495314", "0.49402714", "0.4937195", "0.4925356", "0.49132073", "0.49098364", "0.48940036", "0.48934963", "0.4886587", "0.48856014", "0.4884616", "0.48819008", "0.4870342", "0.48609817", "0.4860735", "0.48602453", "0.4854082", "0.48532826", "0.48502803", "0.48497584", "0.48410925", "0.48394334", "0.483693", "0.4832721", "0.48318642", "0.48195353", "0.481879", "0.48149583", "0.4809735", "0.48006132", "0.479714", "0.47917858", "0.47824132", "0.47820285", "0.47811106", "0.4777291", "0.47696683", "0.47693098", "0.47666883", "0.47534123", "0.47531047", "0.47524148", "0.4742829", "0.47376555" ]
0.7116637
0
protected $dispatchesEvents = [ 'updated' => ApplicationRespondedToEvent::class ];
public function applicant() { return $this->belongsTo('App\Applicant'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function onUpdated()\n {\n return true;\n }", "public function broadcastOn()\n {\n return ['RecordChanges'];\n }", "public function after_update() {}", "public function broadcastAs()\n {\n return 'updated';\n }", "public function refreshUpdated() {\n $this->setUpdated(new \\DateTime(\"now\"));\n}", "public function observe() {}", "public function getSubscribedEvents()\n {\n return [\n Events::postUpdate,\n ];\n }", "public function isUpdated() {}", "public function broadcastAs()\n\t{\n\t\treturn 'list.updated';\n\t}", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function getUpdated();", "public function getUpdated();", "function getPublishChangeEvents() {\n\t\treturn array('updateSidebar');\n\t}", "public function updating()\n {\n # code...\n }", "public function notify()\n {\n $eventName = $this->getEventName();\n if (empty($this->observers[$eventName])) {\n $observerNames = Model::factory('Observer')->getByEventName($eventName);\n foreach ($observerNames as $observerName) {\n $this->observers[$eventName][] = new $observerName();\n }\n }\n if (!empty($this->observers[$eventName])) {\n foreach ($this->observers[$eventName] as $observer) {\n $observer->update($this);\n }\n }\n }", "public function crudUpdated()\n {\n }", "protected function afterUpdating()\n {\n }", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "public function updated(Dispatch $dispatch)\n {\n //\n }", "public function _get_update_callback()\n {\n }", "function before_update() {}", "public function update () {\n\n }", "public function getOnUpdate(): string;", "public function refreshUpdated()\n {\n $this->setUpdated(new \\DateTime());\n }", "public function send_events()\n {\n }", "public function broadcastOn()\n {\n\n return [\"new_survey_response\"];\n\n }", "public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "function after_update() {}", "public function events()\n {\n return array_merge(parent::events(), array(\n 'onBeginRequest'=>'beginRequest',\n ));\n }", "protected function onUpdate(): Update\r\n {\r\n }", "public function update(){\n\n }", "public function update(){\n\n }", "public function getSubscribedEvents()\n {\n return ['postLoad'];\n }", "public function update() {\r\n }", "public function getCompatibleEvents()\n {\n return [\n TaskLinkModel::EVENT_CREATE_UPDATE\n ];\n }", "public function update(RegistrationPostUpdatedEvent $event): void\n {\n }", "protected function beforeUpdating()\n {\n }", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "public function update()\n {\n\n }", "public function update()\n {\n\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n # code...\n }", "public function getSubscribedEvents()\n {\n return ['prePersist', 'preUpdate'];\n }", "public function update() {\n parent::update();\n }", "function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update($this);\n }\n }", "public static function __events () {\n \n }", "public function update()\r\n {\r\n //\r\n }", "public function notify(){\n foreach ($this->observers as $observer){\n $observer->update();\n }\n }", "public function refreshUpdated(): void\n {\n $this->setUpdatedAt(new \\DateTime());\n }", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "public function implementedEvents() {\n\t\treturn array(\n\t\t\t'Crud.beforeHandle' => array('callable' => 'beforeHandle', 'priority' => 10),\n\t\t\t'Crud.setFlash' => array('callable' => 'setFlash', 'priority' => 5),\n\n\t\t\t'Crud.beforeRender' => array('callable' => 'respond', 'priority' => 100),\n\t\t\t'Crud.beforeRedirect' => array('callable' => 'respond', 'priority' => 100)\n\t\t);\n\t}", "public function updateAction()\n {\n }", "public function implementedEvents() {\n\t\treturn array(\n\t\t\t'Rachet.WampServer.construct' => 'construct',\n\t\t\t'RachetStatistics.WebsocketServer.getUptime' => 'getUptime',\n\t\t);\n\t}", "public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }", "public function events()\r\n\t{\r\n\t\treturn array_merge(parent::events(), array(\r\n\t\t\t'onBeginRequest'=>'beginRequest',\r\n 'onEndRequest'=>'endRequest',\r\n\t\t));\r\n\t}", "public function getSubscribedEvents()\n {\n return [\n Events::postPersist,\n Events::postUpdate,\n// Events::preUpdate,\n ];\n\n }", "public function broadcastOn()\n {\n return ['ticket'];\n }", "public function update() {\n\t\treturn;\n\t}", "public function getModelEvents();", "public static function getSubscribedEvents()\n {\n // event can be dispatch with dispatcher in a controller ...\n return [\n 'user.update' => 'updateUser'\n ];\n }", "public function shouldDiscoverEvents()\n {\n return true;\n }", "public function getSubscribedEvents()\n {\n return array(\n 'prePersist',\n 'preUpdate'\n );\n }", "public function getSubscribedEvents()\n {\n return array('onFlush', 'loadClassMetadata');\n }", "public function events()\n {\n return [Controller::EVENT_AFTER_ACTION => 'afterAction'];\n }", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::REQUEST => 'onMatchRequest'\n );\n }", "protected function afterUpdate()\n {\n }", "protected function afterUpdate()\n {\n }", "public function update() {\n \n }", "public function update(): void\n {\n }", "public function update() {\r\n\r\n\t}", "public function showUpdateNotification(){\n\t\techo $this->getUpdateNotification();\n\t}", "public function liveUpdate($collection_id, $document_id)\n {\n //set_time_limit(0);\n\n //$response = new Symfony\\Component\\HttpFoundation\\StreamedResponse();\n //$response->headers->set('Cache-Control', 'no-cache');\n //$response->headers->set('Content-Type', 'text/event-stream');\n\n //$response->setCallback(\n\n\n // Example from https://pineco.de/simple-event-streaming-in-laravel/\n return response()->stream(\n function () use ($collection_id, $document_id) {\n $owner = Sentinel::getUser();\n $elapsed_time = 0;\n $started_time = new DateTime();\n $started_time = $started_time->sub(new DateInterval('PT7S')); //look for annotations performed 7 seconds ago from now\n\n\n $count = 0;\n while (true) {\n if (connection_aborted()) {\n break;\n }\n if ($elapsed_time > 100) // Cap connections at 100 sec. The browser will reopen the connection on close\n die();\n\n echo (\"event: message\\n\");\n flush();\n $is_shared = 0;\n $is_owner = DB::table('collections')\n ->where('id', (int) $collection_id)\n ->where('owner_id', $owner['id'])\n ->count();\n if ($is_owner == 0) {\n $is_shared = DB::table('shared_collections')\n ->where('collection_id', (int) $collection_id)\n ->where('to', $owner['email'])\n ->count();\n if ($is_shared == 0) {\n echo ('data: ' . json_encode('You do not have access to this document. Please select another document.') . \"\\n\\n\"); //send data to client\n flush();\n }\n }\n // The collection is owned/shared.\n $started_time_new = new DateTime();\n if ($is_owner == 1 or $is_shared == 1) {\n $new_annotations = TempAnnotation::withTrashed()\n ->where('collection_id', (int) $collection_id)\n ->where('document_id', (int) $document_id)\n ->where('updated_at', '>=', $started_time)\n ->get($this->returnProperties);\n } else {\n $new_annotations = [];\n }\n\n // echo(\"data: [{\\\"email\\\": \".json_encode($owner['email']).\", \\\"is_owner\\\": $is_owner, \\\"is_shared\\\": $is_shared, \\\"len\\\": \".sizeof($new_annotations).\", \\\"count\\\": $count}]\\n\\n\");\n //flush();\n if (sizeof($new_annotations) > 0) {\n $started_time = $started_time_new;\n $elapsed_time = 0;\n echo ('data: ' . json_encode($new_annotations) . \"\\n\"); //send data to client\n flush();\n } else {\n $elapsed_time += 4;\n echo ('data: ' . json_encode($new_annotations) . \"\\n\"); //send data to client\n flush();\n sleep(3);\n }\n\n $count += 1;\n echo (\"id: \" . uniqid() . \"\\n\\n\");\n flush();\n sleep(1);\n }\n\n // try {\n // $elapsed_time = 0;\n // $started_time = new DateTime();\n // $started_time = $started_time->sub(new DateInterval('PT7S')); //look for annotations performed 7 seconds ago from now\n //\n // while (true) {\n // echo \"event: message\\n\";\n // if (connection_aborted()) {\n // break;\n // }\n // if ($elapsed_time>100) // Cap connections at 100 sec. The browser will reopen the connection on close\n // die();\n //\n // $is_owner = DB::table('collections')\n // ->where('id', (int) $collection_id) \n // ->where('owner_id', $owner['id'])\n // ->count();\n //\n // if ($is_owner == 0) {\n // $is_shared = DB::table('shared_collections')\n // ->where('collection_id', (int) $collection_id) \n // ->where('to', $owner['email'])\n // ->count();\n //\n // if($is_shared == 0) {\n // echo('data: ' . json_encode('You do not have access to this document. Please select another document.') . \"\\n\\n\"); //send data to client\n // //ob_flush();\n // flush();\n //\n // }\n // }\n //\n // $started_time_new = new DateTime();\n // $new_annotations = TempAnnotation::withTrashed() \n // ->where('collection_id', (int) $collection_id)\n // ->where('document_id', (int) $document_id)\n // ->where('updated_at', '>=', $started_time)\n // ->get(array('_id', 'collection_id', 'document_id', 'type', 'spans', 'attributes', /*'updated_at', 'updated_by',*/'deleted_at'));\n //\n // if (sizeof($new_annotations)>0) {\n // $started_time = $started_time_new;\n // $elapsed_time = 0;\n //\n // echo 'data: ' . json_encode($new_annotations) . \"\\n\\n\"; //send data to client\n // //ob_flush();\n // flush();\n // } else\n // $elapsed_time += 4;\n // sleep(3);\n // }\n // }\n // catch (Exception $e) {\n // //display custom message\n // echo \"data: {\\\"msg\\\": \\\"\". json_encode($e->errorMessage()).\"\\\"}\\n\\n\";\n // flush();\n // }\n // flush();\n // sleep(1);\n },\n 200,\n [\n 'Cache-Control' => 'no-cache',\n 'Content-Type' => 'text/event-stream',\n ]\n );\n // );\n\n // return $response;\n }", "public function broadcastOn()\n {\n return ['pending-products'];\n }", "public static function postUpdate(Event $event){\n $io = $event->getIO();\n $io->write(\"postUpdate event triggered.\");\n }", "public function implementedEvents()\n {\n return [\n 'Controller.setup' => 'onControllerSetup'\n ];\n }", "protected function beforeUpdate()\n {\n }", "public function implementedEvents() {\n\t\treturn array(\n\t\t\t'RachetStatistics.WebsocketServer.getMemoryUsage' => 'getMemoryUsage',\n\t\t);\n\t}", "public static function bootLogsModelEvents()\n {\n if (property_exists(self::class, 'logModelEvents')) {\n foreach (self::$logModelEvents as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n $description = $eventName;\n\n if ($eventName == 'updating' || $eventName == 'updated') {\n if ($dirty = $model->getDirty()) {\n $changed = [];\n foreach ($dirty as $key => $value) {\n if (!self::shouldHideKey($key)) {\n if (self::shouldSanitizeKey($key)) {\n $changed[] = \"'$key': ***\";\n } else {\n $changed[] = \"'$key': [\" . ($model->original[$key] ?? '-') . \"]→[$value]\";\n }\n }\n }\n\n if ($changed) {\n $description .= ':' . implode(', ', $changed);\n }\n }\n }\n\n $model->logModelEvent($description);\n });\n }\n }\n }", "public function getEventSubscriber();", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function getSubscribedEvents()\n {\n return array(Events::postLoad);\n }", "public function broadcastOn()\n {\n return ['absensi-new'];\n }", "function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime('now');\n }", "public function index_onUpdate()\n\t{\n\t\t$record_id = post('record_id');\n\t\tparent::update_onSave($record_id));\n\t\treturn $this->controller->listRefresh();\n\t}", "protected function _update()\n {\n \n }" ]
[ "0.66790175", "0.6555206", "0.64177376", "0.6362392", "0.628031", "0.6273065", "0.6213586", "0.6185381", "0.61152154", "0.6112394", "0.6046758", "0.6046758", "0.60170424", "0.5960229", "0.59432757", "0.5931007", "0.5915904", "0.589375", "0.589375", "0.589375", "0.58858675", "0.5875663", "0.5867302", "0.5855956", "0.5845948", "0.5822277", "0.58089", "0.5791592", "0.57615846", "0.5744833", "0.5734889", "0.57303166", "0.57282066", "0.57282066", "0.5722357", "0.5721999", "0.5721366", "0.57152027", "0.5711185", "0.56931645", "0.56931645", "0.5692188", "0.5692188", "0.5686595", "0.5686595", "0.5686595", "0.5686595", "0.5686595", "0.5686595", "0.5686595", "0.5686595", "0.5686595", "0.5686595", "0.5686595", "0.5686595", "0.56842244", "0.5680569", "0.566936", "0.564936", "0.5646722", "0.5643434", "0.5639106", "0.56385666", "0.56383324", "0.56383324", "0.5635895", "0.56290835", "0.56199384", "0.5619297", "0.5605964", "0.5590034", "0.55884635", "0.5586891", "0.55791074", "0.55746263", "0.55722076", "0.55591124", "0.5557893", "0.55569357", "0.554233", "0.5535927", "0.5535927", "0.5529901", "0.55225444", "0.5518292", "0.55179095", "0.55165046", "0.5510203", "0.55092895", "0.5508595", "0.5506493", "0.5495993", "0.5485649", "0.54851437", "0.5484132", "0.5483702", "0.54824924", "0.548093", "0.54790044", "0.54758507", "0.5473501" ]
0.0
-1
menangkap url yang diinput di url
public function parseURL() { if (isset($_GET['url'])) { $url = rtrim($_GET['url'], '/'); //menghapus tanda / di akhir url $url = filter_var($url, FILTER_SANITIZE_URL);//memfilter url dari karakter aneh (hack) $url = explode('/', $url); //memecah url yang diinput dengan delimiter / dan menjadikannya array return $url; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function url();", "public function url();", "public function url();", "private function _getUrl()\n {\n // Explode url to the array Variabels (url)\n $url = isset($_GET['url']) ? $_GET['url'] : null;;\n $url = rtrim($url, '/');\n $url = filter_var($url,FILTER_SANITIZE_URL);\n $this->_url = explode('/', $url);\n }", "public function get_url();", "private function _getUrl()\r\n {\r\n $url = filter_input(INPUT_GET, 'url');\r\n $url = rtrim($url, '/');\r\n $url = filter_var($url,FILTER_SANITIZE_URL);\r\n $this->_url = explode('/', $url);\r\n }", "private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}", "private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}", "abstract public function getUrl();", "function url($url){\n $url=ereg_replace(\"[&?]+$\", \"\", $url);\n \n $url .= ( strpos($url, \"?\") != false ? \"&\" : \"?\" ).urlencode($this->name).\"=\".$this->id;\n \n return $url;\n }", "public function getURL ();", "private function setUrl(): void\n {\n $completeUrl = $_SERVER['REQUEST_URI'];\n $explodedUrl = \\explode('?', $completeUrl);\n $this->url = trim($explodedUrl[0], '/'); // Cleaned URL\n }", "public function getURL();", "public function getURL();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "protected function setUrl() {\r\n\t\t$this->url = htmlspecialchars(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), ENT_QUOTES);\r\n\t}", "abstract public function get_url_update();", "function getUrl();", "public function get_url()\n {\n }", "private function _url($par = array()) {\n\t\t$get = $_GET;\n\t\t\n\t\tforeach ((array) $par AS $key => $val) { //overide value\n\t\t\tif ($key == 'path') //if path, encode\n\t\t\t\t$get['path'] = \\Crypt::encrypt($val);\n\t\t\telse\n\t\t\t\t$get[$key] = $val;\n\t\t}\n\t\t\n\t\t$url = '//';\n\t\t\n\t\t$url .= $this->_sanitize(g($_SERVER, 'HTTP_HOST').'/'.strtok(g($_SERVER, 'REQUEST_URI'), '?'));\n\t\t\n\t\treturn $url.'?'.http_build_query($get);\n\t}", "private function getUrl()\n {\n //echo $_GET['url'];\n if(isset($_GET['url']))\n {\n $url=rtrim($_GET['url'],'/');\n $url=filter_var($url,FILTER_SANITIZE_URL);\n $url=explode('/',$url);\n return $url;\n }\n }", "function get_url()\n {\n }", "protected function set_url_this_add($val){ $this->input ['add_url'] = $val ; }", "private static function generateUrlPrams(){\n\t\t$url = [] ;\n\t\tif ( isset($_GET['urlFromHtaccess']) ){\n\t\t\t$url = explode('/' , trim($_GET['urlFromHtaccess']) );\n\t\t}\n\t\tself::$url = $url ;\n\t}", "public abstract function getURL();", "function setUrl($url);", "protected function getUrl(){\n\n\t\t//retornando a url aonde o usuario está\n\t\treturn parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n\t}", "protected function set_url_this_view($val){ $this->input ['table_url'] = $val ; }", "public function url(): string;", "public function setRequestUrl($url) {}", "abstract public function url($manipulation_name = '');", "public function getUrl(){\n if(isset($_REQUEST['url'])){\n $url = $_REQUEST['url'];\n $url = rtrim($url,'/');\n $url = filter_var($url,FILTER_SANITIZE_URL);\n $url = explode('/',$url);\n return $url;\n }\n }", "public function setUrl( $url );", "function url( $url ) {\n\t\treturn $this->path( $url, true );\n\t}", "public function getUrl(){\r\n if(isset($_GET['url'])){\r\n $url = rtrim($_GET['url'], '/');\r\n $url = filter_var($url, FILTER_SANITIZE_URL);\r\n $url = explode('/', $url);\r\n return $url;\r\n }\r\n }", "function get_url($index = '')\n{\n /**\n * $_GET['url'] merupakan URL atau pretty url yang di set\n * atau dirapikan pada file .htaccess, jadi penulisannya yang di set\n * menggunakan htaccess adalah index.php?url=xyz sebagai default\n * maka dari itu bisa memanggil $_get['url']\n */\n if (isset($_GET['url'])) {\n /**\n * Merapikan url menggukan method rtrim untuk menhapus / dibagian akhir url\n * \tmengamankan url dari variabel aneh dengan method Filter_var \n * memecar URL menjadi array dengan method explode setiap bertemu string atau karakter /\n */ \n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n if ($index !== '') {\n return $url[$index];\n } else {\n return $url;\n }\n }else{\n \n $url = trim($_SERVER[\"REQUEST_URI\"], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n if ($index !== '') {\n return $url[$index];\n unset($url[0]);\n } else {\n return $url;\n }\n }\n}", "private function splitUrl() {\n\n if (isset($_GET['url'])) {\n\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n $this->url_params = array_values($url);\n\n // para debugging, descomente estas lineas si tiene problemas con la URL\n //echo 'Controller: ' . $this->url_controller . '<br>';\n //echo 'Action: ' . $this->url_action . '<br>';\n //echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n }\n }", "protected function get_url_this_add(){ return $this->input ['add_url'] ;}", "public static function setUrl(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$url = substr(static::$fullUrl, 0, strpos(static::$fullUrl, '?'));\n\t\t} else {\n\t\t\tstatic::$url = static::$fullUrl;\n\t\t}\n\n\t}", "abstract public function get_url_read();", "public function content_from_url() {\n \n // Verify if session exists and if the user is admin\n $this->if_session_exists($this->user_role,0);\n \n if ( $this->input->post() ) {\n \n // Add form validation\n $this->form_validation->set_rules('url', 'Url', 'trim|required');\n \n // Get the url\n $url = $this->input->post('url');\n \n if ( $this->form_validation->run() != false ) {\n\n echo json_encode( get_site($url) );\n \n }\n \n }\n \n }", "private static function loadUrl(){\n\n $uri = $_SERVER['REQUEST_URI'];\n\n if (ENCRYPTURL == '1')\n $uri = CR::decrypt($uri);\n\n BASEDIR == '/' || $uri = str_replace(BASEDIR,'', $uri);\n $uri = explode('/', $uri);\n\n array_walk($uri, function(&$item){\n strpos($item, '?') == false ||\n $item = substr($item, 0, strpos($item, '?'));\n });\n\n return $uri;\n }", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "public function setUrl($url) {}", "protected function set_url_this_edit($val){ $this->input ['edit_url'] = $val ; }", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "public function getUrl($name);", "public function request_url(&$url)\n\t{\t\tif($url == 'feed') $this->is_feed = true;\n\t}", "public function addUrl() {\r\n\t\t$current = $this->params['url']['url'];\r\n\t\t$accept = array('show', 'admin_show', 'admin_index');\r\n\t\tif(in_array($this->action, $accept)) {\r\n\t\t\tif ($this->Session->read('history.current') != $current){\r\n\t\t\t\t//$this->Session->write('history.previous', $this->Session->read('history.current'))->write('history.current', $current);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function test(){\n\t $url = urls('content/show','id=96');\n\t echo \"<a href='$url'>$url</a>\";\n\t}", "protected function set_url_this_dele($val){ $this->input ['delete_url'] = $val ; }", "function validarEstudiante($url=null){\n echo $url[0];\n }", "public function __construct()\n {\n if(!empty(filter_input(INPUT_GET, 'url', FILTER_DEFAULT))){\n $this->Url = filter_input(INPUT_GET, 'url', FILTER_DEFAULT);\n $this->limparUrl();\n $this->UrlConjunto = explode(\"/\", $this->Url);\n \n if(isset($this->UrlConjunto[0]))\n {\n $this->UrlController = $this->slugController($this->UrlConjunto[0]);\n }else{\n $this->UrlController = CONTROLER;\n }\n\n //condição dos segundo paramentro \n if(isset($this->UrlConjuto[1]))\n {\n $this->UrlParamentro = $this->UrlConjunto[1];\n }else{\n $this->UrlParamentro = null;\n }\n\n echo \"{$this->Url} <br>\";\n echo \"Controller: {$this->UrlController} <br>\";\n // caso nao tenha paramentro entra else aonde vai ter valores fixos\n }else{\n $this->UrlController = CONTROLER;\n $this->UrlParamentro= null;\n }\n \n\n }", "public function getUrl()\r\n {\r\n if (isset($_GET['url'])) {\r\n\r\n // remove the ending slash\r\n $url = rtrim($_GET['url'], '/');\r\n\r\n // removing any none url characters\r\n $url = filter_var($url, FILTER_SANITIZE_URL);\r\n\r\n // get url characters as an array using explode function\r\n $url = explode('/',$url);\r\n\r\n return $url;\r\n }\r\n }", "function setURL($url){\n $this->urltoopen = $url;\n }", "public function editUrl() {}", "public function setURL($url);", "public function setURL($url);", "public function splitUrl() {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_STRING);\n $url = explode('/', $url);\n\n // parse custom urls\n $url = $this->parseRoutes($url);\n\n if ($this->app->language->enabled) {\n // set lang key\n $this->lang_key = isset($url[0]) ? $url[0] : null;\n // set controller\n $this->url_controller = isset($url[1]) ? $url[1] : null;\n // and action\n $this->url_action = isset($url[2]) ? $url[2] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1], $url[2]);\n } else {\n // set controller\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n // and action\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1]);\n }\n\n // store action params\n $this->action_params = array_values($url);\n\n }\n }", "protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}", "public function ov_url($name, $value = ''){\n $args = func_get_args(); array_shift($args); array_shift($args);\n return $this->generate_input('url', $name, $value, true, $args);\n }", "public function url($url = '')\n\t{\n\t\treturn $this['url'].ltrim($url, '/');\n\t}", "public function getRequestUrl() {\n\t}", "protected static function _url(){\n if (self::$_ruleValue) {\n $str = filter_var(trim(self::$_elementValue), FILTER_VALIDATE_URL);\n if (!$str) {\n self:: setErrorMessage(\"Enter valid URL\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "private function getUrl() {\r\n if(!$this->markActive)\r\n return '';\r\n $mid = Yii::$app->controller->module->id == Yii::$app->id ? '' : Yii::$app->controller->module->id;\r\n $cid = Yii::$app->controller->id;\r\n $aid = Yii::$app->controller->action->id;\r\n $id = isset($_GET['slug']) ? $_GET['slug'] : (isset($_GET['id']) ? $_GET['id'] : '');\r\n $rubric = isset($_GET['rubric']) ? $_GET['rubric'] : '';\r\n $tag = isset($_GET['tag']) ? $_GET['tag'] : '';\r\n return ($mid ? $mid. '/' : '') . \r\n $cid . '/' . \r\n ($aid == 'index' \r\n ? ($rubric \r\n ? 'rubric/' . $rubric . ($tag \r\n ? '/tag/' . $tag \r\n : '') \r\n : 'index') \r\n : ($aid == 'view' ? $id : $aid)\r\n );\r\n }", "private function spiltUrl()\n {\n // the .htaccess file.\n // TODO: create .htaccess file and add rule.\n if (isset($_GET['url'])) {\n // echo $_GET['url'];\n \n // Trim the last '/' from the url\n // so the http://example.com/sample/ will be http://example.com/sample\n $url = rtrim($_GET['url'], '/');\n \n $url = filter_var($url, FILTER_SANITIZE_URL);\n \n $url = explode('/', $url);\n \n // Put URL parts into the appropiate properties.\n $this->url_controller = (isset($url[0])) ? $url[0] : null;\n $this->url_action = (isset($url[1])) ? $url[1] : null;\n $this->url_parameter_1 = (isset($url[2])) ? $url[2] : null;\n $this->url_parameter_2 = (isset($url[3])) ? $url[3] : null;\n $this->url_parameter_3 = (isset($url[4])) ? $url[4] : null;\n }\n }", "function decoupe_url($t) {\n//\treturn($t);\n\t$z = strrpos($t, '/');\n\tif ($z != '') {\n\t\t$t = substr($t, $z+1, strlen($t));\n\t\t// RECHERCHE DU DERNIER ?\n\t\t$z = strrpos($t, '?');\n\t\tif ($z != '') {\n\t\t\treturn(substr($t, 0,$z));\n\t\t} else {\n\t\t\treturn($t);\n\t\t}\n\t} else {\n\t\treturn($t);\n\t}\n}", "function url($id)\r\n\t{\r\n\t\treturn '';\r\n\t}", "public function getUrl() {\r\n\t}", "static public function createurl($url='') {\n\t\treturn Application::$base_url.'/'.trim($url,'/');\n\t}", "public function getUrl()\n {\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/');\n\n $url = filter_var($url, FILTER_SANITIZE_URL);\n\n $url = explode('/', $url);\n return $url;\n \n }\n }", "function maps_actual_url($url, $uriapp = NULL){\n //Elimino el primer caracter si es igual a \"/\"\n if(substr($url, 0, 1) == \"/\"){\n $url= substr($url, 1);\n } \n //Separa la url pasada y la uri en partes para poder analizarlas\n $partes_url= explode(\"/\", $url);\n \n //Saco de la uri actual los parametros\n $uri_explode= explode(\"?\", URIAPP);\n if($uriapp != NULL){\n $uri_explode= explode(\"?\", $uriapp);\n }\n $uri_front= $uri_explode[0];\n //Separo la uri actual\n $partes_uri_actual= explode(\"/\", $uri_front); \n $mapea= TRUE; \n //Analiza que url-uri tiene mas elementos\n if(count($partes_url) >= count($partes_uri_actual)){\n //Si el tamano de la url es igual o mayor que la uri actual uso el for recorriendo las partes de la url\n $count_partes_uri= count($partes_url);\n for($i= 0; $i < $count_partes_uri; $i++) {\n if(count($partes_uri_actual) >= ($i + 1)){\n //Si hay un * no me importa que viene despues, mapea todo, no deberia haber nada despues\n if($partes_url[$i] != \"*\"){\n $pos_ocurrencia= strpos($partes_url[$i], \"*\");\n if($pos_ocurrencia != FALSE){\n $parte_url= explode(\"*\", $partes_url[$i]);\n $parte_url= $parte_url[0];\n if(strlen($partes_uri_actual[$i]) >= strlen($parte_url)){\n $parte_uri_actual= substr($partes_uri_actual[$i], 0, strlen($parte_url));\n if($parte_url == $parte_uri_actual){\n break;\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n //Si alguna esta vacia no compara el mapeo con () y voy directo a la comparacion\n if(empty($partes_url[$i]) || empty($partes_uri_actual[$i])){\n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n else{\n //Si la parte de la uri empieza con ( y termina con ) puede ir cualquier string ahi por lo que pasa directamente esta parte de la validacion\n if(! ($partes_url[$i]{0} == \"(\" and $partes_url[$i]{strlen($partes_url[$i]) -1} == \")\")){\n //Si no contiene ( y ) debe mapear\n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n }\n }\n else{\n break;\n }\n }\n else{\n //La uri actual no tiene mas partes y no hay coincidencia completa\n $mapea= FALSE;\n break;\n }\n } \n }\n else{\n //Si el tamano de la url pasada es menor que la uri uso el for recorriendo las partes de la uri\n $count_partes_uri_actual= count($partes_uri_actual);\n for($i= 0; $i < $count_partes_uri_actual; $i++){\n if(count($partes_url) >= ($i + 1)){ \n //Si hay un * no me importa que viene despues, mapea todo, no deberia haber nada despues\n if($partes_url[$i] != \"*\"){\n $pos_ocurrencia= strpos($partes_url[$i], \"*\");\n if($pos_ocurrencia != FALSE){\n $parte_url= explode(\"*\", $partes_url[$i]);\n $parte_url= $parte_url[0];\n if(strlen($partes_uri_actual[$i]) >= strlen($parte_url)){\n $parte_uri_actual= substr($partes_uri_actual[$i], 0, strlen($parte_url));\n if($parte_url == $parte_uri_actual){\n break;\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n //Si alguna esta vacia no compara el mapeo con () y voy directo a la comparacion\n if(empty($partes_url[$i]) || empty($partes_uri_actual[$i])){\n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n else{\n //Si la parte de la uri empieza con ( y termina con ) puede ir cualquier string ahi por lo que pasa directamente esta parte de la validacion\n if(! ($partes_url[$i]{0} == \"(\" and $partes_url[$i]{strlen($partes_url[$i]) -1} == \")\")){\n //Si no contiene ( y ) debe mapear \n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n }\n }\n else{\n break;\n }\n }\n else{\n //La url pasada no tiene mas partes y no hay coincidencia completa\n $mapea= FALSE;\n break;\n }\n }\n } \n return $mapea;\n }", "function vUrl( $url )\r\n\t\t{\r\n\t\t return filter_var( $url, FILTER_VALIDATE_URL );\r\n\t\t \r\n\t\t}", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n \n // Put URL parts into according properties\n // By the way, the syntax here is just a short form of if/else, called \"Ternary Operators\"\n // @see http://davidwalsh.name/php-shorthand-if-else-ternary-operators\n $this->url_controller = (isset($url[0]) ? $url[0] : null);\n $this->url_action = (isset($url[1]) ? $url[1] : null);\n $this->url_parameter_1 = (isset($url[2]) ? $url[2] : null);\n $this->url_parameter_2 = (isset($url[3]) ? $url[3] : null);\n $this->url_parameter_3 = (isset($url[4]) ? $url[4] : null);\n\n // for debugging. uncomment this if you have problems with the URL\n # echo 'Controller: ' . $this->url_controller . '<br />';\n # echo 'Action: ' . $this->url_action . '<br />';\n # echo 'Parameter 1: ' . $this->url_parameter_1 . '<br />';\n # echo 'Parameter 2: ' . $this->url_parameter_2 . '<br />';\n # echo 'Parameter 3: ' . $this->url_parameter_3 . '<br />';\n }\n }", "function url( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_URL,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}", "function jc_url() {\n\n}", "function sUrl( $url )\r\n\t\t{\r\n\t\t return filter_var( $url, FILTER_SANITIZE_URL );\r\n\t\t \r\n\t\t}", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n\n $this->url_params = array_values($url);\n // ::DEBUGGING\n // echo 'Controller: ' . $this->url_controller . '<br>';\n // echo 'Action: ' . $this->url_action . '<br>';\n // echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n // echo 'Parameters POST: ' . print_r($_POST, true) . '<br>';\n }\n }", "function url($url, $locale_id)\r\n\t{\r\n\t\tif ($locale_id != '')\r\n\t\t{\r\n\t\t\t$url = preg_replace(\"/[&?]\" . $this->url_prefix . \"=([0-9a-z]+)/\", '', $url);\r\n\t\t\t$url = preg_replace(\"/[&?]+$/\", '', $url);\r\n\t\t\t$url .= ((strpos($url, \"?\") != false) ? \"&\" : \"?\") . $this->url_prefix . '=' . $locale_id;\r\n\t\t}\r\n\t\treturn $url;\r\n\t}", "public function onBeforeGet($url){}", "public function setURL($url)\n\t\t{\n\t\t\t$this->url = preg_replace(\"#/$#\", \"\", $url);\n\t\t}", "public function myurl()\n\t{\n\n//\t\t\t\t$urls = DB::table('links')->paginate(1);\n\t\t \t\t$urls = DB::table('links')->where('user_id', Auth::id())->paginate(2);\n\t\t \n\t\t \t\t\n//\t\t\t\t$ips = DB::table('links')->select('url');\n//\t\t\t\t\t\t$ip = file_get_contents ('http://php.net/manual/en/function.gethostbyname.php');\n//\t\t$url = 'http://us1.php.net/parse_url';\n//\t\t$url = DB::table('links')->get(['url']);\n//\t\t$parse = parse_url($url);\n//\t\t$host = $parse['host']; // prints 'google.com'\n//\t\t$ip = gethostbyname($host);\n//\t\t$ip = DB::table('links')->select('url');\n//\t\treturn view('form',compact('urls','url'));\n\t\treturn view('home',compact('urls'));\n\t\t\n\t\t\n\t\t\n\t}", "public function generate_url()\n {\n }", "function url ($link) {\r\n\treturn $link;\r\n}", "public function request($url);", "private function getUrl() {\n $queryArr = array();\n\n $uri = filter_input(INPUT_SERVER, 'REQUEST_URI');\n\n //get uri as a array\n $uriArr = parse_url($uri);\n\n //get query parameter string\n $queryStr = isset($uriArr['query']) ? $uriArr['query'] : '';\n\n //get query parameters as a array\n parse_str($queryStr, $queryArr);\n\n //remove 'page' parameter if it is set\n if (isset($queryArr['page'])) {\n unset($queryArr['page']);\n }\n\n //rebuild the uri and return \n $returnUri = $uriArr['path'] . '?' . http_build_query($queryArr);\n\n return $returnUri;\n }", "public function get2($link){\n $url = explode('/', $_GET['url']);\n $this->url_enlace = $url[2];\n }", "public function get($url);", "function url_para($pagina){\n return vazio($pagina) ? URL : URL.\"index.php/\".$pagina;\n }", "public function url($url)\n {\n return App::getBaseURL() . \"$url\";\n }" ]
[ "0.74021924", "0.74021924", "0.74021924", "0.7172676", "0.70907986", "0.7075898", "0.7056946", "0.7056946", "0.69490606", "0.6921065", "0.69077134", "0.6896712", "0.6862313", "0.6862313", "0.6811164", "0.6811164", "0.6811164", "0.6811164", "0.6811164", "0.6811164", "0.6811164", "0.6811164", "0.6807299", "0.67957664", "0.67833424", "0.6759238", "0.6741994", "0.6737145", "0.67120504", "0.6686369", "0.66808444", "0.66803825", "0.6643671", "0.6541745", "0.65387434", "0.6511188", "0.65089554", "0.6506141", "0.6494876", "0.6492327", "0.6478174", "0.6470143", "0.646933", "0.6466346", "0.64601785", "0.6443268", "0.6428258", "0.6408531", "0.6402264", "0.64005566", "0.63949203", "0.6384989", "0.6360601", "0.6360601", "0.6360601", "0.6360601", "0.6360219", "0.6351112", "0.63315034", "0.632923", "0.632386", "0.63159", "0.6310685", "0.6310122", "0.6308977", "0.6303614", "0.62955964", "0.62955964", "0.62644106", "0.6263442", "0.6263318", "0.62547606", "0.6254305", "0.62425965", "0.62380624", "0.6235839", "0.62354827", "0.622049", "0.620348", "0.61911887", "0.61836797", "0.61829275", "0.61826074", "0.6182316", "0.6181709", "0.6180512", "0.6179531", "0.6174657", "0.6173145", "0.61724055", "0.61663866", "0.616309", "0.6162283", "0.61565375", "0.6152444", "0.6152066", "0.6150319", "0.6145794", "0.6145488", "0.6144708" ]
0.6689136
29
Imported entity type code getter
public function getEntityTypeCode() { return 'sales_rule'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getEntityTypeCode();", "public function entityFor(): string;", "abstract protected function getEntityType(): string;", "public function getType(): EntityType;", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode(): string;", "public function getCode(): string;", "public function getCode(): string;", "public function getCode():string;", "public function getCode() {}", "public function get_engine_code(/* ... */)\n {\n return $this->_type;\n }", "final function getCode();", "public function get_type(): string;", "abstract public function getEntityTypeID();", "public function getCode()\n {\n }", "public function getEntityClassName(): string;", "public function getEntityTypeId(){\n $entityType = Mage::getModel('eav/entity_type')->loadByCode($this->_entityType);\n if (!$entityType->getId()){\n Mage::helper('connector')\n ->log(\"Entity type \" . $this->_entityType . \" undefined\", Zend_log::ERR);\n return false;\n }\n return $entityType->getId();\n }", "public function getEntity() {\n\t\treturn 'Custom Cloud Co.';\n\t}", "public function getCodeName(): string;", "public function getId(): string\n {\n return $this->entityType;\n }", "public function getCode()\n {\n return OrderModel::ENTITY;\n }", "public function getCode() : int;", "public function getFormattedEntityType();", "public function getEntityType();", "public function getEdiType(): string\n {\n return $this->identifierCode;\n }", "public function getCode(): int;", "public function getExtendedType()\n {\n return EntityType::class;\n }", "public function getCodeType()\n {\n return $this->codeType;\n }", "public function getEntityClassName() {}", "public function getEntityType(): ?string;", "public function getDataType(): string;", "public function getDataType(): string;", "function getEntityType() {\n return $this->entity_type;\n }", "private function getEntity()\n {\n // obtm o nome da classe\n $classe = constant(get_class($this) . '::TABLENAME');\n return $classe;\n // retorna o nome da classe - \"Record\"\n// return substr($classe , 0 , -6);\n }", "public function entityTypeId();", "public function type(): string;", "public function getEntity(): string\n {\n return ContactEntity::class;\n }", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getType(): string;", "public function getCode()\n {\n return static::CODE;\n }", "public function getEntityType(): string\n {\n return $this->entityType;\n }", "protected abstract function getEntity(): string;", "function getType(): string;", "function getType(): string;", "public function getEntityTypeId();", "public function getCode()\n {\n return $this->getValueObject('code');\n }", "public function generateEntityCode()\n {\n $tables = $this->getTables();\n \n $code = \" require_once 'grandprix.data.php';\";\n foreach ($tables as $table)\n {\n $columns = $this->getColumns($table['tableName']);\n $children = $this->getChildren($table['tableName']);\n \n $code .=\n\"\n /**\n * \" . ucfirst($table['tableName']) . \" Data Entity class.\n * \n * @package Grandprix\n * @subpackage Data\n */\n class \" . ucfirst($table['tableName']) . \" extends DataEntity\n { \n\";\n \n foreach ($columns as $column)\n {\n $code .=\n\"\n /**\n * @var \" . self::getPhpType($column['dataType']) . \"\n */\n public \\$\" . ucfirst($column['columnName']) . \";\n\";\n }\n\n $code .=\n\"\n /**\n * Creates an empty instance of this class.\n * \n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function createInstance()\n {\n \\$className = __CLASS__; return new \\$className();\n }\n \n /**\n * Creates an instance of this class based on the provided data array.\n *\n * @param array \\$data The keyed array containing the data\n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function fromData(&\\$data)\n {\n \\$entity = self::createInstance();\n \\$entity->setObjectData(\\$data);\n return \\$entity;\n }\n }\n\";\n \n }\n \n return $code;\n }", "public function getCode()\n {\n return $this->getData()->code;\n }", "public function getEntityTypeId() {\n return $this->entityType->id();\n }", "public function getEntityClass()\n {\n return 'GravityCMS\\CoreBundle\\Entity\\FieldNumber';\n }", "function entity_type_translate($entity_type)\n{\n $data = entity_type_translate_array($entity_type);\n if (!is_array($data)) { return NULL; }\n\n return array($data['table'], $data['id_field'], $data['name_field'], $data['ignore_field'], $data['entity_humanize']);\n}", "public function getEntityClassName();", "private function get_type() {\n\n\t}", "protected abstract function initializeEntityType(): string;", "public function getEntityTypeId() {\n return $this->entityTypeId;\n }", "public function getCode(): string\n {\n return $this->code;\n }", "public function getCode(): string\n {\n return $this->code;\n }", "public function getCode(): string\n {\n return $this->code;\n }", "public function getTypeCode(): int\n {\n return $this->typeCode;\n }", "public function getFirstCode() {}", "public function getCode()\n {\n return $this->get(self::ENTRY_CODE);\n }", "public function getCustomTypeId();", "public function getCode()\n {\n return $this->__get(\"code\");\n }", "protected function _getEntity ($code)\n\t{\n\t\tstatic $entities = array();\n\t\tif (!isset($entities[$code])) {\n\t\t\t$ent = html_entity_decode(\"&#$code;\", ENT_QUOTES, 'UTF-8');\n\t\t\t$entities[$code] = $this->decode($ent, null, 'UTF-8');\n\t\t}\n\t\treturn $entities[$code];\n\t}", "public function getTypeName(): string;", "public function getEntityType() {\n return $this->datasource()->getEntityType();\n }", "public function getTypeCode () {\n if (2 == $this->status) {\n return \"meanless\";\n }\n\n return $this->objtype;\n }", "public function getType() : string;", "public function type() : string;", "public function getEntityClass(): ?string;", "public function getCode() {\n return @$this->attributes['code'];\n }", "public function getCode()\n {\n return $this->get(self::CODE);\n }", "public function get_type();", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "function getCode()\n {\n return $this->code;\n }", "public function getCode() {\n return $this->code;\n }", "public function getCode() {\n return $this->code;\n }", "function entity_name($type, $entity)\n{\n global $config, $entity_cache;\n\n if (is_numeric($entity))\n {\n $entity = get_entity_by_id_cache($type, $entity);\n }\n\n $translate = entity_type_translate_array($type);\n\n $text = $entity[$translate['name_field']];\n\n return($text);\n}", "final public function getType(): int {}", "public function getEntityClass();", "public function getCode() {\n return $this->get(self::CODE);\n }", "public function getContentTypeName();", "public function getContentTypeName();", "public function getContentTypeName();", "function getCode()\r\n {\r\n return $this->code;\r\n }", "public function getDataType() {}" ]
[ "0.77840203", "0.687915", "0.6849696", "0.67124015", "0.66970587", "0.66970587", "0.66970587", "0.66970587", "0.66970587", "0.66970587", "0.66940534", "0.66940534", "0.66940534", "0.6631565", "0.6627615", "0.65743446", "0.6523308", "0.6499831", "0.6462269", "0.64000916", "0.63983625", "0.6384093", "0.6358729", "0.63552487", "0.6352772", "0.63434166", "0.6310085", "0.6307847", "0.6300092", "0.6283848", "0.6263905", "0.62602955", "0.62485045", "0.6218561", "0.62113047", "0.6209411", "0.6209411", "0.61707693", "0.61491036", "0.61445326", "0.61332667", "0.61283654", "0.61216956", "0.61216956", "0.61216956", "0.61216956", "0.61216956", "0.61216956", "0.61216956", "0.61216956", "0.61216956", "0.61216956", "0.61216956", "0.61216956", "0.6098431", "0.6085956", "0.6062048", "0.60519594", "0.60519594", "0.6042368", "0.60249156", "0.60247177", "0.6011345", "0.6010761", "0.6007909", "0.59908324", "0.5979928", "0.5961202", "0.5954379", "0.5952877", "0.59467405", "0.59467405", "0.59467405", "0.5939765", "0.59369457", "0.5932916", "0.59285176", "0.5925628", "0.5911412", "0.5911128", "0.5907301", "0.5898146", "0.5897409", "0.5886952", "0.5883247", "0.5882615", "0.58733374", "0.58726907", "0.58691967", "0.5852594", "0.58472085", "0.58472085", "0.5842948", "0.58359617", "0.5832195", "0.5830429", "0.58232754", "0.58232754", "0.58232754", "0.5822776", "0.5820869" ]
0.0
-1
Retrieve All Fields Source
public function getAllFields() { return $this->fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchFields();", "public function getAllFields();", "public function fetch_fields() {}", "function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "private function getExternalSourceFields()\r\n\t{\r\n\t\t// Get global var\r\n\t\tglobal $realtime_webservice_url_metadata, $lang;\r\n\t\t// Call the URL as POST request\r\n\t\t$params = array('user'=>USERID, 'project_id'=>$this->project_id, 'redcap_url'=>APP_PATH_WEBROOT_FULL);\r\n\t\t$metadata_json = http_post($realtime_webservice_url_metadata, $params, 30);\r\n\t\t// Decode json into array\r\n\t\t$metadata_array = json_decode($metadata_json, true);\r\n\t\t// Display an error if the web service can't be reached or if the response is not JSON encoded\r\n\t\tif (!$metadata_json || !is_array($metadata_array)) {\r\n\t\t\t$msg = $lang['ws_159'].\"<br>\";\r\n\t\t\tif ($metadata_json !== false && !is_array($metadata_array)) {\r\n\t\t\t\t$msg .= \"<br>\".$lang['ws_160'];\r\n\t\t\t} elseif ($metadata_json === false) {\r\n\t\t\t\t$msg .= \"<br>\".$lang['ws_161'];\r\n\t\t\t}\r\n\t\t\t$msg = RCView::div(array('class'=>'red', 'style'=>'margin-top:20px;'), $msg);\r\n\t\t\tif (SUPER_USER) {\r\n\t\t\t\t$msg .= RCView::div(array('style'=>'margin-top:50px;font-size:14px;font-weight:bold;'),\r\n\t\t\t\t\t\t\t$lang['global_01'] . $lang['colon']\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('style'=>'max-width:800px;border:1px solid #ccc;padding:5px;'), $metadata_json);\r\n\t\t\t}\r\n\t\t\texit($msg);\r\n\t\t}\r\n\t\t// Loop through array of source fields to ensure that one is the identifier\r\n\t\t$num_id_fields = 0;\r\n\t\tforeach ($metadata_array as $key=>&$attr) {\r\n\t\t\tif (isset($attr['identifier']) && $attr['identifier'] == '1') {\r\n\t\t\t\t$num_id_fields++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($num_id_fields != 1) {\r\n\t\t\t$msg = $lang['ws_159'].\"<br>\";\r\n\t\t\tif ($num_id_fields == 0) {\r\n\t\t\t\t// No id field\r\n\t\t\t\t$msg .= \"<br>\".$lang['ws_162'];\r\n\t\t\t} elseif ($num_id_fields > 1) {\r\n\t\t\t\t// More than one id field\r\n\t\t\t\t$msg .= \"<br>\".$lang['ws_163'];\r\n\t\t\t}\r\n\t\t\t$msg .= \" \".$lang['ws_164'].\" (e.g., [{\\\"field\\\":\\\"mrn\\\",\\\"identifier\\\":\\\"1\\\",...}])\".$lang['period'].\" \".$lang['ws_165'];\r\n\t\t\texit( RCView::div(array('class'=>'red'), $msg));\r\n\t\t}\r\n\t\t\r\n\t\t// Keep an array with the cat-subcat-fieldname concatenated together for sorting purposes later\r\n\t\t$field_sorter = array();\r\n\t\t\r\n\t\t// Make sure we have all the correct elements for each field\r\n\t\t$metadata_array2 = array();\r\n\t\t$id_field_key = null;\r\n\t\tforeach ($metadata_array as $key=>&$attr) \r\n\t\t{\r\n\t\t\t$attr2 = array(\t'field'=>$attr['field'], \r\n\t\t\t\t\t\t\t'temporal'=>($attr['temporal'] == '1' ? 1 : 0),\r\n\t\t\t\t\t\t\t'label'=>$attr['label'], \r\n\t\t\t\t\t\t\t'description'=>$attr['description'], \r\n\t\t\t\t\t\t\t'category'=>$attr['category'], \r\n\t\t\t\t\t\t\t'subcategory'=>$attr['subcategory']\r\n\t\t\t\t\t\t );\r\n\t\t\tif (isset($attr['identifier']) && $attr['identifier'] == '1') {\r\n\t\t\t\t$attr2['identifier'] = 1;\r\n\t\t\t\t// Always set the source id field's cat and subcat to blank so that it's viewed separate from the other fields\r\n\t\t\t\t$attr2['category'] = $attr2['subcategory'] = '';\r\n\t\t\t\t// Set key value for $id_field_key\r\n\t\t\t\t$id_field_key = $key;\r\n\t\t\t} else {\r\n\t\t\t\t// Add cat-subcat-fieldname concatenated together (don't do this for ID field)\r\n\t\t\t\t$field_sorter[] = $attr['category'].'---'.$attr['subcategory'].'---'.$attr['field'];\r\n\t\t\t}\r\n\t\t\t// Add to new array\r\n\t\t\t$metadata_array2[$key] = $attr2;\r\n\t\t}\r\n\t\t$metadata_array = $metadata_array2;\r\n\t\tunset($metadata_array2);\r\n\t\t\r\n\t\t## Put ID field first and then order all cats, subcats, and fields alphabetically\r\n\t\t// Remove ID field for now since we'll add it back at the end\r\n\t\t$id_field_array = $metadata_array[$id_field_key];\r\n\t\tunset($metadata_array[$id_field_key]);\r\n\t\t\r\n\t\t// Sort all fields by cat, subcat, field name\r\n\t\tarray_multisort($field_sorter, SORT_REGULAR, $metadata_array);\r\n\t\t\r\n\t\t// Finally, add ID field back to array at beginning\r\n\t\t$metadata_array = array_merge(array($id_field_array), $metadata_array);\r\n\t\t\r\n\t\t// Return array of fields (or false if not JSON encoded)\r\n\t\treturn (is_array($metadata_array) ? $metadata_array : false);\r\n\t}", "abstract public function getFields();", "abstract public function getFields();", "protected function getData(){\n $result= array();\n $dSource = $this->getDataSource();\n if($dSource !== null){\n foreach($dSource->getFields() as $field){\n $result[$field->getName()] = $field->getValue();\n }\n }\n return($result);\n }", "public function getFieldsList(){\n return $this->_get(1);\n }", "public static function getSourceFields()\n {\n return ['business_address', 'business_email', 'business_website', 'business_phone', 'business_facebook', 'business_twitter', 'business_linkedin', 'business_youtube', 'business_google', 'business_employee', 'business_scale', 'business_entity', 'business_established', 'business_long', 'business_lat', 'business_zipcode', 'payment_accept', 'area', 'emailenquiry', 'phonemessage', 'description'];\n }", "public static function get_fields()\n {\n }", "public function getListFields();", "public function getFields() : FieldCollection;", "private function getAllSourcesFromDB() {\n return $this->database->table(\"source\")->fetchAll();\n }", "public function GetSource(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n $res->get_source($conn);\n }", "abstract protected function getFields();", "public function getAllFields() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$table\t\t\t= 'tb_field';\n\t\t\t$select_what\t= 'id, vc_field AS vc_name';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_field ASC\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function getAllFields() {\n return $this->allFieldsAlias;\n }", "public function &getFields();", "public function getFields(): array;", "public function getFields(): array;", "public function getFields(): array;", "public function getFrontendFields();", "public function getContactDataFields();", "private function loadFields(){\n\t\t$this->fields = $this->wpdb->get_results($this->wpdb->prepare(\"\n\t\t\tSELECT\n\t\t\t\t`field`.`id` \t\t\t'field_id',\n\t\t\t\t`type`.`name` \t\t\t'type',\n\t\t\t\t`field`.`name`\t\t\t'name',\n\t\t\t\t`field`.`label`\t\t\t'label',\n\t\t\t\t`field`.`default`\t\t'default',\n\t\t\t\t`field`.`required`\t\t'required',\n\t\t\t\t`field`.`depends_id`\t'depends_id',\n\t\t\t\t`field`.`depends_value`\t'depends_value',\n\t\t\t\t`field`.`placeholder`\t'placeholder'\n\t\t\tFROM `mark_reg_fields` `field`\n\t\t\tLEFT JOIN `mark_reg_field_types` `type` ON `type`.`id` = `field`.`type_id`\n\t\t\tWHERE\n\t\t\t\t`field`.`enabled` = 1\n\t\t\t\tAND `field`.`form_id` = %d\n\t\t\t\tAND `field`.`backend_only` = 0\n\t\t\tORDER BY\n\t\t\t\t`field`.`order`\n\t\t\", $this->form_id));\n\t}", "abstract protected function _getFeedFields();", "function get_field_list()\n\t{\n\t\t$fields = array();\n\n\n\t\t$this->xhr_output($fields);\n\t}", "private function fields() {\n $fields = array();\n include($this->directories['plugin']['var']['dir'].'/fields.php');\n return $fields;\n }", "function get_fields( ) {\n\t\treturn $this->fields_list;\n\t\t}", "public function getSelectDataFields();", "final public function getAllFields()\r\n {\r\n return array($this->_field);\r\n }", "abstract public function get_sources();", "function get_fields() {\n global $Tainacan_Item_Metadata;\n return $Tainacan_Item_Metadata->fetch($this, 'OBJECT');\n\n }", "abstract public function fields();", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.requisite.fields'\n );\n return $fullResult;\n }", "public function sourceRecords()\n {\n if (class_exists(\"Subsite\") && Subsite::get()->count() > 0) {\n $origMode = Versioned::get_reading_mode();\n Versioned::set_reading_mode(\"Stage.Stage\");\n $items = array(\n \"Pages\" => Subsite::get_from_all_subsites(\"SiteTree\"),\n \"Files\" => Subsite::get_from_all_subsites(\"File\"),\n );\n Versioned::set_reading_mode($origMode);\n\n return $items;\n } else {\n return array(\n \"Pages\" => Versioned::get_by_stage(\"SiteTree\", \"Stage\"),\n \"Files\" => File::get(),\n );\n }\n }", "abstract public function getFields(): array;", "public function getSearchFields();", "public function getSourceData();", "public function retrieveFormFields()\n {\n return $this->start()->uri(\"/api/form/field\")\n ->get()\n ->go();\n }", "protected function fetch_fields()\n {\n if(empty($this->table_fields))\n {\n $fields = $this->_database->list_fields($this->table);\n foreach ($fields as $field) {\n $this->table_fields[] = $field;\n }\n }\n }", "function getSources();", "public function getMappingSources() {\n return parent::getMappingSources() + array(\n /* Field sources with data generated from other fields. */\n\n /* Custom field sources for enforcing uniqueness. */\n // stripped_guid is deprecated for use as GUID now, as per conversation with Dan Stryker\n // (sometimes feeds will have multiple opportunities at the same URL)\n 'stripped_guid' => array(\n 'name' => t('AFG: Opportunity URL'),\n 'description' => t('The GUID stripped of the fp:id which is appended after a hash character (#). This should be equivalent to fp:detailurl, but that doesn\\'t show up in the AFG feed output.'),\n ),\n 'volopp_hash' => array(\n 'name' => t('AFG: Hash of Title, Description, Provider'),\n 'description' => t('The md5 hash of the title, description, and fp:provider for a given feed item. Used as a GUID.'),\n ),\n\n /* Custom field for latitude from fp:latlong */\n 'afg_lat' => array(\n 'name' => t('AFG: Latitude'),\n 'description' => t('The latitude of a volunteer opportunity. (Taken from fp:latlong.)'),\n ),\n /* Custom field for longitude from fp:latlong */\n 'afg_long' => array(\n 'name' => t('AFG: Longitude'),\n 'description' => t('The longitude of a volunteer opportunity. (Taken from fp:latlong.)'),\n ),\n /* Custom field for opportunity start date from fp:startDate */\n 'afg_startDate' => array(\n 'name' => t('AFG: Opportunity Start Date'),\n 'description' => t('The opportunity start date in MM/DD/YYYY format.'),\n ),\n /* Custom field for opportunity end date from fp:endDate */\n 'afg_endDate' => array(\n 'name' => t('AFG: Opportunity End Date'),\n 'description' => t('The opportunity end date in MM/DD/YYYY format.'),\n ),\n\n /* Field sources taken directly from the AFG feed. */\n\n /* Fields that are always present on an AFG feed. */\n 'fp_id' => array(\n 'name' => t('AFG: Hash (fp:id)'),\n 'description' => t('Hashed ID of the opportunity in AFG feed output. Supposedly changes each day.'),\n ),\n 'fp_groupid' => array(\n 'name' => t('AFG: ID of Merged Opps (fp:groupid)'),\n 'description' => t('An ID for a deduped set of results.'),\n ),\n 'fp_provider' => array(\n 'name' => t('AFG: Raw Opportunity Source (fp:provider)'),\n 'description' => t('Provider of the opportunity. It is a \"machine name\", so is always lowercase and will not necessarily have spaces.'),\n ),\n 'fp_startDate' => array(\n 'name' => t('AFG: Raw Opportunity Start Date (fp:startDate)'),\n 'description' => t('The start date for a volunteer opportunity.'),\n ),\n 'fp_endDate' => array(\n 'name' => t('Opportunity End Date (fp:endDate)'),\n 'description' => t('The end date for a volunteer opportunity.'),\n ),\n 'fp_base_url' => array(\n 'name' => t('AFG: Hash (fp:base_url)'),\n 'description' => t('Same as fp:id.'),\n ),\n 'fp_xml_url' => array(\n 'name' => t('AFG: Opportunity URL with Hash (fp:xml_url)'),\n 'description' => t('Full URL to opportunity, including hash. (Same as GUID of opportunity.)'),\n ),\n 'fp_url_short' => array(\n 'name' => t('AFG: Opportunity URL Domain Name (fp:url_short)'),\n 'description' => t('The domain name of the site where the original opportunity listing is found.'),\n ),\n 'fp_latlong' => array(\n 'name' => t('AFG: Raw Latitude/Longitude (fp:latlong)'),\n 'description' => t('Latitude, Longitude to seven digits of precision. Needs custom parsing to be mapped.'),\n ),\n 'fp_location_name' => array(\n 'name' => t('AFG: Opportunity City, State Zip (fp:location_name)'),\n 'description' => t('Opportunity location, with city, state, and zip all in one field.'),\n ),\n 'fp_interest_count' => array(\n 'name' => t('AFG: Clickthrus? (fp:interest_count)'),\n 'description' => t('Unsure - possibly number of clickthrus.'),\n ),\n 'fp_impressions' => array(\n 'name' => t('AFG: Number of Pageviews? (fp:impressions)'),\n 'description' => t('Unsure - possibly number of pageviews, possibly related to an ad campaign.'),\n ),\n 'fp_quality_score' => array(\n 'name' => t('AFG: Opportunity Rating (fp:quality_score)'),\n 'description' => t('Internal rating from 0 to 10 of quality of opportunity.'),\n ),\n 'fp_virtual' => array(\n 'name' => t('AFG: Virtual Opportunity Status (fp:virtual)'),\n 'description' => t('Whether opportunity is virtual - True or False.'),\n ),\n 'fp_sponsoringOrganizationName' => array(\n 'name' => t('AFG: Sponsoring Organization Name (fp:sponsoringOrganizationName)'),\n 'description' => t('Name of organization offering this opportunity.'),\n ),\n 'fp_openEnded' => array(\n 'name' => t('AFG: Open-Ended Opportunity Status (fp:openEnded)'),\n 'description' => t('Whether opportunity is open-ended (no specific start or end date).'),\n ),\n 'fp_startTime' => array(\n 'name' => t('AFG: Opportunity Start Time (fp:startTime)'),\n 'description' => t('Opportunity start time.'),\n ),\n 'fp_endTime' => array(\n 'name' => t('AFG: Opportunity End Time (fp:endTime)'),\n 'description' => t('Opportunity end time.'),\n ),\n /* Fields that are sometimes present on an AFG feed. */\n 'fp_skills' => array(\n 'name' => t('AFG: Opportunity Skills (fp:skills)'),\n 'description' => t('Skills needed for this opportunity. (Many providers use this as a detailed description.)'),\n ),\n 'fp_contactEmail' => array(\n 'name' => t('AFG: Email Address for Primary Contact (fp:contactEmail)'),\n 'description' => t('The email address for the primary contact for the opportunity.'),\n ),\n 'fp_contactPhone' => array(\n 'name' => t('AFG: Phone Number for Primary Contact (fp:contactPhone)'),\n 'description' => t('The phone number for the primary contact for the opportunity.'),\n ),\n /* Feeds that are never (so far) present on an AFG feed. */\n 'fp_categories' => array(\n 'name' => t('AFG: Opportunity Categories (fp:categories)'),\n 'description' => t('The categories with which the opportunity is tagged. (Providers won\\'t usually offer this.)'),\n ),\n 'fp_s' => array(\n 'name' => t('fp:s'),\n 'description' => t('Unsure.'),\n ),\n 'fp_m' => array(\n 'name' => t('fp:m'),\n 'description' => t('Unsure.'),\n ),\n 'fp_addr1' => array(\n 'name' => t('AFG: First Line of Address? (fp:addr1)'),\n 'description' => t('First line of address?'),\n ),\n 'fp_addrname' => array(\n 'name' => t('AFG: Address Name? (fp:addrname)'),\n 'description' => t('Address Name?'),\n ),\n 'fp_contactNoneNeeded' => array(\n 'name' => t('fp:contactNoneNeeded'),\n 'description' => t('Unsure.'),\n ),\n 'fp_contactName' => array(\n 'name' => t('AFG: Name of Primary Contact? (fp:contactName)'),\n 'description' => t('Name of Primary Contact?'),\n ),\n 'fp_detailUrl' => array(\n 'name' => t('AFG: Link to Original Opportunity? (fp:detailUrl)'),\n 'description' => t('Link to Original Opportunity?'),\n ),\n 'fp_audienceAll' => array(\n 'name' => t('fp:audienceAll'),\n 'description' => t('Unsure.'),\n ),\n 'fp_audienceAge' => array(\n 'name' => t('AFG: Acceptable Ages? (fp:audienceAge)'),\n 'description' => t('What ages of volunteer the opportunity is suited for?'),\n ),\n 'fp_minAge' => array(\n 'name' => t('AFG: Minimum Age? (fp:minAge)'),\n 'description' => t('Minimum age for volunteers?'),\n ),\n 'fp_audienceSexRestricted' => array(\n 'name' => t('AFG: Volunteers Only of a Particular Gender? (fp:audienceSexRestricted)'),\n 'description' => t('Whether volunteers can only be of a particular gender?'),\n ),\n 'fp_street1' => array(\n 'name' => t('AFG: Street Address Line 1? (fp:street1)'),\n 'description' => t('Street Address Line 1?'),\n ),\n 'fp_street2' => array(\n 'name' => t('AFG: Street Address Line 2? (fp:street2)'),\n 'description' => t('Street Address Line 2?'),\n ),\n 'fp_city' => array(\n 'name' => t('AFG: City? (fp:city)'),\n 'description' => t('City?'),\n ),\n 'fp_region' => array(\n 'name' => t('AFG: Region/State? (fp:region)'),\n 'description' => t('Region/State?'),\n ),\n 'fp_postalCode' => array(\n 'name' => t('AFG: Postal Code/Zipcode? (fp:postalCode)'),\n 'description' => t('Postal Code/Zipcode?'),\n ),\n 'fp_country' => array(\n 'name' => t('AFG: Country? (fp:country)'),\n 'description' => t('Country?'),\n ),\n /* Service and Interest Area Auto-Tagged Value */\n 'volopp_tagged_value' => array(\n 'name' => t('Opportunity Currently Auto-Tagged'),\n 'description' => t('Whether or not the opportunity is currently auto-tagged by cron (always 0 on an import)'),\n ),\n );\n }", "public function fields(){\n\t\treturn array();\n\t}", "public function fields()\n {\n return array_map(\n function (array $field) {\n return Field::fromArray($field);\n },\n $this->client->get('field')\n );\n }", "function GetSources()\n\t{\n\t\t$result = $this->sendRequest(\"GetSources\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function &getFields() { return $this->fields; }", "public function getTextSourceField() {}", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.invoice.fields'\n );\n return $fullResult;\n }", "public function fetchSources () {\r\n\t}", "public function getFields(){\n return $this->dbFields;\n }", "public function getSource()\n {\n return $this->data['fields']['source'];\n }", "public function getFields()\n {\n return $this->content->getFields();\n }", "public function getFields($table);", "public function schemaFields() { \n return $this->allFieldsArray;\n }", "public function schemaFields() { \n return $this->allFieldsArray;\n }", "abstract public function getSettingsFields();", "function acf_get_raw_fields($id = 0)\n{\n}", "public function fetchDataTableSource()\n { \n $dataTableConfig = [\n 'searchable' => [\n 'title' \n ]\n ];\n\n return SpecificationPreset::with([\n 'presetItem' => function($query) {\n $query->with('specification');\n }\n ])->dataTables($dataTableConfig)->toArray();\n }", "public static function getAllFields(): array\n {\n $className = get_called_class();\n $table = with(new $className)->getTable();\n $cache_key = self::$cache_prefix.'.ALLFIELDS.' . strtoupper($table);\n\n return self::$use_cache ? Cache::remember($cache_key, 5 * 60, function () use ($table) {\n return \\Schema::getColumnListing($table);\n }) : \\Schema::getColumnListing($table);\n }", "protected function fetchFields(){\n $fields = X3::db()->fetchFields($this->modelName);\n $_res = array();\n foreach($fields as $name=>$field){\n $dataType = X3_MySQL_Command::parseMySQLField($field);\n $_res[$name] = $dataType;\n }\n return $_res;\n }", "public function getFields($entityName = '')\n {\n return $this->DataSourceInstance->getFields($entityName);\n }", "public function getFields() {\n $field = $this->get('field');\n return null !== $field ? $field : array();\n }", "protected function getFields()\n {\n return $this->fields;\n }", "protected function getFields()\n {\n return $this->fields;\n }", "public function getUserFields()\r\n {\r\n return CrugeFactory::get()->getICrugeFieldListModels();\r\n }", "public function fields()\n {\n return [];\n }", "public function fields()\n {\n return [];\n }", "public function fields()\n {\n return [];\n }", "public function fields()\n {\n return [];\n }", "public function fields()\n {\n return [];\n }", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.dealcategory.fields'\n );\n return $fullResult;\n }", "function REST_fields(&$ORM)\n {\n $this->rest->select_fields($ORM);\n }", "public function getFields(){\n\t\treturn $this->Fields;\n\t}", "abstract public function getFields($entity);", "static public function getFieldsList () {\n return self::_getInstance()->_fieldsList;\n }", "public function getFields()\r\n {\r\n return $this->fields;\r\n }", "public function getFieldsForTable($source, $table) {\nif (!isset($this->tables[$source['name']])) { // confirm that the specified table is valid\n\t$this->getTables($source);\n};\nif (!empty($source['allowed_tables']) && ($source['allowed_tables']=='*' || is_array($source['allowed_tables']))) { // if the source has valid allowed tables\n\tif ($source['allowed_tables']=='*' || in_array($table, $source['allowed_tables'])) {\n\t\tif ($res=$source['handle']->query('SHOW COLUMNS FROM `'.$table.'`;')) {\n\t\t\tif (!empty($res->num_rows)) {\n\t\t\t\twhile ($res2=$res->fetch_row()) {\n\t\t\t\t\t$this->tables[$source['name']][$table][$res2[0]]='';\n\t\t\t\t};\n\t\t\t\t$res->close();\n\t\t\t};\n\t\t};\n\t};\n};\nreturn $this->tables[$source['name']][$table];\n}", "public function getFields() {\n return null;\n }", "abstract function fields();", "protected function getFields()\n {\n return $this->Fields;\n }", "private function renderExternalSourceFieldTable()\r\n\t{\r\n\t\t// Get global vars\r\n\t\tglobal $Proj, $lang, $longitudinal, $realtime_webservice_offset_days, $realtime_webservice_offset_plusminus;\r\n\t\t\r\n\t\t// If fields are not mapped AND we've not just selected some to map, then don't display table\r\n\t\tif (!$this->isMappingSetUp() && !isset($_POST['select_fields'])) return '';\r\n\t\t\r\n\t\t// Call javascript file\r\n\t\tcallJSfile('DynamicDataPullMapping.js');\r\n\t\t\r\n\t\t// Get the external source fields in array format\r\n\t\t$external_fields_all = $this->getExternalSourceFields();\r\n\t\t \r\n\t\t// Now filter out the ones NOT selected\r\n\t\t$external_id_field_attr = array();\r\n\t\t$src_preview_fields_all = array(''=>'');\r\n\t\t$external_id_field = '';\r\n\t\tforeach ($external_fields_all as $key=>$attr) {\r\n\t\t\t// Remove from original array via its key\r\n\t\t\tunset($external_fields_all[$key]);\r\n\t\t\t// If has already been mapped or user just selected fields to map\r\n\t\t\tif (!isset($_POST['select_fields']) || (isset($_POST['select_fields']) && isset($_POST[$attr['field']]))) {\r\n\t\t\t\t// Re-add to array but with field as key\r\n\t\t\t\t$external_fields_all[$attr['field']] = $attr;\r\n\t\t\t\t// If this is the source identifier field, then store separately and later prepend to array\r\n\t\t\t\tif (isset($attr['identifier']) && $attr['identifier'] == '1') {\r\n\t\t\t\t\t$external_id_field_attr[$attr['field']] = $attr;\r\n\t\t\t\t\t$external_id_field = $attr['field'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Add all non-temporal fields to array for Preview feature\r\n\t\t\tif (!(isset($attr['temporal']) && $attr['temporal'] == '1') && !(isset($attr['identifier']) && $attr['identifier'] == '1')) {\r\n\t\t\t\t$src_preview_fields_all[$attr['field']] = \"{$attr['field']} \\\"{$attr['label']}\\\"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// SORT SOURCE FIELDS: Although the fields will already be sorted within their subcategories, we need to now sort them by their category.\r\n\t\t$srcCatFieldSort = array();\r\n\t\t// Shift off Source ID field, then re-add after sort (to keep in at the beginning)\r\n\t\t$sourceIdArray = array_shift($external_fields_all);\r\n\t\tforeach ($external_fields_all as &$attr) {\r\n\t\t\t// Now add category+field to sorting array\r\n\t\t\t$srcCatFieldSort[] = $attr['category'].'---'.$attr['field'];\r\n\t\t}\r\n\t\t// Now sort $external_fields_all according to cat+field value\r\n\t\tarray_multisort($srcCatFieldSort, SORT_REGULAR, $external_fields_all);\r\n\t\t// Now add Source ID field back to beginning\r\n\t\t$external_fields_all = array($sourceIdArray['field']=>$sourceIdArray) + $external_fields_all;\r\n\t\tunset($srcCatFieldSort);\r\n\t\t\r\n\t\t// Get the external source fields already mapped in this project\r\n\t\t$external_fields_mapped = $this->getMappedFields();\r\n\t\t\r\n\t\t## Find any many-to-one mappings (many source fields to same REDCap field)\r\n\t\t// Remove map_id attribute from $external_fields_mapped and put in new array\r\n\t\t$many_to_one_external_fields = $many_to_one_keys = $external_fields_mapped_wo_mapid = array();\r\n\t\t$temporal_field_list = array(''=>'-- Choose other source field --');\r\n\t\tforeach ($external_fields_mapped as $this_ext_field=>$attr1) {\r\n\t\t\tforeach ($attr1 as $this_event_id=>$these_fields) {\r\n\t\t\t\tforeach ($these_fields as $this_field=>$field_attr) {\r\n\t\t\t\t\t// Remove map_id\r\n\t\t\t\t\tunset($field_attr['map_id']);\r\n\t\t\t\t\t// Add to new array\r\n\t\t\t\t\t$external_fields_mapped_wo_mapid[$this_ext_field][$this_event_id][$this_field] = $field_attr;\r\n\t\t\t\t\t// If source field is a temporal field, then add to temporal field list array\r\n\t\t\t\t\tif ($field_attr['temporal_field'] != '') {\r\n\t\t\t\t\t\t$temporal_field_list[$this_ext_field] = $this_ext_field.\" \\\"{$external_fields_all[$this_ext_field]['label']}\\\"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Now loop through post fields (if just selected fields from the tree) to add them to temporal field list\r\n\t\tif (isset($_POST['select_fields'])) {\r\n\t\t\tforeach ($_POST as $this_ext_field=>$is_on) {\r\n\t\t\t\tif ($this_ext_field == 'select_fields' || $is_on != 'on') continue;\r\n\t\t\t\tif ($external_fields_all[$this_ext_field]['temporal']) {\r\n\t\t\t\t\t$temporal_field_list[$this_ext_field] = $this_ext_field.\" \\\"{$external_fields_all[$this_ext_field]['label']}\\\"\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Sort $temporal_field_list alphabetically by source variable name\r\n\t\tksort($temporal_field_list);\r\n\t\t// Now loop through the fields again in $external_fields_mapped_wo_mapid and note any with same exact mappings (i.e. are many-to-one)\r\n\t\t$i = 0;\r\n\t\tforeach ($external_fields_mapped_wo_mapid as $this_ext_field=>$this_attr) {\r\n\t\t\t// Loop through the entire mapping AGAIN (ignoring this_ext_field) so that we loop through EVERY field for EACH field\r\n\t\t\tforeach ($external_fields_mapped_wo_mapid as $this_loop_ext_field=>$this_loop_attr) {\r\n\t\t\t\t// Skip if same field\r\n\t\t\t\tif ($this_ext_field != $this_loop_ext_field && $this_attr === $this_loop_attr) {\r\n\t\t\t\t\t// Serialize array and make it the array key with the source fields as sub-array values (best way to group them)\r\n\t\t\t\t\t$key_serialized = serialize($this_attr);\r\n\t\t\t\t\tif (!isset($many_to_one_external_fields[$key_serialized])) {\r\n\t\t\t\t\t\t// If the first field to have the same attributes, then put this one field in array to note to us where to begin\r\n\t\t\t\t\t\t$many_to_one_keys[$this_ext_field] = $key_serialized;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Add to array\r\n\t\t\t\t\t$many_to_one_external_fields[$key_serialized][] = $this_ext_field;\r\n\t\t\t\t\t// Keep the subarrays unique\r\n\t\t\t\t\t$many_to_one_external_fields[$key_serialized] = array_values(array_unique($many_to_one_external_fields[$key_serialized]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Loop through fields once more, and as we loop, if any fields are many-to-one and should be grouped together, \r\n\t\t// then remove from array and resplice them together in array\r\n\t\t$mapped_wo_mapid_temp = $mapped_wo_mapid_ignore = array();\r\n\t\t// Copy array to rework it as we go \r\n\t\t$external_fields_all_regrouped = $external_fields_all;\r\n\t\tforeach ($external_fields_mapped_wo_mapid as $this_ext_field=>$this_attr) {\r\n\t\t\t// Does this field exist in the $many_to_one_keys array?\r\n\t\t\tif (!isset($many_to_one_keys[$this_ext_field])) continue;\r\n\t\t\t// If so, get serialized key to connect it to the fields in array $many_to_one_external_fields\r\n\t\t\t$these_many_to_one_fields = $many_to_one_external_fields[$many_to_one_keys[$this_ext_field]];\r\n\t\t\t// Shift off first field in array\r\n\t\t\t$this_first_many_to_one = array_shift($these_many_to_one_fields);\r\n\t\t\t// Add group fields to new array with attributes\r\n\t\t\t$these_many_to_one_fields_attr = array($this_first_many_to_one=>$external_fields_all[$this_first_many_to_one]);\r\n\t\t\t// Loop through other fields in this group and remove them from $external_fields_all_regrouped \r\n\t\t\t// (because we'll add them back later in the correct position)\r\n\t\t\tforeach ($these_many_to_one_fields as $this_other_many_to_one) {\r\n\t\t\t\t// Remove from array\r\n\t\t\t\tunset($external_fields_all_regrouped[$this_other_many_to_one]);\r\n\t\t\t\t// Add field to field group array containing attributes\r\n\t\t\t\t$these_many_to_one_fields_attr[$this_other_many_to_one] = $external_fields_all[$this_other_many_to_one];\r\n\t\t\t}\r\n\t\t\t// Get the array position of the first field in $these_many_to_one_fields so we know where to splice $external_fields_mapped_wo_mapid\r\n\t\t\t$key_position = array_search($this_first_many_to_one, array_keys($external_fields_all_regrouped));\r\n\t\t\tif ($key_position !== false && !empty($these_many_to_one_fields_attr)) {\r\n\t\t\t\t$first_half = array_slice($external_fields_all_regrouped, 0, $key_position, true);\r\n\t\t\t\t$second_half = array_slice($external_fields_all_regrouped, $key_position+1, null, true);\r\n\t\t\t\t// Add all 3 array segments back together and PUT MANY-TO-ONE FIELDS AT END\r\n\t\t\t\t$external_fields_all_regrouped = $first_half + $these_many_to_one_fields_attr + $second_half;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//print \"<br>count: \".count($external_fields_all);\r\n\t\t//print \"<br>count: \".count($external_fields_all_regrouped);\r\n\t\t// print_array(array_keys($external_fields_all_regrouped));\r\n\t\t//print_array(array_diff(array_keys($external_fields_all), array_keys($external_fields_all_regrouped)));\r\n\t\t// Replace original array with the resorted one\r\n\t\t$external_fields_all = $external_fields_all_regrouped;\r\n\t\t// Remove unneeded arrays\r\n\t\tunset($external_fields_all_regrouped);\r\n\t\t\r\n\t\t// Build an array of drop-down options listing all REDCap fields\r\n\t\t$rc_fields = $rc_date_fields = array(''=>'');\r\n\t\tforeach ($Proj->metadata as $this_field=>$attr1) {\r\n\t\t\t// Ignore SQL fields and checkbox fields and Form Status fields\r\n\t\t\tif ($attr1['element_type'] == 'sql' || $attr1['element_type'] == 'checkbox' \r\n\t\t\t\t|| $attr1['form_name'].'_complete' == $this_field) continue;\r\n\t\t\t// Add to fields/forms array. Get form of field.\r\n\t\t\t$this_form_label = $Proj->forms[$attr1['form_name']]['menu'];\r\n\t\t\t$rc_fields[$this_form_label][$this_field] = \"$this_field \\\"{$attr1['element_label']}\\\"\";\r\n\t\t\t// If a date field, then add to array\r\n\t\t\tif ($attr1['element_type'] == 'text' && \r\n\t\t\t\t(in_array($attr1['element_validation_type'], array('date', 'date_ymd', 'date_mdy', 'date_dmy'))\r\n\t\t\t\t|| substr($attr1['element_validation_type'], 0, 8) == 'datetime')) \r\n\t\t\t{\r\n\t\t\t\t$rc_date_fields[$this_form_label][$this_field] = \"$this_field \\\"{$attr1['element_label']}\\\"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// If longitudinal, build an array of drop-down options listing all REDCap event names\r\n\t\tif ($longitudinal) {\r\n\t\t\t$rc_events = array(''=>'');\r\n\t\t\tforeach ($Proj->eventInfo as $this_event_id=>$attr) {\r\n\t\t\t\t// Add to array\r\n\t\t\t\t$rc_events[$this_event_id] = $attr['name_ext'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$rows = '';\r\n\t\t\t\t\r\n\t\t// Set table headers\t\t\r\n\t\t$rows .= RCView::tr('',\r\n\t\t\t\t\tRCView::td(array('class'=>'header', 'style'=>'padding:10px;width:200px;font-size:13px;'),\r\n\t\t\t\t\t\t$lang['ws_103'] .\r\n\t\t\t\t\t\tRCView::div(array('style'=>'color:#800000;'),\r\n\t\t\t\t\t\t\t\"(\" . $this->getSourceSystemName() . \")\"\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) .\r\n\t\t\t\t\t(!$longitudinal ? '' :\r\n\t\t\t\t\t\tRCView::td(array('class'=>'header', 'style'=>'padding:10px;width:170px;font-size:13px;'),\r\n\t\t\t\t\t\t\t$lang['ws_104']\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) .\r\n\t\t\t\t\tRCView::td(array('class'=>'header', 'style'=>'padding:10px;font-size:13px;'),\r\n\t\t\t\t\t\t$lang['ws_105']\r\n\t\t\t\t\t) .\r\n\t\t\t\t\tRCView::td(array('class'=>'header', 'style'=>'padding:10px;width:200px;font-size:13px;'),\r\n\t\t\t\t\t\tRCView::div(array('class'=>'nowrap'),\r\n\t\t\t\t\t\t\t$lang['ws_106']\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('style'=>'margin-top:5px;font-weight:normal;color:#777;line-height:10px;font-size:11px;'),\r\n\t\t\t\t\t\t\t$lang['ws_107']\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) .\r\n\t\t\t\t\tRCView::td(array('class'=>'header', 'style'=>'padding:10px 5px;text-align:center;font-weight:normal;width:55px;'),\r\n\t\t\t\t\t\t$lang['ws_108']\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\r\n\t\t// print_array($external_fields_mapped);\r\n\t\t// print_array($external_fields_all);\r\n\t\t//print_array($_POST);\r\n\t\t\r\n\t\t// Loop through all fields to create each as a table row\r\n\t\t$prev_src_field = $prev_mapped_to_rc_event = $prev_src_cat = $prev_src_subcat = $true_prev_src_field = ''; // defaults\r\n\t\t$nonDisplayedManyToOneMappingsJs = '';\r\n\t\t$catsAlreadyDisplayed = array();\r\n\t\tforeach ($external_fields_all as $src_field=>&$attr)\r\n\t\t{\r\n\t\t\t$src_label = $attr['label'];\r\n\t\t\t$src_cat = $attr['category'];\r\n\t\t\t\r\n\t\t\t// Field neither mapped nor selected from source field tree (do NOT display)\r\n\t\t\tif (!isset($external_fields_mapped[$src_field]) && !isset($_POST['select_fields'])) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Is this field already mapped? If so, put REDCap fields mapped to this source field into array for looping\r\n\t\t\tif (isset($external_fields_mapped[$src_field])) {\r\n\t\t\t\t// Set flag if part of a many-to-one group (but is not the first field)\r\n\t\t\t\t$isManyToOne = ($external_fields_mapped_wo_mapid[$src_field] === $external_fields_mapped_wo_mapid[$true_prev_src_field]);\r\n\t\t\t\t// Add mappings to array that we will loop through\r\n\t\t\t\t$external_fields_mapped_field_list = $external_fields_mapped[$src_field];\r\n\t\t\t\t// If temporary fields in the mappings array have the same source field and RC field BUT do NOT have same temporal date field,\r\n\t\t\t\t// then separate into multiple arrays so that they don't get bunched together and thus overwrite the date field selection.\r\n\t\t\t\t$external_fields_mapped_field_list_super = array();\r\n\t\t\t\t$super_key = 0;\r\n\t\t\t\tforeach ($external_fields_mapped_field_list as $mapped_to_rc_event=>&$mapped_to_rc_event_array) {\t\t\t\t\r\n\t\t\t\t\t// Set defaults\r\n\t\t\t\t\t$prev_temporal_field = $prev_temporal_preselect = '';\r\n\t\t\t\t\tforeach ($mapped_to_rc_event_array as $mapped_to_rc_field=>$mapped_attr) {\r\n\t\t\t\t\t\t// If has different temporal field or preselect option, then add as new table row\r\n\t\t\t\t\t\tif ($prev_temporal_field != $mapped_attr['temporal_field'] || $prev_temporal_preselect != $mapped_attr['preselect']) {\r\n\t\t\t\t\t\t\t$super_key++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Add to super array\r\n\t\t\t\t\t\t$external_fields_mapped_field_list_super[$super_key][$mapped_to_rc_event][$mapped_to_rc_field] = $mapped_attr;\r\n\t\t\t\t\t\t// Set for next loop\r\n\t\t\t\t\t\t$prev_temporal_field = $mapped_attr['temporal_field'];\r\n\t\t\t\t\t\t$prev_temporal_preselect = $mapped_attr['preselect'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Increment super key\r\n\t\t\t\t\t$super_key++;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t// New fields to be added\r\n\t\t\t\t$external_fields_mapped_field_list_super = array(array(''=>array($src_field=>array())));\r\n\t\t\t\t$isManyToOne = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// print \"$src_field, \\\"$src_label\\\"\";\r\n\t\t\t// print_array($external_fields_mapped_field_list);\r\n\t\t\t// print_array($external_fields_mapped_field_list_super);\r\n\t\t\t\r\n\t\t\t// Loop through all REDCap fields mapped to this one source field (one-to-many relationship)\r\n\t\t\tforeach ($external_fields_mapped_field_list_super as &$external_fields_mapped_field_list)\r\n\t\t\t{\r\n\t\t\t\t$firstEventOfItem = true;\r\n\t\t\t\t$prev_temporal_preselect = $prev_temporal_field = '';\r\n\t\t\t\tforeach ($external_fields_mapped_field_list as $mapped_to_rc_event=>$mapped_to_rc_event_array)\r\n\t\t\t\t{\r\n\t\t\t\t\t// MULTI-EVENT MANY-TO-ONE MAPPING\r\n\t\t\t\t\t// In this instance where there is a many-to-one mapping over multiple events, it's really hard to loop sequentially and\r\n\t\t\t\t\t// get the table to display correctly. So instead, collect the source fields on the non-last events in the mapping,\r\n\t\t\t\t\t// and use jQuery to display them after the table is loaded. Not perfect but it works.\r\n\t\t\t\t\tif ($firstEventOfItem && \r\n\t\t\t\t\t\t// Is field a many-to-one parent?\r\n\t\t\t\t\t\tisset($many_to_one_keys[$src_field]) && \r\n\t\t\t\t\t\t// Is many-to-one parent used in multiple events?\r\n\t\t\t\t\t\tcount($external_fields_mapped_field_list) > 1) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Build arrays of events/fields to loop through in order to construct the javascript\r\n\t\t\t\t\t\t$theseManyToOneFieldsNonLastEvent = $many_to_one_external_fields[$many_to_one_keys[$src_field]];\r\n\t\t\t\t\t\tunset($theseManyToOneFieldsNonLastEvent[0]); // Remove first field (not needed)\r\n\t\t\t\t\t\t$theseManyToOneEvents = array_keys($external_fields_mapped_field_list);\r\n\t\t\t\t\t\tarray_pop($theseManyToOneEvents); // Remove last event_id (not needed)\t\t\t\t\t\r\n\t\t\t\t\t\t// Loop through events/fields to build javascript\r\n\t\t\t\t\t\tforeach ($theseManyToOneEvents as $thisMtoEventId) {\r\n\t\t\t\t\t\t\tforeach ($theseManyToOneFieldsNonLastEvent as $thisMtoField) {\r\n\t\t\t\t\t\t\t\t$nonDisplayedManyToOneMappingsJs .= \r\n\t\t\t\t\t\t\t\t\t\"var addMtoDD = $('table#src_fld_map_table select[name=\\\"dde-{$src_field}[]\\\"] option[value=\\\"$thisMtoEventId\\\"]:selected').parents('tr:first').find('.manytoone_dd');\" .\r\n\t\t\t\t\t\t\t\t\t\"addMtoDD.val('\".cleanHtml($thisMtoField).\"');copyRowManyToOneDD(addMtoDD,false);\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Skip all non-last events if a many-to-one child row (because they will be added via javascript when page loads)\r\n\t\t\t\t\tif (!$firstEventOfItem && $isManyToOne) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ($mapped_to_rc_event_array as $mapped_to_rc_field=>$mapped_attr)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Is this field already mapped? If so, check the checkbox and highlight as green\r\n\t\t\t\t\t\tif ($mapped_to_rc_event != '') {\r\n\t\t\t\t\t\t\t// Field already mapped\r\n\t\t\t\t\t\t\t$highlight_class = \"\";\r\n\t\t\t\t\t\t\t$chkbox_identifier = ($mapped_attr['is_record_identifier'] == '1') ? \"checked\" : \"\"; \r\n\t\t\t\t\t\t\t$mapped_to_rc_date_field = $mapped_attr['temporal_field'];\r\n\t\t\t\t\t\t} elseif (isset($_POST['select_fields'])) {\r\n\t\t\t\t\t\t\t// Field selected from the source field tree\r\n\t\t\t\t\t\t\t$chkbox_identifier = $mapped_to_rc_date_field = $mapped_to_rc_field = \"\";\r\n\t\t\t\t\t\t\t// Do green highlight if we just selected new fields to map\r\n\t\t\t\t\t\t\t$highlight_class = \"blue\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// If longitudinal, add event drop-down\r\n\t\t\t\t\t\t$event_dd = \"\";\r\n\t\t\t\t\t\tif ($longitudinal) {\r\n\t\t\t\t\t\t\t$event_dd = RCView::div(array('style'=>'font-weight:bold;'),\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::select(array('class'=>'evtfld', 'style'=>'max-width:100%;', 'name'=>'dde-'.$src_field.'[]'), $rc_events, $mapped_to_rc_event, 40)\r\n\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// If a temporal field, add date field drop-down to select\r\n\t\t\t\t\t\t$temporal_dd = $deleteFieldLink = $mapAnotherFieldLink = $mapAnotherEventLink = $temporal_field_dd_many_to_one = $copySrcRow = '';\r\n\t\t\t\t\t\tif ($attr['temporal'] && $src_field != $external_id_field) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$temporal_dd = \tRCView::div(array('style'=>'font-weight:bold;'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t//\"Map to REDCap date field:\" . RCView::SP . RCView::SP .\r\n\t\t\t\t\t\t\t\t\t\t\t\tRCView::div(array('style'=>'font-size:11px;line-height:8px;'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$lang['ws_109']\r\n\t\t\t\t\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t\t\t\t\tRCView::select(array('class'=>'temfld', 'style'=>'max-width:100%;', 'name'=>'ddt-'.$src_field.'[]'), $rc_date_fields, $mapped_to_rc_date_field, 45) .\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Preselection option\r\n\t\t\t\t\t\t\t\t\t\t\t\tRCView::div(array('style'=>'font-size:11px;line-height:8px;margin-top:8px;'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$lang['ws_110']\r\n\t\t\t\t\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t\t\t\t\tRCView::select(array('class'=>'presel', 'preval'=>$mapped_attr['preselect'], 'onchange'=>\"preselectConform(this);\", 'style'=>'max-width:100%;', 'name'=>'ddp-'.$src_field.'[]'), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray('NULL'=>'-- '.$lang['database_mods_81'].' --', 'MIN'=>$lang['ws_15'], \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'MAX'=>$lang['ws_16'], 'FIRST'=>$lang['ws_17'], 'LAST'=>$lang['ws_18'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'NEAR'=>$lang['ws_194']), $mapped_attr['preselect'])\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$deleteFieldLink = RCView::a(array('href'=>'javascript:;', 'onclick'=>\"deleteMapField(this);\"), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'cross_small2.png', 'title'=>$lang['scheduling_57']))\r\n\t\t\t\t\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\t\t\t$mapAnotherFieldLink = \tRCView::div(array('id'=>'rcAddDD-'.$src_field, 'style'=>'text-align:right;line-height:10px;padding:3px 16px 0 0;'), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'plus_small2.png')) .\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'color:green;font-size:10px;text-decoration:underline;', 'onclick'=>\"mapOtherRedcapField(this,'$src_field');\"), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$lang['ws_111']\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$copySrcRow = \tRCView::a(array('title'=>$lang['ws_112'], 'href'=>'javascript:;', 'class'=>'copySrcRowTemporal', 'style'=>'margin-right:5px;', 'onclick'=>\"copySrcRowTemporal(this,'$src_field');\"), \r\n\t\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'page_copy.png', 'class'=>'imgfix2'))\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t// Allow to copy row to map src field to fields on another event (except for source id field)\r\n\t\t\t\t\t\t\tif ($longitudinal) {\r\n\t\t\t\t\t\t\t\t$mapAnotherEventLink = \tRCView::div(array('style'=>'margin-top:10px;'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'plus_small2.png')) .\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'color:green;font-size:10px;text-decoration:underline;', 'onclick'=>\"copyMappingOtherEvent(this);\"), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$lang['ws_113']\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Add drop-down of temporal fields for performing many-to-one mappings (only display for first field in many-to-one group)\r\n\t\t\t\t\t\t\t//if (!$isManyToOne) {\r\n\t\t\t\t\t\t\t\t// Create drop-down list unique to this source field so that itself is not included in the drop-down\r\n\t\t\t\t\t\t\t\t$this_temporal_field_list = $temporal_field_list;\r\n\t\t\t\t\t\t\t\tunset($this_temporal_field_list[$src_field]);\r\n\t\t\t\t\t\t\t\t// Set link with hidden drop-down\r\n\t\t\t\t\t\t\t\t$temporal_field_dd_many_to_one = \r\n\t\t\t\t\t\t\t\t\tRCView::div(array(),\r\n\t\t\t\t\t\t\t\t\t\t// Preselection option\r\n\t\t\t\t\t\t\t\t\t\tRCView::div(array('class'=>'manytoone_showddlink', 'style'=>'margin:10px 0 5px;'),\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'plus_small2.png')) .\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'color:green;font-size:10px;text-decoration:underline;', 'onclick'=>\"mappingShowManyToOneDD($(this))\"), \r\n\t\t\t\t\t\t\t\t\t\t\t\t$lang['ws_114']\r\n\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t\t\tRCView::select(array('class'=>'manytoone_dd', 'style'=>'margin-top:8px;display:none;max-width:100%;font-size:11px;', 'onchange'=>'copyRowManyToOneDD($(this));'), $this_temporal_field_list, '', 45)\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Set dropdown(s) for REDCap fields to be selected\r\n\t\t\t\t\t\t$this_rc_field_dropdown = RCView::div(array('style'=>'padding-bottom:2px;white-space:nowrap;'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::select(array('class'=>'mapfld', 'onchange'=>($attr['temporal'] ? \"preselectConform(this);\" : \"\"), 'style'=>'max-width:94%;', 'name'=>'ddf-'.$src_field.'[]'), $rc_fields, $mapped_to_rc_field, 45) . \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$deleteFieldLink\r\n\t\t\t\t\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\t\tif ($prev_src_field == $src_field && $prev_mapped_to_rc_event == $mapped_to_rc_event\r\n\t\t\t\t\t\t\t&& $prev_temporal_field == $mapped_attr['temporal_field'] && $prev_temporal_preselect == $mapped_attr['preselect']) {\r\n\t\t\t\t\t\t\t$rc_field_dropdown .= $this_rc_field_dropdown;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$rc_field_dropdown = $this_rc_field_dropdown;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Set for next loop\r\n\t\t\t\t\t\t$prev_src_field = $src_field;\r\n\t\t\t\t\t\t$prev_mapped_to_rc_event = $mapped_to_rc_event;\r\n\t\t\t\t\t\t$prev_temporal_field = $mapped_attr['temporal_field'];\r\n\t\t\t\t\t\t$prev_temporal_preselect = $mapped_attr['preselect'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// If this is the source id field, then add a special header\r\n\t\t\t\t\t$external_id_field_special_label = '';\r\n\t\t\t\t\t$hiddenInputSourceIdMarker = '';\r\n\t\t\t\t\t$removeMappingIcon = RCView::a(array('title'=>$lang['ws_115'], 'class'=>'delMapRow', 'href'=>'javascript:;', 'onclick'=>\"deleteMapRow(this);\"), \r\n\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'cross.png', 'class'=>'imgfix2'))\r\n\t\t\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\tif ($src_field == $external_id_field) {\r\n\t\t\t\t\t\t$external_id_field_special_label = \tRCView::div(array('style'=>'color:#96740E;margin:2px 0 5px;'), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'star.png', 'class'=>'imgfix')) .\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::span(array('style'=>''), $lang['ws_116'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$hiddenInputSourceIdMarker = RCView::hidden(array('name'=>\"id-{$external_id_field}[]\", 'value'=>'1'));\r\n\t\t\t\t\t\t$removeMappingIcon = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// If starting a new category, then display cat name as section header\r\n\t\t\t\t\tif ($prev_src_cat != $src_cat && !isset($catsAlreadyDisplayed[$src_cat]) \r\n\t\t\t\t\t\t// If this field is part of a many-to-one group and it is NOT the first field in the group, then do NOT display a cat header\r\n\t\t\t\t\t\t&& !$isManyToOne\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\t$catsAlreadyDisplayed[$src_cat] = true;\r\n\t\t\t\t\t\t$rows .= RCView::tr(array(),\r\n\t\t\t\t\t\t\t\t\tRCView::td(array('valign'=>'top', 'colspan'=>($longitudinal ? 5 : 4), 'style'=>'font-weight:bold;color:#800000;border:1px solid #aaa;background-color:#ccc;padding:5px 10px;font-size:13px;'),\r\n\t\t\t\t\t\t\t\t\t\t$src_cat\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// print \"<hr>$src_field\";\r\n\t\t\t\t\t// print_array($external_fields_mapped_wo_mapid[$src_field]);\r\n\t\t\t\t\t// print \"<br>$true_prev_src_field\";\r\n\t\t\t\t\t// print_array($external_fields_mapped_wo_mapid[$true_prev_src_field]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// If a many-to-one child, then add special row attribute to denote this\r\n\t\t\t\t\t$manyToOneAttr = ($isManyToOne ? $src_field : '');\r\n\t\t\t\t\t$manyToOneAttrName = ($isManyToOne ? 'manytoone' : '');\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Add row\r\n\t\t\t\t\t$rows .= RCView::tr(array($manyToOneAttrName=>$manyToOneAttr),\r\n\t\t\t\t\t\t\t\tRCView::td(array('valign'=>'top', 'class'=>\"data $highlight_class\", \r\n\t\t\t\t\t\t\t\t\t'style'=>'border-bottom:0;padding:5px 10px 2px;width:170px;'.($isManyToOne ? 'border-top:0;' : '')),\r\n\t\t\t\t\t\t\t\t\t// If a many-to-one mapping, then display \"OR\" before the variable/label\r\n\t\t\t\t\t\t\t\t\tRCView::div(array('class'=>'manytoone_or', 'style'=>'margin:0 0 4px 10px;color:#999;'.($isManyToOne ? '' : 'display:none;')), \r\n\t\t\t\t\t\t\t\t\t\t\"&mdash; \".$lang['global_46']. \" &mdash;\"\r\n\t\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t\t// Display variable/label\r\n\t\t\t\t\t\t\t\t\tRCView::div(array('class'=>'source_var_label'),\r\n\t\t\t\t\t\t\t\t\t\tRCView::b($src_field) . \" &nbsp;\\\"\" . $src_label . \"\\\"\"\r\n\t\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t\t$external_id_field_special_label .\r\n\t\t\t\t\t\t\t\t\t// Option to perform many-to-one mapping (temporal fields only)\r\n\t\t\t\t\t\t\t\t\t$temporal_field_dd_many_to_one\r\n\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t(!$longitudinal ? '' :\r\n\t\t\t\t\t\t\t\t\tRCView::td(array('valign'=>'top', 'class'=>\"data $highlight_class\", 'style'=>'border-bottom:0;padding:5px 10px;'.($isManyToOne ? 'border-top:0;' : '')),\r\n\t\t\t\t\t\t\t\t\t\t($isManyToOne ? '' : \r\n\t\t\t\t\t\t\t\t\t\t\tRCView::div(array('class'=>'td_container_div'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t$event_dd .\r\n\t\t\t\t\t\t\t\t\t\t\t\t$mapAnotherEventLink\r\n\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\tRCView::td(array('valign'=>'top', 'class'=>\"data $highlight_class\", 'style'=>'border-bottom:0;padding:5px 10px;'.($isManyToOne ? 'border-top:0;' : '')),\r\n\t\t\t\t\t\t\t\t\t($isManyToOne ? '' : \r\n\t\t\t\t\t\t\t\t\t\tRCView::div(array('class'=>'td_container_div'),\r\n\t\t\t\t\t\t\t\t\t\t\t$rc_field_dropdown .\r\n\t\t\t\t\t\t\t\t\t\t\t$hiddenInputSourceIdMarker .\r\n\t\t\t\t\t\t\t\t\t\t\t$mapAnotherFieldLink\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\tRCView::td(array('valign'=>'top', 'class'=>\"data $highlight_class\", 'style'=>'border-bottom:0;padding:5px 10px;'.($isManyToOne ? 'border-top:0;' : '')),\r\n\t\t\t\t\t\t\t\t\t($isManyToOne ? '' : \r\n\t\t\t\t\t\t\t\t\t\tRCView::div(array('class'=>'td_container_div'),\r\n\t\t\t\t\t\t\t\t\t\t\t$temporal_dd\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\tRCView::td(array('valign'=>'top', 'class'=>\"data $highlight_class\", 'style'=>'border-bottom:0;padding-top:5px;text-align:center;width:55px;'),\r\n\t\t\t\t\t\t\t\t\t$copySrcRow . $removeMappingIcon\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t// Set flag for all non-initial events in the subarray\r\n\t\t\t\t\t$firstEventOfItem = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Set for next loop\r\n\t\t\t$prev_src_cat = $src_cat;\r\n\t\t\t$true_prev_src_field = $src_field;\r\n\t\t}\r\n\t\t\r\n\t\t## PREVIEW FIELDS\r\n\t\t// Get source \"preview\" fields as array\r\n\t\t$preview_fields = $this->getPreviewFields();\t\t\r\n\t\t// Html to delete the associated Preview field drop-down\r\n\t\t$deletePreviewFieldLink = \tRCView::a(array('href'=>'javascript:;', 'onclick'=>\"deletePreviewField(this);\"), \r\n\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'cross_small2.png', 'title'=>$lang['scheduling_57']))\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t// Loop through preview fields and build html for drop-downs/divs\r\n\t\tif (empty($preview_fields)) {\r\n\t\t\t// No preview fields are designated, so render blank drop-down\r\n\t\t\t$preview_fields_html = \tRCView::div(array('class'=>'rtws_preview_field'),\r\n\t\t\t\t\t\t\t\t\t\tRCView::select(array('style'=>'max-width:100%;', 'name'=>'preview_field[]'), $src_preview_fields_all, '', 60) .\r\n\t\t\t\t\t\t\t\t\t\t$deletePreviewFieldLink\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t} else {\r\n\t\t\t// Render all preview field drop-downs\r\n\t\t\t$preview_fields_html = \"\";\r\n\t\t\tforeach ($preview_fields as $this_preview_field) {\r\n\t\t\t\t$preview_fields_html .=\tRCView::div(array('class'=>'rtws_preview_field'),\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::select(array('style'=>'max-width:100%;', 'name'=>'preview_field[]'), $src_preview_fields_all, $this_preview_field, 60) .\r\n\t\t\t\t\t\t\t\t\t\t\t$deletePreviewFieldLink\r\n\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set pixel width of table/divs\r\n\t\t$tableWidth = ($longitudinal ? 958 : 798);\r\n\t\t\r\n\t\t// Set table html\r\n\t\t$table = \r\n\t\t\t\t// Settings header\r\n\t\t\t\tRCView::div(array('style'=>'width:'.$tableWidth.'px;font-weight:bold;color:#fff;border:1px solid #ccc;border-bottom:0;background-color:#555;padding:8px 10px;font-size:13px;'),\r\n\t\t\t\t\t$lang['ws_117']\r\n\t\t\t\t) .\r\n\t\t\t\t// Settings - Preview fields\r\n\t\t\t\tRCView::div(array('class'=>\"data\", 'style'=>'width:'.$tableWidth.'px;background-image:none;background-color:#eee;padding:10px;'),\r\n\t\t\t\t\tRCView::table(array('cellspacing'=>'0', 'style'=>'width:100%;table-layout:fixed;'),\r\n\t\t\t\t\t\tRCView::tr(array(),\r\n\t\t\t\t\t\t\tRCView::td(array('valign'=>'top', 'style'=>'width:450px;padding-right:30px;color:#555;line-height:13px;'),\r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'font-weight:bold;font-size:14px;color:#800000;line-height:14px;margin-bottom:5px;'),\r\n\t\t\t\t\t\t\t\t\t$lang['ws_118']\r\n\t\t\t\t\t\t\t\t) . \r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'font-size:11px;line-height:11px;'),\r\n\t\t\t\t\t\t\t\t\t$lang['ws_119'].\" (e.g. {$external_id_field_attr[$external_id_field]['label']}) \".$lang['ws_120']\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::td(array('valign'=>'top'),\r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'font-weight:bold;margin-bottom:5px;'),\r\n\t\t\t\t\t\t\t\t\t$lang['ws_121'] . \" \" . $this->getSourceSystemName() . \" \" . \r\n\t\t\t\t\t\t\t\t\tRCView::span(array('style'=>'color:#800000'), $lang['ws_122']) .\r\n\t\t\t\t\t\t\t\t\t$lang['colon']\r\n\t\t\t\t\t\t\t\t) . \r\n\t\t\t\t\t\t\t\t// Preview field(s)\r\n\t\t\t\t\t\t\t\t$preview_fields_html .\r\n\t\t\t\t\t\t\t\t// \"Add\" new Preview field button\r\n\t\t\t\t\t\t\t\tRCView::div(array('class'=>'rtws_add_preview_field', 'style'=>'margin:4px 0 0 6px;'),\r\n\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>'plus_small2.png')) .\r\n\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'color:green;font-size:10px;text-decoration:underline;', 'onclick'=>\"addPreviewField();\"), \r\n\t\t\t\t\t\t\t\t\t\t$lang['ws_123']\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t)\r\n\t\t\t\t) .\r\n\t\t\t\t// Settings - Default Day Offset\r\n\t\t\t\tRCView::div(array('class'=>\"data\", 'style'=>'width:'.$tableWidth.'px;background-image:none;background-color:#eee;padding:10px;'),\r\n\t\t\t\t\tRCView::table(array('cellspacing'=>'0', 'style'=>'width:100%;table-layout:fixed;'),\r\n\t\t\t\t\t\tRCView::tr(array(),\r\n\t\t\t\t\t\t\tRCView::td(array('valign'=>'top', 'style'=>'width:450px;padding-right:30px;color:#555;line-height:13px;'),\r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'font-weight:bold;font-size:14px;color:#800000;line-height:14px;margin-bottom:5px;'),\r\n\t\t\t\t\t\t\t\t\t$lang['ws_124']\r\n\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'font-size:11px;line-height:11px;'),\r\n\t\t\t\t\t\t\t\t\t$lang['ws_125']\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::td(array('valign'=>'top', 'style'=>'padding-top:15px;'),\r\n\t\t\t\t\t\t\t\tRCView::span(array('style'=>'font-size:13px;font-weight:bold;margin-right:5px;'),\r\n\t\t\t\t\t\t\t\t\t$lang['ws_126']\r\n\t\t\t\t\t\t\t\t) . \r\n\t\t\t\t\t\t\t\t// Dropdown of day offset plus/minus\r\n\t\t\t\t\t\t\t\t\"<select name='rtws_offset_plusminus' style='font-size:12px;'>\r\n\t\t\t\t\t\t\t\t\t<option value='+-' \".($realtime_webservice_offset_plusminus == '+-' ? 'selected' : '').\">&plusmn;</option>\r\n\t\t\t\t\t\t\t\t\t<option value='+' \".($realtime_webservice_offset_plusminus == '+' ? 'selected' : '').\">+</option>\r\n\t\t\t\t\t\t\t\t\t<option value='-' \".($realtime_webservice_offset_plusminus == '-' ? 'selected' : '').\">-</option>\r\n\t\t\t\t\t\t\t\t</select>\" .\r\n\t\t\t\t\t\t\t\t// Text box for day offset value\r\n\t\t\t\t\t\t\t\tRCView::text(array('name'=>'rtws_offset_days', 'value'=>$realtime_webservice_offset_days, \r\n\t\t\t\t\t\t\t\t\t'onblur'=>\"redcap_validate(this,'\".self::DAY_OFFSET_MIN.\"','\".self::DAY_OFFSET_MAX.\"','hard','float')\", 'class'=>'', \r\n\t\t\t\t\t\t\t\t\t'style'=>'width:25px;font-size:12px;padding:0 3px;')) .\r\n\t\t\t\t\t\t\t\tRCView::span(array('style'=>'font-size:13px;'),\r\n\t\t\t\t\t\t\t\t\t$lang['scheduling_25']\r\n\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'margin:10px 0 0;color:#888;font-size:11px;'),\r\n\t\t\t\t\t\t\t\t\t$lang['ws_192'].\" \".self::DAY_OFFSET_MIN.\" \".$lang['ws_191'].\" \".self::DAY_OFFSET_MAX.\" \".$lang['scheduling_25']\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t)\r\n\t\t\t\t) .\r\n\t\t\t\t// Field-mapping header\r\n\t\t\t\tRCView::div(array('style'=>'margin-top:15px;width:'.$tableWidth.'px;font-weight:bold;color:#fff;border:1px solid #ccc;border-bottom:0;background-color:#555;padding:8px 10px;font-size:13px;'),\r\n\t\t\t\t\t$lang['ws_130']\r\n\t\t\t\t) .\r\n\t\t\t\t// Field-mapping table\r\n\t\t\t\tRCView::table(array('id'=>'src_fld_map_table', 'class'=>'form_border', \r\n\t\t\t\t\t\t\t\t'style'=>'border-bottom:1px solid #ccc;table-layout:fixed;width:'.($tableWidth+22).'px;'), $rows);\r\n\t\t// Add Save/Cancel buttons\r\n\t\tif (!empty($external_fields_all)) {\r\n\t\t\t$table .= RCView::div(array('style'=>'padding:30px 0;text-align:center;width:800px;'),\r\n\t\t\t\t\t\tRCView::hidden(array('name'=>'map_fields', 'value'=>'1')) . \r\n\t\t\t\t\t\tRCView::button(array('class'=>'jqbuttonmed', 'style'=>'font-size:14px;', 'id'=>'map_fields_btn', 'onclick'=>\"\r\n\t\t\t\t\t\t\t$(this).button('disable'); \r\n\t\t\t\t\t\t\t$('#rtws_mapping_cancel').css('visibility','hidden');\r\n\t\t\t\t\t\t\t$('#rtws_mapping_table').submit();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\"),\r\n\t\t\t\t\t\t\t$lang['ws_131']\r\n\t\t\t\t\t\t) . \r\n\t\t\t\t\t\tRCView::a(array('id'=>'rtws_mapping_cancel', 'href'=>'javascript:;', 'style'=>'margin-left:10px;text-decoration:underline;', 'onclick'=>\"window.location.href=app_path_webroot+'DynamicDataPull/setup.php?pid='+pid;\"), $lang['global_53'])\r\n\t\t\t\t\t);\r\n\t\t}\r\n\t\t// Set html to return\r\n\t\t$html = '';\r\n\t\t// Add \"add more source fields\" button\r\n\t\tif (isset($_POST['select_fields'])) {\r\n\t\t\t$html .= RCView::div(array('style'=>'width:'.$tableWidth.'px;margin:20px 0 5px;padding-top:10px;border-top:1px solid #ccc;'),\r\n\t\t\t\t\t\tRCView::div(array('style'=>'font-size:15px;font-weight:bold;padding-bottom:8px;margin-bottom:8px;'),\r\n\t\t\t\t\t\t\t$lang['ws_132']\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t$lang['ws_133']\r\n\t\t\t\t\t);\r\n\t\t} else {\r\n\t\t\t$html .= RCView::div(array('style'=>'padding:10px 0 5px;'),\r\n\t\t\t\t\t\tRCView::button(array('class'=>'jqbuttonmed', 'style'=>'font-size:13px;', 'onclick'=>\"confirmLeaveMappingChanges(modifiedMapping);\"), \r\n\t\t\t\t\t\t\tRCView::img(array('src'=>'add.png', 'style'=>'vertical-align:middle;')) .\r\n\t\t\t\t\t\t\tRCView::span(array('style'=>'vertical-align:middle;color:green;'), $lang['ws_134'])\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\t\t}\r\n\t\t// Add form html\r\n\t\t$html .= RCView::form(array('id'=>'rtws_mapping_table', 'method'=>'post', 'action'=>PAGE_FULL.\"?pid=\".$this->project_id, 'enctype'=>'multipart/form-data',\r\n\t\t\t\t'onsubmit'=>\"\r\n\t\t\t\tif (hasMappedAllSelections()) {\r\n\t\t\t\t\tcopyItemsManyToOneChildren();\r\n\t\t\t\t\treturn !hasDuplicateFieldMapping(); \r\n\t\t\t\t} else { \r\n\t\t\t\t\tsimpleDialog('\".cleanHtml($lang['ws_05']).\"');\r\n\t\t\t\t\tenableMappingSubmitBtn();\r\n\t\t\t\t\treturn false; \r\n\t\t\t\t}\",\r\n\t\t\t\t'style'=>'margin:20px 0 0;'), $table);\r\n\t\t// If there is any javascript for adding multi-event many-to-one mappings, then display it here\r\n\t\tif ($nonDisplayedManyToOneMappingsJs != '') {\r\n\t\t\t$html .= \"<script type='text/javascript'>$(function(){ $nonDisplayedManyToOneMappingsJs });</script>\";\r\n\t\t}\r\n\t\t// Return html\r\n\t\treturn $html;\r\n\t}", "public function get_all ();", "public function get_all () {\r\n\t\treturn $this->_data;\r\n\t}", "public function getFields(){ return $this->field_map; }", "public function get_fields()\n {\n $catalogue_name = get_param_string('catalogue_name', '');\n if ($catalogue_name == '') {\n return array();\n }\n return $this->_get_fields($catalogue_name);\n }" ]
[ "0.72350246", "0.71955043", "0.6927754", "0.6899743", "0.6876466", "0.6876466", "0.6876466", "0.6876466", "0.6876466", "0.6876466", "0.68613183", "0.68613183", "0.68613183", "0.66798764", "0.66798764", "0.66798764", "0.66798764", "0.66798764", "0.6653085", "0.66482925", "0.66482925", "0.65850335", "0.65563244", "0.65346813", "0.65132535", "0.64766425", "0.6397505", "0.6397099", "0.63893145", "0.62922394", "0.6246421", "0.6231237", "0.62271667", "0.6227082", "0.6227082", "0.6227082", "0.6204467", "0.6178425", "0.6153538", "0.61520296", "0.6134897", "0.6122573", "0.6084854", "0.6077145", "0.60678285", "0.6051956", "0.6050906", "0.60484433", "0.60365987", "0.60357136", "0.60310537", "0.603013", "0.59798306", "0.5960783", "0.59599894", "0.5948405", "0.59432894", "0.5939632", "0.5937698", "0.5935926", "0.59151715", "0.5914445", "0.59031945", "0.58996356", "0.589368", "0.5889871", "0.58731484", "0.5873031", "0.58624244", "0.58624244", "0.5859382", "0.5826299", "0.58201975", "0.5815437", "0.5798341", "0.57949007", "0.5786824", "0.5779433", "0.5779433", "0.57730204", "0.5770592", "0.5770592", "0.5770592", "0.5770592", "0.5770592", "0.5768581", "0.5768085", "0.57674986", "0.5764397", "0.57604426", "0.5757479", "0.5752392", "0.5749478", "0.5749296", "0.574642", "0.57459694", "0.57324106", "0.5730746", "0.57156676", "0.5712994" ]
0.6368214
29
Validate row data for replace behaviour
public function validateRowForReplace(array $rowData, $rowNumber) { $this->validateRowForDelete($rowData, $rowNumber); $this->validateRowForUpdate($rowData, $rowNumber); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrub_row (&$row) {\n\t\t//\twith people filling in fields with things like\n\t\t//\t\"N/A\" or \"XX\".\n\t\t//\n\t\t//\tFix this\n\t\tforeach ($row as &$value) {\n\t\t\n\t\t\tif (is_null($value)) continue;\n\t\t\n\t\t\tif (\n\t\t\t\t//\tMatch \"N/A\" and variants\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*n\\/?a\\\\s*$/ui',\n\t\t\t\t\t$value\n\t\t\t\t)!==0) ||\n\t\t\t\t//\tAt least one column in one\n\t\t\t\t//\trow just has the content\n\t\t\t\t//\t\"a\"\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*a\\\\s*$/ui',\n\t\t\t\t\t$value\n\t\t\t\t)!==0) ||\n\t\t\t\t//\tThere are rows in columns with\n\t\t\t\t//\t\"XX\" or \"xx\" or \"xxcx\".\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*(?:x|c)+\\\\s*$/ui',\n\t\t\t\t\t$value\n\t\t\t\t)!==0) ||\n\t\t\t\t//\tWhile we're at it let's clobber\n\t\t\t\t//\tentries that are just whitespace\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*$/u',\n\t\t\t\t\t$value\n\t\t\t\t)!==0)\n\t\t\t) $value=null;\t//\tThe proper way to do things\n\t\t\t//\tFor sanity's sake let's just make\n\t\t\t//\tsure all the data is trimmed\n\t\t\telse $value=preg_replace(\n\t\t\t\t'/^\\\\s+|\\\\s+$/u',\n\t\t\t\t'',\n\t\t\t\t$value\n\t\t\t);\n\t\t\n\t\t}\n\t\n\t}", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "function checkValues($row,&$data,$insert,$from_update=false) {\n global $Language;\n $hp = Codendi_HTMLPurifier::instance();\n for ($c=0; $c < count($this->parsed_labels); $c++) {\n $label = $this->parsed_labels[$c];\n $val = $data[$c];\n $field = $this->used_fields[$label];\n if ($field) $field_name = $field->getName();\n \n // check if val in predefined vals (if applicable)\n unset($predef_vals);\n if (isset($this->predefined_values[$c])) {$predef_vals = $this->predefined_values[$c];}\n if (isset($predef_vals)) {\n\tif (!$this->checkPredefinedValues($field,$field_name,$label,$val,$predef_vals,$row,$data)) {\n\t return false;\n\t}\n }\n \n // check whether we specify None for a field which is mandatory\n if ($field && !$field->isEmptyOk() &&\n\t $field_name != \"artifact_id\") {\n\tif ($field_name == \"submitted_by\" ||\n\t $field_name == \"open_date\") {\n\t //submitted on and submitted by are accepted as \"\" on inserts and\n\t //we put time() importing user as default\n\t} else {\n\t \n\t $is_empty = ( ($field->isSelectBox() || $field->isMultiSelectBox()) ? ($val==$Language->getText('global','none')) : ($val==''));\n\n\t if ($is_empty) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_current',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML),\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t}\n }\n \n // for date fields: check format\n if ($field && $field->isDateField()) {\n\tif ($field_name == \"open_date\" && $val == \"\") {\n\t //is ok.\n\t} else {\n\t \n\t if ($val == \"-\" || $val == \"\") {\n\t //ok. transform it by hand into 0 before updating db\n\t $data[$c] = \"\";\n\t } else {\n\t list($unix_time,$ok) = util_importdatefmt_to_unixtime($val);\n\t if (!$ok) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','incorrect_date',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t $date = format_date(\"Y-m-d\",$unix_time);\n\t $data[$c] = $date;\n\t }\n\t}\n }\n } // end of for parsed_labels\n\n\n if (!$insert && $label == $this->lbl_list['follow_ups']) {\n /* check whether we need to remove known follow-ups */\n \n }\n \n // if we come from update case ( column tracker_id is specified but for this concrete artifact no aid is given)\n // we have to check whether all mandatory fields are specified and not empty\n if ($from_update) {\n\n \n while (list($label,$field) = each($this->used_fields)) {\n\tif ($field) $field_name = $field->getName();\n\t\n\tif ($field) {\n if ($field_name != \"artifact_id\" &&\n $field_name != \"open_date\" &&\n $field_name != \"submitted_by\" &&\n $label != $this->lbl_list['follow_ups'] &&\n $label != $this->lbl_list['is_dependent_on'] &&\n $label != $this->lbl_list['add_cc'] &&\n $label != $this->lbl_list['cc_comment'] &&\n !$field->isEmptyOk() && !in_array($label,$this->parsed_labels)) {\n\t \n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_line',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n }\n\t}\n }\n \n \n }//end from_update\n \n return true;\n }", "private function validateRowData($rowData)\n\t{\n\t\t$validationData = array();\n\t\t$validationData[self::COL_STUDENT_NR] = $rowData[0];\n\t\t$validationData[self::COL_FIRSTNAME] = $rowData[1];\n\t\t$validationData[self::COL_LASTNAME] = $rowData[2];\n\t\t$validationData[self::COL_EMAIL] = $rowData[3];\n\n\t\t$validator = Validator::make($validationData, [\n\t\t\t self::COL_STUDENT_NR => 'required|integer',\n\t\t\t self::COL_FIRSTNAME => 'required|string',\n\t\t\t self::COL_LASTNAME => 'required|string',\n\t\t\t self::COL_EMAIL => 'required|email'\n\t\t]);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn $validator->errors();\n\t\t}\n\n\t\treturn null;\n\t}", "abstract public function validateData();", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "function validateRow($row) { \n \n if(!$this->fields) {\n return $row;\n }\n \n $return = [];\n foreach($this->fields as $key => $field) {\n $return[$key] = $this->validateField($row, $key);\n }\n return $return;\n }", "public function validRowForSave($row) {\n\n $params = $this->_request->getParams();\n $table = $params['table'];\n //-----------------------\n // Проверим строку на валидность\n $jsons = $this->_isValidRow($row);\n if (isset($jsons['class_message'])) { // Ошибка валидации\n return $jsons;\n }\n\n // Проверка валидации особых случаев\n if ($table == 'admin.blog_posts_tags') {\n $params = array();\n $params['table'] = 'blog_posts_tags';\n $params['fieldKey1'] = 'post_id';\n $params['fieldKey2'] = 'tag';\n $params['adapter'] = $this->db;\n $params['id'] = $row['id'];\n\n $validator = new Default_Form_Validate_DbMultipleKey($params);\n $value = $row['post_id'] . ';' . $row['tag'];\n if (!$validator->isValid($value)) {\n $messages = $validator->getMessages();\n $newMess = array();\n $newMess[] = '<em>' . Zend_Registry::get('Zend_Translate')->_('Ошибка формы! Неверно введены данные в форму.') . '</em>';\n $messages = array_values($messages);\n $newMess[] = $messages[0];\n $jsons = array(\n 'class_message' => 'warning',\n 'messages' => $newMess\n );\n }\n }\n\n return $jsons;\n }", "abstract public function validateData($data);", "protected function _validateRowForUpdate(array $rowData, $rowNumber)\n {\n $multiSeparator = $this->getMultipleValueSeparator();\n if ($this->_checkUniqueKey($rowData, $rowNumber)) {\n $email = strtolower($rowData[self::COLUMN_EMAIL]);\n $website = $rowData[self::COLUMN_WEBSITE];\n $addressId = $rowData[self::COLUMN_ADDRESS_ID];\n $customerId = $this->_getCustomerId($email, $website);\n\n if ($customerId === false) {\n $this->addRowError(self::ERROR_CUSTOMER_NOT_FOUND, $rowNumber);\n } else {\n if ($this->_checkRowDuplicate($customerId, $addressId)) {\n $this->addRowError(self::ERROR_DUPLICATE_PK, $rowNumber);\n } else {\n // check simple attributes\n foreach ($this->_attributes as $attributeCode => $attributeParams) {\n $websiteId = $this->_websiteCodeToId[$website];\n $attributeParams = $this->adjustAttributeDataForWebsite($attributeParams, $websiteId);\n\n if (in_array($attributeCode, $this->_ignoredAttributes)) {\n continue;\n }\n if (isset($rowData[$attributeCode]) && strlen($rowData[$attributeCode])) {\n $this->isAttributeValid(\n $attributeCode,\n $attributeParams,\n $rowData,\n $rowNumber,\n $multiSeparator\n );\n } elseif ($attributeParams['is_required']\n && !$this->addressStorage->doesExist(\n (string)$addressId,\n (string)$customerId\n )\n ) {\n $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNumber, $attributeCode);\n }\n }\n\n if (isset($rowData[self::COLUMN_POSTCODE])\n && isset($rowData[self::COLUMN_COUNTRY_ID])\n && !$this->postcodeValidator->isValid(\n $rowData[self::COLUMN_COUNTRY_ID],\n $rowData[self::COLUMN_POSTCODE]\n )\n ) {\n $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNumber, self::COLUMN_POSTCODE);\n }\n\n if (isset($rowData[self::COLUMN_COUNTRY_ID]) && isset($rowData[self::COLUMN_REGION])) {\n $countryRegions = isset(\n $this->_countryRegions[strtolower($rowData[self::COLUMN_COUNTRY_ID])]\n ) ? $this->_countryRegions[strtolower(\n $rowData[self::COLUMN_COUNTRY_ID]\n )] : [];\n\n if (!empty($rowData[self::COLUMN_REGION]) && !empty($countryRegions) && !isset(\n $countryRegions[strtolower($rowData[self::COLUMN_REGION])]\n )\n ) {\n $this->addRowError(self::ERROR_INVALID_REGION, $rowNumber, self::COLUMN_REGION);\n }\n }\n }\n }\n }\n }", "function ValidRow($row) {\n\t$ValidRow = TRUE;\n\treturn $ValidRow;\n}", "private function validRow($arrRows) {\n\t\t$arrErrors = array();\n\t\t$error = \"\";\n\t\tforeach ($arrRows as $key => $strRow) {\n\t\t\t$lineError = $key + 1;\n\t\t\t$validARow = $this->validARow($strRow, ($lineError));\n\t\t\t//if (is_string($validARow) && Core_Util_Helper::isNotEmpty($validARow)) {\n\t\t\tif (count($validARow) > 0) {\n\t\t\t\t//$error .= $validARow . \"<br />\";\n\t\t\t\t$arrErrors[] = $lineError;\n\t\t\t}\n\t\t}\n// \t\tif (Core_Util_Helper::isEmpty($error)) {\n// \t\t\treturn true;\n// \t\t} else {\n// \t\t\t//Core_Util_LocalLog::writeLog(\"validRow return \" . $error);\n// \t\t\treturn $error;\n// \t\t}\n\t\treturn $arrErrors;\n\t}", "private function convert_and_validate_rows(){\n\n // convert string to an array\n $this->sudoku_array = explode(' ', $this->sudoku_string);\n\n if(count($this->sudoku_array) != 9){\n return false;\n }\n\n // convert each string array to digits array\n foreach($this->sudoku_array as &$row){\n $row = str_split($row);\n\n // check if the row if valid\n if(count($row) != 9 || count(array_unique($row)) !=9){\n return false;\n }\n }\n\n return true;\n }", "public function validateData($data): void;", "private function checkGridRows(array $rowData)\n {\n # Check first if data key exists on passed row data array.\n if (array_key_exists('data', $rowData) === true) {\n $rowArr = $rowData['data'];\n foreach ($rowArr as $column => $cell) {\n # Check if the cell variable is array or not, and then convert the cell value.\n if (is_array($cell) === true and array_key_exists('value', $cell) === true) {\n $cell['value'] = $this->doConvertBrToNl($cell['value']);\n } else {\n $cell = $this->doConvertBrToNl($cell);\n }\n $rowData['data'][$column] = $cell;\n }\n }\n # Return the row data.\n return $rowData;\n }", "public function applySchemaToData(array $row): array\n {\n // Iterating over each field of the row and checking in configuration metadata what are the rules\n foreach ($row as $fieldName => &$value) {\n // If no requirement was given for this field, we go next\n if (empty($this->configuration[$fieldName])) {\n continue;\n }\n\n // Retrieving requirements for this fieldName\n $requirements = $this->configuration[$fieldName];\n\n // If value is empty and it is NOT allowed by metadata\n if ($value === '' && empty($requirements['optional'])) {\n throw new ValidationException(sprintf(\n \"The field '%s' can not be empty ! Consider fixing your data or fixing schema with : '%s=?%s'\",\n $fieldName,\n $fieldName,\n $requirements['type']\n ));\n }\n\n // If value is empty but it is allowed by metadata\n if ($value === '' && $requirements['optional'] === true) {\n // Replacing the value by NULL and go next\n $value = null;\n continue;\n }\n\n // We don't know what validator should take responsibility for the $value\n $typeValidator = null;\n\n // Let's find out !\n foreach ($this->validators as $validator) {\n if ($validator->supports($requirements['type'])) {\n $typeValidator = $validator;\n break;\n }\n }\n\n // If we did not found any validator for the $value\n if (!$typeValidator) {\n throw new ValidationException(sprintf(\n \"No validator class was found for type '%s' ! You should create a '%s' class to support it or maybe it already exists but was not added to Validators ! 👍\",\n $requirements['type'],\n 'App\\\\Validation\\\\Validator\\\\' . ucfirst($requirements['type']) . 'Validator'\n ));\n }\n\n // We validate the value and if it does not match with rules .. 💣\n if (!$typeValidator->validate($value)) {\n throw new ValidationException(sprintf(\n \"The field '%s' with value '%s' does not match requirements type '%s' !\",\n $fieldName,\n $value,\n $requirements['type']\n ));\n }\n }\n\n // We return the row because after validation of its values, some of them could have change !\n return $row;\n }", "private function array_validator(array $data)\n {\n if (!array_key_exists(0, $data))\n {\n $this->is_valid = false;\n return false;\n }\n\n if ($data[0] === false)\n {\n $this->is_empty = true;\n return false;\n }\n\n if (!is_array($data[0]))\n {\n // 1 dimensional data -- diverge from typical here to\n // function for 1 dimensional data?\n }\n\n $this->columns = $this->set_columns(array_keys($data[0]));\n \n if (empty($this->columns))\n {\n $this->is_empty = false;\n return false;\n }\n\n $this->set_number_of_columns(count($this->columns));\n $number_of_rows = 0;\n\n foreach ($data as $row)\n {\n ++$number_of_rows;\n if (count(array_keys($row)) > $this->number_of_columns)\n {\n // invalid data\n // data must have same number of columns throughout.\n // although, there is a desgin decision here: it is possible\n // that this ought to be considered valid data, and a filling\n // of the data could be performed... *thinking on that*\n }\n \n foreach ($this->columns as $key)\n {\n if (!array_key_exists($key, $row))\n {\n // invalid data? or possibly same decison as above\n // and fill the data...\n }\n }\n }\n\n $this->set_number_of_rows($number_of_rows);\n\n // valid array. from here, either pass $data to a building function\n // or simply say $this->data = $data. unsure of design yet.\n }", "public function verifyRow(array $rowData): void\n {\n foreach (self::$stockItemAttributes as $stockItemAttribute) {\n $this->assertNotSame(\n '',\n $rowData[$stockItemAttribute],\n \"Stock item attribute {$stockItemAttribute} value is empty string\"\n );\n }\n }", "function isDataValid() \n {\n return true;\n }", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "abstract protected function validate($data);", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "protected function sanitizeRow (array &$row)\n\t{\n\t\tif (strlen($row['short_description']) > 500) {\n\t\t\t$row['short_description'] = substr($row['short_description'], 0, 497) . '...';\n\t\t}\n\t\tif (strlen($row['description']) > 2000) {\n\t\t\t$row['description'] = substr($row['description'], 0, 1997) . '...';\n\t\t}\n\t\tif (strlen($row['keywords'])) {\n\t\t\t$keywords = array();\n\t\t\t$split = preg_split('/[\\n,]/', $row['keywords']);\n\t\t\tforeach ($split as $keyword) {\n\t\t\t\t$keyword = trim($keyword);\n\t\t\t\tif ($keyword) {\n\t\t\t\t\t$keywords[] = $keyword;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$row['keywords'] = implode(self::SEPARATOR, $keywords);\n\t\t}\n\t\tforeach ($row as &$field) {\n\t\t\t$field = str_replace('&nbsp;', ' ', $field);\n\t\t\t$field = preg_replace('/[|\\n\\r]/', '', $field);\n\t\t}\n\t}", "public function validateData(array $data) {\n\t\t$num_cols = null;\n\t\tforeach ($data as $row) {\n\t\t\tif (!is_array($row)) {\n\t\t\t\tthrow new Matrix\\Exception\\InvalidDataException(\"A row contained in the data is not an array\");\n\t\t\t}\n\n\t\t\tif (is_null($num_cols)) {\n\t\t\t\t$num_cols = count($row);\n\t\t\t}\n\n\t\t\tif (count($row) == 0) {\n\t\t\t\tthrow new Matrix\\Exception\\InvalidDataException(\"Data is empty (no data in columns)\");\n\t\t\t}\n\n\t\t\tif ($num_cols != count($row)) {\n\t\t\t\tthrow new Matrix\\Exception\\InvalidDataException(\"Rows in data array are not all of the same size\");\n\t\t\t}\n\n\t\t\tforeach ($row as $value) {\n\t\t\t\tif (!is_numeric($value)) {\n\t\t\t\t\tthrow new Matrix\\Exception\\NotNumericException(\"Values in the matrix are not all of numeric type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function sanitizeRow (array &$row)\n\t{\n\t\tif (!empty($row['title']) && strlen($row['title']) > 100) {\n\t\t\t$row['title'] = substr($row['title'], 0, 97) . '...';\n\t\t}\n\t\tif (!empty($row['description']) && strlen($row['description']) > 8000) {\n\t\t\t$row['description'] = substr($row['description'], 0, 7997) . '...';\n\t\t}\n\t\tif (!empty($row['features']) && strlen($row['features'])) {\n\t\t\t$features = array();\n\t\t\t$split = preg_split('/[\\n]/', strip_tags($row['features']));\n\t\t\tforeach ($split as $feature) {\n\t\t\t\t$feature = trim($feature);\n\t\t\t\tif (strlen($feature)) {\n\t\t\t\t\tif (strlen($feature) > 250) {\n\t\t\t\t\t\t$feature = substr($feature, 0, 247) . '...';\n\t\t\t\t\t}\n\t\t\t\t\t$features[] = $feature;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$row['features'] = implode(self::SEPARATOR, $features);\n\t\t}\n\t\tif (!empty($row['mfg_name'])) {\n\t\t\t$row['mfg_name'] = preg_replace('/[^A-Za-z0-9_\\s]/', '', $row['mfg_name']); // non-alpha numeric chars not supported\n\t\t}\n\t\tif (!empty($row['keywords']) && strlen($row['keywords'])) {\n\t\t\t$keywords = array();\n\t\t\t$split = preg_split('/[\\n,]/', $row['keywords']);\n\t\t\tforeach ($split as $keyword) {\n\t\t\t\t$keyword = trim($keyword);\n\t\t\t\tif ((strlen(implode(self::SEPARATOR, $keywords)) + strlen($keyword)) > 250) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($keyword && strlen($keyword) <= 40) {\n\t\t\t\t\t$keywords[] = $keyword;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$row['keywords'] = implode(self::SEPARATOR, $keywords);\n\t\t}\n\t\t\n\t\t$searches = array('&nbsp;','á','à','â','ã','ª','ä','å','Á','À','Â','Ã','Ä','é','è','ê','ë','É','È','Ê','Ë','í','ì','î','ï','Í','Ì','Î','Ï','œ','ò','ó','ô','õ','º','ø','Ø','Ó','Ò','Ô','Õ','ú','ù','û','Ú','Ù','Û','ç','Ç','Ñ','ñ');\n\t\t$replacements = array(' ','a','a','a','a','a','a','a','A','A','A','A','A','e','e','e','e','E','E','E','E','i','i','i','i','I','I','I','I','oe','o','o','o','o','o','o','O','O','O','O','O','u','u','u','U','U','U','c','C','N','n');\n\t\t\n\t\tforeach ($row as &$field) {\n\t\t\tif (is_scalar($field)) {\n\t\t\t\t$field = str_replace($searches, $replacements, $field);\n\t\t\t\t$field = preg_replace('/[\\t\\n\\r]/', '', $field);\n\t\t\t}\n\t\t}\n\t}", "function tt_validate_upload_columns(csv_import_reader $cir, $stdfields, moodle_url $returnurl) {\n $columns = $cir->get_columns();\n\n if (empty($columns)) {\n $cir->close();\n $cir->cleanup();\n print_error('cannotreadtmpfile', 'error', $returnurl);\n }\n if (count($columns) < 2) {\n $cir->close();\n $cir->cleanup();\n print_error('csvfewcolumns', 'error', $returnurl);\n }\n\n // test columns\n $processed = array();\n foreach ($columns as $key=>$unused) {\n $field = $columns[$key];\n $lcfield = textlib::strtolower($field);\n if (in_array($field, $stdfields) or in_array($lcfield, $stdfields)) {\n // standard fields are only lowercase\n $newfield = $lcfield;\n } else {\n $cir->close();\n $cir->cleanup();\n print_error('invalidfieldname', 'error', $returnurl, $field);\n }\n if (in_array($newfield, $processed)) {\n $cir->close();\n $cir->cleanup();\n print_error('duplicatefieldname', 'error', $returnurl, $newfield);\n }\n $processed[$key] = $newfield;\n }\n return $processed;\n}", "private function hasValidFormat(array $keys, &$row): bool \n {\n $outcome = true;\n foreach($keys as $key) {\n if( $this->isColumnUnset($key, $row)){\n \n $outcome = false;\n break;\n }\n }\n return $outcome;\n }", "public function validateRowForUpdate(array $rowData, $rowNumber)\n {\n if (!empty($rowData['conditions_serialized'])) {\n $conditions = $this->serializer->unserialize($rowData['conditions_serialized']);\n if (is_array($conditions)) {\n $this->validateConditions($conditions, $rowNumber);\n } else {\n $errorMessage = __('invalid conditions serialized.');\n $this->addRowError($errorMessage, $rowNumber);\n }\n }\n\n if (!empty($rowData['actions_serialized'])) {\n $actions = $this->serializer->unserialize($rowData['actions_serialized']);\n if (is_array($actions)) {\n $this->validateActions($actions, $rowNumber);\n } else {\n $errorMessage = __('invalid actions serialized.');\n $this->addRowError($errorMessage, $rowNumber);\n }\n }\n }", "private function validRow($arrayToCheck) {\n if (isset($arrayToCheck) && !empty($arrayToCheck)) {\n //check number values\n if (count($arrayToCheck) == COUNT_VALUES) {\n //check values needed to put in database\n \n //Check subscriber\n if (!intval($arrayToCheck[2])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Subscriber is not an integer'\n );\n return false;\n }\n\n //Check date\n list($day, $month, $year) = explode('/', $arrayToCheck[3]);\n if(!checkdate($month,$day,$year)) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Date is wrong'\n );\n return false;\n }\n\n //Check hour\n if (!preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[4])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Time is wrong'\n );\n return false;\n }\n\n //Check Consumption\n if (preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[5])) {\n $type = 'call';\n $parsed = date_parse($arrayToCheck[5]);\n $consumption = $parsed['hour'] * 3600 + $parsed['minute'] * 60 + $parsed['second'];\n }\n elseif ($arrayToCheck[6] == '0.0' || intval($arrayToCheck[6])) {\n $type = 'data';\n $consumption = intval($arrayToCheck[6]);\n }\n elseif ($arrayToCheck[5]=='' || $arrayToCheck[6]=='') {\n $type = 'sms';\n $consumption = '';\n }\n else {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Consumption values are not good'\n );\n return false;\n }\n\n //return array to insert in database \n //array(subscriber, datetime, consumption, $type)\n $date = date(\"Y-m-d H:i:s\", strtotime(str_replace('/', '-', $arrayToCheck[3]).' '.$arrayToCheck[4]));\n return array(\n 'subscriber' => $arrayToCheck[2],\n 'date' => $date,\n 'consumption' => $consumption,\n 'type' => $type);\n } \n else\n return false;\n }\n else {\n return false;\n }\n }", "function check_replacement ($conn,$data, $final_valid, $defected) {\n\n\tif ($final_valid == \"YES\" AND $defected == \"Defected\") {\n\t\treturn \"VALID\";\n\t}\n\telse {\n\t return \"INVALID\" ; \n\t}\n}", "function tableValidator( &$errors, &$warnings, &$excel, &$lang ){\n $valid = 0;\n for( $col = 1; $col <= $excel->numCols(); $col++ ) {\n if( empty($excel->valueAt( 1, $col )) ){\n for( $row = 2; $row <= $excel->numRows(); $row++ ){\n if( $excel->valueAt( $row, $col) !== '' ){\n array_push( $warnings, sprintf( $lang['xlsimport_warning_column_without_name'], chr( $col + 64 )) );\n $row = $excel->numRows();\n $valid = 1;\n }\n }\n }else{\n for( $comp_col = ($col + 1); $comp_col <= $excel->numCols(); $comp_col++ ) {\n if($excel->valueAt( 1, $col ) === $excel->valueAt( 1, $comp_col )){\n array_push( $errors, sprintf( $lang['xlsimport_warning_colname_duplicate'], chr( $col + 64 ), chr( $comp_col + 64 )));\n $valid = 2;\n }\n }\n }\n }\n return $valid;\n}", "public function isDataValid(): bool;", "protected function _checkRowData($importData) {\n if (empty($importData['sku'])) {\n $message = Mage::helper('catalog')->__('Skipping import row, required field \"%s\" is not defined.', 'sku');\n Mage::throwException($message);\n }\n }", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\tif ($this->Supplier_Number->CurrentValue <> \"\") { // Check field with unique index\n\t\t\t$sFilterChk = \"(`Supplier_Number` = '\" . ew_AdjustSql($this->Supplier_Number->CurrentValue, $this->DBID) . \"')\";\n\t\t\t$sFilterChk .= \" AND NOT (\" . $sFilter . \")\";\n\t\t\t$this->CurrentFilter = $sFilterChk;\n\t\t\t$sSqlChk = $this->SQL();\n\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t\t$rsChk = $conn->Execute($sSqlChk);\n\t\t\t$conn->raiseErrorFn = '';\n\t\t\tif ($rsChk === FALSE) {\n\t\t\t\treturn FALSE;\n\t\t\t} elseif (!$rsChk->EOF) {\n\t\t\t\t$sIdxErrMsg = str_replace(\"%f\", $this->Supplier_Number->FldCaption(), $Language->Phrase(\"DupIndex\"));\n\t\t\t\t$sIdxErrMsg = str_replace(\"%v\", $this->Supplier_Number->CurrentValue, $sIdxErrMsg);\n\t\t\t\t$this->setFailureMessage($sIdxErrMsg);\n\t\t\t\t$rsChk->Close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$rsChk->Close();\n\t\t}\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Begin transaction\n\t\t\tif ($this->getCurrentDetailTable() <> \"\")\n\t\t\t\t$conn->BeginTrans();\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$rsnew = array();\n\n\t\t\t// Supplier_Number\n\t\t\t$this->Supplier_Number->SetDbValueDef($rsnew, $this->Supplier_Number->CurrentValue, \"\", $this->Supplier_Number->ReadOnly);\n\n\t\t\t// Supplier_Name\n\t\t\t$this->Supplier_Name->SetDbValueDef($rsnew, $this->Supplier_Name->CurrentValue, \"\", $this->Supplier_Name->ReadOnly);\n\n\t\t\t// Address\n\t\t\t$this->Address->SetDbValueDef($rsnew, $this->Address->CurrentValue, \"\", $this->Address->ReadOnly);\n\n\t\t\t// City\n\t\t\t$this->City->SetDbValueDef($rsnew, $this->City->CurrentValue, \"\", $this->City->ReadOnly);\n\n\t\t\t// Country\n\t\t\t$this->Country->SetDbValueDef($rsnew, $this->Country->CurrentValue, \"\", $this->Country->ReadOnly);\n\n\t\t\t// Contact_Person\n\t\t\t$this->Contact_Person->SetDbValueDef($rsnew, $this->Contact_Person->CurrentValue, \"\", $this->Contact_Person->ReadOnly);\n\n\t\t\t// Phone_Number\n\t\t\t$this->Phone_Number->SetDbValueDef($rsnew, $this->Phone_Number->CurrentValue, \"\", $this->Phone_Number->ReadOnly);\n\n\t\t\t// Email\n\t\t\t$this->_Email->SetDbValueDef($rsnew, $this->_Email->CurrentValue, \"\", $this->_Email->ReadOnly);\n\n\t\t\t// Mobile_Number\n\t\t\t$this->Mobile_Number->SetDbValueDef($rsnew, $this->Mobile_Number->CurrentValue, \"\", $this->Mobile_Number->ReadOnly);\n\n\t\t\t// Notes\n\t\t\t$this->Notes->SetDbValueDef($rsnew, $this->Notes->CurrentValue, \"\", $this->Notes->ReadOnly);\n\n\t\t\t// Balance\n\t\t\t$this->Balance->SetDbValueDef($rsnew, $this->Balance->CurrentValue, NULL, $this->Balance->ReadOnly);\n\n\t\t\t// Is_Stock_Available\n\t\t\t$this->Is_Stock_Available->SetDbValueDef($rsnew, ((strval($this->Is_Stock_Available->CurrentValue) == \"Y\") ? \"Y\" : \"N\"), \"N\", $this->Is_Stock_Available->ReadOnly);\n\n\t\t\t// Date_Added\n\t\t\t$this->Date_Added->SetDbValueDef($rsnew, $this->Date_Added->CurrentValue, NULL, $this->Date_Added->ReadOnly);\n\n\t\t\t// Added_By\n\t\t\t$this->Added_By->SetDbValueDef($rsnew, $this->Added_By->CurrentValue, NULL, $this->Added_By->ReadOnly);\n\n\t\t\t// Date_Updated\n\t\t\t$this->Date_Updated->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['Date_Updated'] = &$this->Date_Updated->DbValue;\n\n\t\t\t// Updated_By\n\t\t\t$this->Updated_By->SetDbValueDef($rsnew, CurrentUserName(), NULL);\n\t\t\t$rsnew['Updated_By'] = &$this->Updated_By->DbValue;\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t}\n\n\t\t\t\t// Update detail records\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\t$DetailTblVar = explode(\",\", $this->getCurrentDetailTable());\n\t\t\t\t\tif (in_array(\"a_purchases\", $DetailTblVar) && $GLOBALS[\"a_purchases\"]->DetailEdit) {\n\t\t\t\t\t\tif (!isset($GLOBALS[\"a_purchases_grid\"])) $GLOBALS[\"a_purchases_grid\"] = new ca_purchases_grid(); // Get detail page object\n\t\t\t\t\t\t$EditRow = $GLOBALS[\"a_purchases_grid\"]->GridUpdate();\n\t\t\t\t\t}\n\t\t\t\t\tif (in_array(\"a_stock_items\", $DetailTblVar) && $GLOBALS[\"a_stock_items\"]->DetailEdit) {\n\t\t\t\t\t\tif (!isset($GLOBALS[\"a_stock_items_grid\"])) $GLOBALS[\"a_stock_items_grid\"] = new ca_stock_items_grid(); // Get detail page object\n\t\t\t\t\t\t$EditRow = $GLOBALS[\"a_stock_items_grid\"]->GridUpdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Commit/Rollback transaction\n\t\t\t\tif ($this->getCurrentDetailTable() <> \"\") {\n\t\t\t\t\tif ($EditRow) {\n\t\t\t\t\t\t$conn->CommitTrans(); // Commit transaction\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$conn->RollbackTrans(); // Rollback transaction\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "public function insertRowCheckInjections($table, $row)\r\n {\r\n \r\n $array = $row;\r\n if (!is_array($array)) {\r\n $array = json_decode($row);\r\n }\r\n $count = 0;\r\n $columns_str = \"\";\r\n $values_str = \"\";\r\n $values_arr = array();\r\n $param_type = \"\"; //array();\r\n \r\n if (count($array) ==0) {\r\n array_push($this->error, \"Post does not contain any data!\");\r\n return false;\r\n }\r\n\r\n //check if any post data is not a valid column_name:\r\n $all_columns = $this->getRows(\"SHOW COLUMNS FROM $table \", true);\r\n $table_columns = array();\r\n foreach ($all_columns as $col_row) {\r\n $col_name = $col_row[\"Field\"];\r\n array_push($table_columns, $col_name);\r\n }\r\n $posted_columns = array_keys($array);\r\n foreach ($posted_columns as $posted_column) {\r\n if (!in_array($posted_column, $table_columns)) {\r\n array_push($this->error, \"field: $posted_column is not in table: $table\");\r\n return false;\r\n }\r\n }\r\n $required_columns = array();\r\n foreach ($all_columns as $col_row) {\r\n if ($col_row[\"Extra\"] != \"auto_increment\" && (is_null($col_row[\"Default\"])) && $col_row[\"Null\"] == \"NO\") {\r\n $col_name = $col_row[\"Field\"];\r\n if (!in_array($col_name, $posted_columns)) {\r\n array_push($required_columns, $col_name);\r\n }\r\n }\r\n }\r\n if (count($required_columns)>0) {\r\n $str_columns = \"\";\r\n foreach ($required_columns as $col) {\r\n $str_columns.=$col.\",\";\r\n }\r\n $str_columns = substr($str_columns, 0, strlen($str_columns)-1);\r\n array_push($this->error, \"Required to post: \".$str_columns.\" in table $table .\");\r\n return false;\r\n }\r\n\r\n foreach ($array as $key => $value) {\r\n $count+=1;\r\n $columns_str .= \",\".$key;\r\n $values_str .= \", ?\";\r\n array_push($values_arr, $value);\r\n $param_type .= \"s\";\r\n }\r\n $columns_str = substr($columns_str, 1);\r\n $values_str = substr($values_str, 2);\r\n $sql = \"insert into \".$table.\"(\".$columns_str.\") values (\".$values_str.\")\";\r\n $this->sql_statement = $sql;\r\n $stmt = $this->conn->prepare($sql);\r\n\r\n $a_params = array();\r\n array_push($a_params, $param_type);\r\n foreach ($values_arr as $singleValue) {\r\n array_push($a_params, $singleValue);\r\n }\r\n \r\n //echo json_encode($a_params);\r\n\r\n \r\n if (!$stmt) {\r\n array_push($this->error, \"insertRow: Error in preparing statement (\".$sql.\") \\n\".$this->conn->error);\r\n return false;\r\n } else {\r\n //bind with bind_param to avoid sql injections\r\n call_user_func_array(array($stmt, 'bind_param'), $this->refValues($a_params));\r\n $result = $stmt->execute();\r\n //$ins_stmt = $result->store_result();\r\n $count = $this->getConn()->affected_rows;\r\n $this->rowCount = $count;\r\n $this->pk_code = mysqli_insert_id($this->getConn());\r\n $stmt->close();\r\n\r\n //getting the primary key columns:\r\n $pk_columns = $this->getRows(\"SHOW KEYS FROM $table WHERE Key_name = 'PRIMARY'\", true);\r\n $pk_where = \"\";\r\n $i = 0;\r\n foreach ($pk_columns as $pkRow) {\r\n $pk_column = $pkRow['Column_name'];\r\n if (strlen($pk_where) > 0) {\r\n $pk_where .= \" and \";\r\n }\r\n $pk_value = $this->pk_code;\r\n if (is_array($pk_value)) {\r\n $pk_value = $pk_value[$i];\r\n }\r\n $pk_where .= $pk_column.\"='\".$pk_value.\"'\" ;\r\n $i++;\r\n }\r\n $result_row = $this->getRows(\"select * from $table WHERE $pk_where\", true);\r\n return $result_row;\r\n }\r\n }", "final private function sanitzeRow($i,$j){\n\t\tif(@$k = $this->checkRow($i,$j) and @!$this->markspan[$i][$j]){\n\n\t\t\t$k =$k- 1;\n\n\t\t\t//check colspan at rowpan\n\t\t\t$span = (int) @$this->contents[$k]->contents[$j]->attrs['colspan'];\n\t\t\tfor ($a = $j; $a <$j + $span; $a++){\n\t\t\t\tif ($this->checkCol($k,$a)){\n\t\t\t\t\t@$move = $this->contents[$i]->contents[$a]->contents;\n\t\t\t\t\tif (is_array($move))\n\t\t\t\t\t\tforeach($move as $v) $this->cellContent($i,$j,$v);\n\n\t\t\t\t\t$this->markspan[$i][$a] = true;//\n\t\t\t\t\t$this->contents[$i]->contents[$a] = '';\n\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t@$move = $this->contents[$i]->contents[$j]->contents;\n\t\t\tif (is_array($move))\n\t\t\t\tforeach($move as $v)\n\t\t\t\t$this->cellContent($k,$j,$v);\n\n\t\t\t$this->markspan[$i][$j] = true;///\n\t\t\t$this->contents[$i]->contents[$j] = '';\n\n\t\t}\n\t\t\t\n\t\telse{\n\t\t\t$this->markspan[$i][$j] = false;\n\t\t}\n\t\t//else leave as it is\n\t}", "public function validateBody()\n {\n\n if (v::identical($this->col)->validate(1)) {\n\n /** Cidade ou Região **/\n\n $regiao = Tools::clean($this->cell);\n\n if (!v::stringType()->notBlank()->validate($regiao)) {\n throw new \\InvalidArgumentException(\"Atenção: Informe na tabela a Cidade ou Região corretamente.\", E_USER_WARNING);\n }\n\n $this->array[$this->row]['regiao'] = $regiao;\n\n }\n\n if (v::identical($this->col)->validate(2)) {\n\n /** Faixa CEP Inicial **/\n\n $cep_inicio = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_inicio)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Inicial \\\"{$cep_inicio}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_inicio'] = $cep_inicio;\n\n }\n\n if (v::identical($this->col)->validate(3)) {\n\n /** Faixa CEP Final **/\n\n $cep_fim = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_fim)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Final \\\"{$cep_fim}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_fim'] = $cep_fim;\n\n }\n\n if (v::identical($this->col)->validate(4)) {\n\n /** Peso Inicial **/\n\n $peso_inicial = Tools::clean($this->cell);\n\n if (v::numeric()->negative()->validate(Tools::convertToDecimal($peso_inicial))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Inicial não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$peso_inicial}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_inicial'] = $peso_inicial;\n\n }\n\n if (v::identical($this->col)->validate(5)) {\n\n /** Peso Final **/\n\n $peso_final = Tools::clean($this->cell);\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($peso_final))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Final não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$peso_final}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_final'] = $peso_final;\n\n }\n\n if (v::identical($this->col)->validate(6)) {\n\n /** Valor **/\n\n $valor = Tools::clean($this->cell);\n\n if (!v::notEmpty()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALOR do frete não pode ser vazio.\n\n Por favor, corrija o valor e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do frete não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$valor}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['valor'] = $valor;\n\n }\n\n if (v::identical($this->col)->validate(7)) {\n\n /** Prazo de Entrega **/\n\n $prazo_entrega = (int)Tools::clean($this->cell);\n\n /**\n * Verifica o prazo de entrega\n */\n if (!v::numeric()->positive()->validate($prazo_entrega)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Atenção: Informe na tabela os Prazos de Entrega corretamente.\n\n Exemplo: 7 para sete dias.\n\n Por favor, corrija o Prazo de Entrega \\\"{$prazo_entrega}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate($prazo_entrega)) {\n $prazo_entrega = null;\n }\n\n $this->array[$this->row]['prazo_entrega'] = $prazo_entrega;\n\n }\n\n if (v::identical($this->col)->validate(8)) {\n\n /** AD VALOREM **/\n\n $ad_valorem = Tools::clean($this->cell);\n\n if (!empty($ad_valorem) && !v::numeric()->positive()->validate(Tools::convertToDecimal($ad_valorem))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do AD VALOREM não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$this->cell}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($ad_valorem))) {\n $ad_valorem = null;\n }\n\n $this->array[$this->row]['ad_valorem'] = $ad_valorem;\n\n }\n\n if (v::identical($this->col)->validate(9)) {\n\n /** KG Adicional **/\n\n $kg_adicional = Tools::clean($this->cell);\n\n if (!empty($kg_adicional) && v::numeric()->negative()->validate(Tools::convertToDecimal($kg_adicional))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do KG Adicional não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$kg_adicional}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($kg_adicional))) {\n $kg_adicional = null;\n }\n\n $this->array[$this->row]['kg_adicional'] = $kg_adicional;\n\n }\n\n return $this->array;\n\n }", "public function validate(){\n\n if(!$this->convert_and_validate_rows()){\n return 0;\n }\n\n if(!$this->validate_columns()){\n return 0;\n }\n\n if(!$this->validate_regions()){\n return 0;\n }\n\n return 1;\n }", "protected function importRow($arrData)\n\t{\n\t\t$this->setRoundData('csvLine', $this->getRoundData('csvLine')+1);\n\n\t\t// validation\n\t\tif($this->useValidation)\n\t\t{\n\t\t\tforeach($this->constraints as $constraint)\n\t\t\t{\n\t\t\t\t$fld = $constraint['fld'];\n\t\t\t\t$constraint = $constraint['constraint'];\n\t\t\t\tif($constraint == 'notEmpty' && !strlen($arrData[$fld]))\n\t\t\t\t{\n\t\t\t\t\t$this->msg(\"Line:\".($this->getRoundData('csvLine')+1).\" Col:\".$fld.' does not match constraint '.$constraint, 'warning');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$this->valditaor($constraint,$arrData[$fld]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->msg(\"Line:\".($this->getRoundData('csvLine')+1).\" Col:\".$fld.' does not match constraint '.$constraint, 'warning');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$str = substr(str_repeat('?,',count($arrData)),0,-1);\n\t\t$this->Database->prepare('INSERT INTO '.$this->tmpTbl.' VALUES (NULL,'.$str.')')->executeUncached($arrData);\n\t\t$this->setRoundData('counter', $this->getRoundData('counter')+1);\n\n\t\treturn true;\n\t}", "public function isValidRow(array $record): bool\r\n {\r\n $this->lastError = '';\r\n if (count($record) !== $this->getColumnCount()) {\r\n $this->lastError = 'The number of columns in the record does'\r\n . ' not match the number of defined columns';\r\n return false;\r\n }\r\n\r\n foreach ($this->columns as $id => $rules) {\r\n if (!array_key_exists($id, $record)) {\r\n $this->lastError = sprintf(\r\n 'No value for column \"%s\" is given', $id\r\n );\r\n return false;\r\n }\r\n if (!$this->isValidFieldValue($id, $record[$id])) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public function validateLine($data) {\n if (!is_array($data)) {\n return false;\n }\n if (count($data) < 3) {\n return false;\n }\n if (!preg_match(static::$VALIDRESTAURANTID, trim($data[0]))) {\n return false;\n }\n if (!preg_match(static::$VALIDPRICE, trim($data[1]))) {\n return false;\n }\n for ($i = 2; $i < count($data); $i++) {\n if (preg_match(static::$VALIDITEMNAME, trim($data[$i])) === 0) {\n return false;\n }\n }\n return true;\n }", "protected function validateRow(array $row)\n {\n foreach ($row as $k => $v)\n {\n if (WF::is_array_like($v))\n throw new InvalidArgumentException(\"CSVWriter does not support nested arrays\");\n }\n }", "protected function filter_row(&$row) {}", "public function changeRowData(&$row){}", "public function isValidCustomRow(){\n return $this->capacity === $this->getNbSeatsCustomRow();\n }", "function prepareRowData(array &$row)\n{\n sanitizeDataQueried($row);\n convertAllDates($row);\n roundRawGrade($row);\n}", "public function updateRowCheckInjections($table, $row, $filter)\r\n {\r\n\r\n //call to check validation of query injection of filter:\r\n $filterObj = $filter;\r\n if (gettype($filterObj)==object) {\r\n $filterObj = array();\r\n foreach ($filter as $key => $value) {\r\n array_push($filterObj, array($key,$value));\r\n }\r\n }\r\n $filter_obj = $this->processFilter($filterObj,$this->error);\r\n if(!$filter_obj) return false;\r\n \r\n $array = $row;\r\n if (!is_array($array)) {\r\n $array = json_decode($row);\r\n }\r\n \r\n \r\n if (count($array) ==0) {\r\n array_push($this->error, \"Post does not contain any data!\");\r\n return false;\r\n }\r\n\r\n //check if any post data is not a valid column_name:\r\n $all_columns = $this->getRows(\"SHOW COLUMNS FROM $table \", true);\r\n $table_columns = array();\r\n foreach ($all_columns as $col_row) {\r\n $col_name = $col_row[\"Field\"];\r\n array_push($table_columns, $col_name);\r\n }\r\n\r\n $where_columns = array();\r\n foreach ($filterObj as $filterRow) {\r\n array_push($where_columns, $filterRow[0]);\r\n }\r\n foreach ($where_columns as $where_column) {\r\n if (!in_array($where_column, $table_columns)) {\r\n array_push($this->error, \"field: $where_column is not in table: $table\");\r\n return false;\r\n }\r\n }\r\n $posted_columns = array_keys($array);\r\n foreach ($posted_columns as $posted_column) {\r\n if (!in_array($posted_column, $table_columns)) {\r\n array_push($this->error, \"field: $posted_column is not in table: $table\");\r\n return false;\r\n }\r\n }\r\n \r\n $setCommand = \"\";\r\n $values_arr = array();\r\n $param_type = \"\"; //array();\r\n $count = 0;\r\n foreach ($array as $key => $value) {\r\n $count+=1;\r\n if (strlen($setCommand)==0) {\r\n $setCommand .= $key.\" = ? \";\r\n } else {\r\n $setCommand .= \", \".$key.\" = ? \";\r\n }\r\n array_push($values_arr, $value);\r\n $param_type .= \"s\";\r\n }\r\n $filterRowValues =$filter_obj[\"filterRowValues\"];\r\n foreach ($filterRowValues as $sValue) {\r\n $param_type.=\"s\";\r\n }\r\n\r\n $sql = \"update $table set \".$setCommand;\r\n $a_params = array();\r\n array_push($a_params, $param_type);\r\n foreach ($values_arr as $singleValue) {\r\n array_push($a_params, $singleValue);\r\n }\r\n //adding params of where:\r\n \r\n if(strlen($filter_obj[\"filterWhere\"]) >0){\r\n foreach ($filterRowValues as $singleValue) {\r\n array_push($a_params, $singleValue);\r\n }\r\n $sql .= \" where \".$filter_obj[\"filterWhere\"];\r\n }\r\n \r\n //echo json_encode($a_params);\r\n $this->sql_statement = $sql;\r\n $stmt = $this->conn->prepare($sql);\r\n\r\n if (!$stmt) {\r\n array_push($this->error, \"updateRow: Error in preparing statement (\".$sql.\") \\n\".$this->conn->error);\r\n return false;\r\n } elseif(count($a_params)<1) {\r\n array_push($this->error, \"update must have parameters: \".$sql.\") \\n\");\r\n return false;\r\n } else {\r\n call_user_func_array(array($stmt, 'bind_param'), $this->refValues($a_params));\r\n $result = $stmt->execute();\r\n $count = $this->getConn()->affected_rows;\r\n $this->rowCount = $count;\r\n $stmt->close();\r\n\r\n if($count>0 && $count<10){\r\n $result_sql = \"select * from $table \";\r\n $result_row = $this->getRowsv2($result_sql,$filter, true);\r\n return $result_row;\r\n }\r\n return true;\r\n }\r\n }", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "function testRow ($row, $rowSchema = null) {}", "function clean_row( &$row ) {\n\n\n if ( array_key_exists( 'address_with_geocode', $row )) {\n $address = json_decode($row['address_with_geocode']['human_address']);\n\n if ( array_key_exists( 'latitude', $row['address_with_geocode'] )) {\n $row['latitude'] = $row['address_with_geocode']['latitude'];\n }\n if ( array_key_exists( 'longitude', $row['address_with_geocode'] )) {\n $row['longitude'] = $row['address_with_geocode']['longitude'];\n }\n\n if ( empty($address->city) && empty($address->state) && empty($address->zip) ) {\n\n $address->address = str_replace(' Kansas City, Missouri','',$address->address,$cnt);\n if ( $cnt ) {\n $row['address_city'] = 'Kansas City';\n $row['address_state'] = 'Missouri';\n }\n $tmp = $address->address;\n $zip = preg_replace('/(.*) (\\d*)$/','$2',$tmp,$cnt);\n\n if ( $cnt ) {\n $row['address_zip'] = $zip;\n $address->address = str_replace(' ' + $zip,'',$address->address,$cnt);\n } else {\n $row['address_zip'] = '';\n \n }\n } else {\n $row['address_city'] = $address->city;\n $row['address_state'] = $address->state;\n $row['address_zip'] = $address->zip;\n }\n $row['address_line_1'] = $address->address;\n }\n\n // Make sure we have values for all the field names except for the key\n foreach ( $this->fields AS $field_name ) {\n if ( !array_key_exists( $field_name, $row ) ) {\n $row[$field_name] = '';\n }\n }\n\n // Turn dates into MySQL dates it remove the 'T' between the date and time\n\n $row['creation_date'] = str_replace('T', ' ', $row['creation_date']);\n $row['closed_date'] = str_replace('T', ' ', $row['closed_date']);\n\n $row['department_id'] = $this->find( 'departments', $row['department']);\n unset( $row['department'] );\n\n $row['work_group_id'] = $this->find( 'work_groups', $row['work_group']);\n unset( $row['work_group'] );\n\n $row['request_type_id'] = $this->find( 'request_types', $row['request_type']);\n unset( $row['request_type'] );\n\n $row['neighborhood_id'] = $this->find( 'neighborhoods', $row['neighborhood']);\n unset( $row['neighborhood'] );\n\n }", "function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t\tif ($this->fbid->CurrentValue <> \"\") { // Check field with unique index\n\t\t\t$sFilterChk = \"(`fbid` = \" . ew_AdjustSql($this->fbid->CurrentValue) . \")\";\n\t\t\t$sFilterChk .= \" AND NOT (\" . $sFilter . \")\";\n\t\t\t$this->CurrentFilter = $sFilterChk;\n\t\t\t$sSqlChk = $this->SQL();\n\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t$rsChk = $conn->Execute($sSqlChk);\n\t\t\t$conn->raiseErrorFn = '';\n\t\t\tif ($rsChk === FALSE) {\n\t\t\t\treturn FALSE;\n\t\t\t} elseif (!$rsChk->EOF) {\n\t\t\t\t$sIdxErrMsg = str_replace(\"%f\", $this->fbid->FldCaption(), $Language->Phrase(\"DupIndex\"));\n\t\t\t\t$sIdxErrMsg = str_replace(\"%v\", $this->fbid->CurrentValue, $sIdxErrMsg);\n\t\t\t\t$this->setFailureMessage($sIdxErrMsg);\n\t\t\t\t$rsChk->Close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$rsChk->Close();\n\t\t}\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// fbid\n\t\t\t$this->fbid->SetDbValueDef($rsnew, $this->fbid->CurrentValue, NULL, $this->fbid->ReadOnly);\n\n\t\t\t// name\n\t\t\t$this->name->SetDbValueDef($rsnew, $this->name->CurrentValue, \"\", $this->name->ReadOnly);\n\n\t\t\t// email\n\t\t\t$this->_email->SetDbValueDef($rsnew, $this->_email->CurrentValue, \"\", $this->_email->ReadOnly);\n\n\t\t\t// password\n\t\t\t$this->password->SetDbValueDef($rsnew, $this->password->CurrentValue, NULL, $this->password->ReadOnly);\n\n\t\t\t// validated_mobile\n\t\t\t$this->validated_mobile->SetDbValueDef($rsnew, $this->validated_mobile->CurrentValue, NULL, $this->validated_mobile->ReadOnly);\n\n\t\t\t// role_id\n\t\t\t$this->role_id->SetDbValueDef($rsnew, $this->role_id->CurrentValue, 0, $this->role_id->ReadOnly);\n\n\t\t\t// image\n\t\t\t$this->image->SetDbValueDef($rsnew, $this->image->CurrentValue, NULL, $this->image->ReadOnly);\n\n\t\t\t// newsletter\n\t\t\t$this->newsletter->SetDbValueDef($rsnew, $this->newsletter->CurrentValue, 0, $this->newsletter->ReadOnly);\n\n\t\t\t// points\n\t\t\t$this->points->SetDbValueDef($rsnew, $this->points->CurrentValue, NULL, $this->points->ReadOnly);\n\n\t\t\t// last_modified\n\t\t\t$this->last_modified->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->last_modified->CurrentValue, 7), NULL, $this->last_modified->ReadOnly);\n\n\t\t\t// p2\n\t\t\t$this->p2->SetDbValueDef($rsnew, $this->p2->CurrentValue, NULL, $this->p2->ReadOnly || (EW_ENCRYPTED_PASSWORD && $rs->fields('p2') == $this->p2->CurrentValue));\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\tif ($EditRow) {\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\n\t\t}\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "public function isValid($_throwExceptionOnInvalidData = false);", "public function validateData(){\n return true;\n }", "private function validateInputParameters($data)\n {\n }", "function validate($input) {\n\t\t$values = array();\n\t\tforeach($input as $col => $value) {\n\t\t\tif($value != \"\") {\n\t\t\t\t$values[$col] = $value;\n\t\t\t}\n\t\t}\n\t\tif($values[\"instrument\"] == 0) {\n\t\t\tunset($values[\"instrument\"]);\n\t\t}\n\t\t\n\t\tparent::validate($values);\n\t}", "abstract public function isValid($data);", "function EmptyRow() {\r\n\t\tglobal $rekeningju, $objForm;\r\n\t\tif ($objForm->HasValue(\"x_NoRek\") && $objForm->HasValue(\"o_NoRek\") && $rekeningju->NoRek->CurrentValue <> $rekeningju->NoRek->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_Keterangan\") && $objForm->HasValue(\"o_Keterangan\") && $rekeningju->Keterangan->CurrentValue <> $rekeningju->Keterangan->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_debet\") && $objForm->HasValue(\"o_debet\") && $rekeningju->debet->CurrentValue <> $rekeningju->debet->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_kredit\") && $objForm->HasValue(\"o_kredit\") && $rekeningju->kredit->CurrentValue <> $rekeningju->kredit->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_kode_bukti\") && $objForm->HasValue(\"o_kode_bukti\") && $rekeningju->kode_bukti->CurrentValue <> $rekeningju->kode_bukti->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_tanggal\") && $objForm->HasValue(\"o_tanggal\") && $rekeningju->tanggal->CurrentValue <> $rekeningju->tanggal->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_tanggal_nota\") && $objForm->HasValue(\"o_tanggal_nota\") && $rekeningju->tanggal_nota->CurrentValue <> $rekeningju->tanggal_nota->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_kode_otomatis\") && $objForm->HasValue(\"o_kode_otomatis\") && $rekeningju->kode_otomatis->CurrentValue <> $rekeningju->kode_otomatis->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_kode_otomatis_tingkat\") && $objForm->HasValue(\"o_kode_otomatis_tingkat\") && $rekeningju->kode_otomatis_tingkat->CurrentValue <> $rekeningju->kode_otomatis_tingkat->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_apakah_original\") && $objForm->HasValue(\"o_apakah_original\") && $rekeningju->apakah_original->CurrentValue <> $rekeningju->apakah_original->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\treturn TRUE;\r\n\t}", "private function checkRowConsistency($row)\n {\n if ( $this->strict === false ) {\n return;\n }\n\n $current = count($row);\n\n if ( $this->rowConsistency === null ) {\n $this->rowConsistency = $current;\n }\n\n if ( $current !== $this->rowConsistency ) {\n throw new StrictViolationException();\n }\n\n $this->rowConsistency = $current;\n }", "protected function parseRow($data) {\n if (!empty($data['Converted Amount Refunded'])) {\n throw new WmfException(WmfException::INVALID_MESSAGE, 'Refunds not currently handled. Please log a Phab if required');\n }\n return parent::parseRow($data);\n }", "private function checkValidity(array &$rows, array $keys): bool \n {\n $outcome = true;\n \n foreach($rows as $row) {\n \n if (!$this->hasValidFormat($keys, $row)) {\n\n $outcome = false;\n break;\n }\n }\n return $outcome;\n }", "function _cleanup_input_data($data = array()) {\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Cleanup data array\n\t\t$_tmp = array();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\t$k = trim($k);\n\t\t\tif (!strlen($k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$_tmp[$k] = $v;\n\t\t}\n\t\t$data = $_tmp;\n\t\tunset($_tmp);\n\t\t// Remove non-existed fields from query\n\t\t$avail_fields = $this->_get_avail_fields();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\tif (!isset($avail_fields[$k])) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\t// Last check\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $data;\n\t}", "public function validate(phpDataMapper_Model_Row $row)\n\t{\n\t\t// Check validation rules on each feild\n\t\tforeach($this->fields as $field => $fieldAttrs) {\n\t\t\tif(isset($fieldAttrs['required']) && true === $fieldAttrs['required']) {\n\t\t\t\t// Required field\n\t\t\t\tif(empty($row->$field)) {\n\t\t\t\t\t$this->addError(\"Required field '\" . $field . \"' was left blank\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check for errors\n\t\tif($this->hasErrors()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function processDataInput()\n\t{\n\t\t$this->buildNewRecordData();\n\n\t\tif( !$this->recheckUserPermissions() )\n\t\t{\n\t\t\t//\tprevent the page from reading database values\n\t\t\t$this->oldRecordData = $this->newRecordData;\n\t\t\t$this->cachedRecord = $this->newRecordData;\n\t\t\t$this->recordValuesToEdit = null;\n\t\t\treturn false;\n\t\t}\n\n\t\tif( !$this->checkCaptcha() )\n\t\t{\n\t\t\t$this->setMessage($this->message);\n\t\t\treturn false;\n\t\t}\n\n\t\t//\tcheck Deny Duplicate values\n\t\tforeach($this->newRecordData as $f => $value)\n\t\t{\n\t\t\tif( !$this->pSet->allowDuplicateValues($f) )\n\t\t\t{\n\t\t\t\t$this->errorFields[] = $f;\n\t\t\t\t$this->setMessage( $this->pSet->label( $f ) . \" \" . mlang_message(\"INLINE_DENY_DUPLICATES\") );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/* process the records and update 1 by one */\n\t\tforeach( $this->parsedSelection as $idx => $s ) \n\t\t{\n\t\t\t$this->currentWhereExpr = $this->getSingleRecordWhereClause( $s );\n\t\t\t$strSQL = $this->gQuery->gSQLWhere( $this->currentWhereExpr );\n\t\t\tLogInfo($strSQL);\n\n\t\t\t$fetchedArray = $this->connection->query( $strSQL )->fetchAssoc();\n\t\t\tif( !$fetchedArray )\n\t\t\t\tcontinue;\n\t\t\t$fetchedArray = $this->cipherer->DecryptFetchedArray( $fetchedArray );\n\t\t\tif( !$this->isRecordEditable( $fetchedArray ) )\n\t\t\t\tcontinue;\n\t\t\t$this->setUpdatedLatLng( $this->getNewRecordData(), $fetchedArray );\n\n\t\t\t$this->oldKeys = $s;\n\t\t\t$this->recordBeingUpdated = $fetchedArray;\n\n\t\t\tif( !$this->callBeforeEditEvent( ) )\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\tif( $this->callCustomEditEvent( ) )\n\t\t\t{\n\t\t\t\tif( !DoUpdateRecord( $this ) )\n\t\t\t\t\tcontinue;\n\t\t\t\t//\tsuccess if at least one record updated\n\t\t\t}\n\t\t\t++$this->nUpdated;\n\t\t\t$this->mergeNewRecordData();\n\t\t\t$this->auditLogEdit();\n\t\t\t$this->callAfterEditEvent();\n\t\t\t\n\t\t\tif( $this->isPopupMode() )\n\t\t\t\t$this->inlineReportData[ $this->rowIds[ $idx ] ] = $this->getRowSaveStatusJSON( $s );\n\t\t}\n\t\n\t\t$this->updatedSuccessfully = ($this->nUpdated > 0);\n\n\t\t//\tdo save the record\n\n\t\tif( !$this->updatedSuccessfully )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$this->messageType = MESSAGE_INFO;\n\t\t$this->setSuccessfulEditMessage();\n\t\t\n\t\t$this->callAfterSuccessfulSave();\n\n\t\treturn true;\n\t}", "public function testSaveDataTableStringsNotParseableToDataTypes() {\r\n $record = ['UUID' => 'uuid1tRMR2', 'bool' => 'not parsable', 'int' => 'not parsable', 'string' => 'testReadMultipleRecords 2'];\r\n\t\t$datatable = new avorium_core_data_DataTable(1, 4);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'BOOLEAN_VALUE');\r\n\t\t$datatable->setHeader(2, 'INT_VALUE');\r\n\t\t$datatable->setHeader(3, 'STRING_VALUE');\r\n\t\t$datatable->setCellValue(0, 0, $record['UUID']);\r\n\t\t$datatable->setCellValue(0, 1, $record['bool']);\r\n\t\t$datatable->setCellValue(0, 2, $record['int']);\r\n\t\t$datatable->setCellValue(0, 3, $record['string']);\r\n $this->setExpectedException('Exception');\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t}", "public function modify_row(&$p_arrRow)\n {\n ;\n }", "public function testValidateValueUnique()\n {\n $dataSource = new NativeDataSource([\n ['name' => 1],\n ['name' => 2],\n ['name' => 2],\n ['name' => 4],\n ]);\n $schema = new Schema((object) [\n 'fields' => [\n (object) [\n 'name' => 'name',\n 'type' => 'integer',\n 'constraints' => (object) ['unique' => true],\n ],\n ],\n ]);\n $table = new Table($dataSource, $schema);\n $actualRows = [];\n try {\n foreach ($table as $row) {\n $actualRows[] = $row;\n }\n $this->fail();\n } catch (DataSourceException $e) {\n $this->assertEquals([\n ['name' => 1],\n ['name' => 2],\n ], $actualRows);\n $this->assertEquals('row 3: field must be unique', $e->getMessage());\n }\n }", "public function validateDataInvoice(): void\n {\n $this->validarDatos($this->datos, $this->getRules('fe'));\n\n $this->validarDatosArray($this->datos->arrayOtrosTributos, 'tributos');\n\n /** @phpstan-ignore-next-line */\n if (property_exists($this->datos, 'arraySubtotalesIVA')) {\n $this->validarDatosArray((array) $this->datos->arraySubtotalesIVA, 'iva');\n }\n\n $this->validarDatosArray($this->datos->comprobantesAsociados, 'comprobantesAsociados');\n\n if ($this->ws === 'wsfe') {\n if (property_exists($this->datos, 'arrayOpcionales')) {\n $this->validarDatosArray((array) $this->datos->arrayOpcionales, 'opcionales');\n }\n } elseif ($this->ws === 'wsmtxca') {\n $this->validarDatosArray($this->datos->items, 'items');\n }\n }", "public function formatRowShouldThrow()\n {\n // Given\n $fieldSpecs = array(\n array(\"len\" => \"10\", \"type\" => \"s\")\n );\n $values = array(\"first\", 12);\n $this->expectException(\\InvalidArgumentException::class);\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \" \");\n }", "protected function _saveValidatedBunches()\n {\n $source = $this->_getSource();\n $source->rewind();\n\n while ($source->valid()) {\n try {\n $rowData = $source->current();\n } catch (\\InvalidArgumentException $e) {\n $this->addRowError($e->getMessage(), $this->_processedRowsCount);\n $this->_processedRowsCount++;\n $source->next();\n continue;\n }\n\n $rowData = $this->_customFieldsMapping($rowData);\n\n $this->validateRow($rowData, $source->key());\n\n $source->next();\n }\n $this->checkUrlKeyDuplicates();\n $this->getOptionEntity()->validateAmbiguousData();\n return parent::_saveValidatedBunches();\n }", "final protected function loadColumnValues($rows)\n\t\t{\n\t\t\tif($rows === false || !is_array($rows) || count($rows) == 0)\n\t\t\t\treturn false;\n\n\t\t\tforeach($this->_columns as $col)\n\t\t\t{\n\t\t\t\t// find the value in the input array\n\t\t\t\tif(!isset($rows[$col->getName()]))\n\t\t\t\t\tcontinue;\n\t\t\t\t// change the value. throws CDFColumnDataException if incompatible\n\t\t\t\t$col->setValue($rows[$col->getName()]);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function validateInputData(&$data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n }", "function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Nro_Serie\r\n\t\t\t$this->Nro_Serie->SetDbValueDef($rsnew, $this->Nro_Serie->CurrentValue, \"\", $this->Nro_Serie->ReadOnly || $this->Nro_Serie->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly || $this->SN->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cant_Net_Asoc\r\n\t\t\t$this->Cant_Net_Asoc->SetDbValueDef($rsnew, $this->Cant_Net_Asoc->CurrentValue, NULL, $this->Cant_Net_Asoc->ReadOnly || $this->Cant_Net_Asoc->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Marca\r\n\t\t\t$this->Id_Marca->SetDbValueDef($rsnew, $this->Id_Marca->CurrentValue, 0, $this->Id_Marca->ReadOnly || $this->Id_Marca->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Modelo\r\n\t\t\t$this->Id_Modelo->SetDbValueDef($rsnew, $this->Id_Modelo->CurrentValue, 0, $this->Id_Modelo->ReadOnly || $this->Id_Modelo->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_SO\r\n\t\t\t$this->Id_SO->SetDbValueDef($rsnew, $this->Id_SO->CurrentValue, 0, $this->Id_SO->ReadOnly || $this->Id_SO->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Estado\r\n\t\t\t$this->Id_Estado->SetDbValueDef($rsnew, $this->Id_Estado->CurrentValue, 0, $this->Id_Estado->ReadOnly || $this->Id_Estado->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_Server\r\n\t\t\t$this->User_Server->SetDbValueDef($rsnew, $this->User_Server->CurrentValue, NULL, $this->User_Server->ReadOnly || $this->User_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_Server\r\n\t\t\t$this->Pass_Server->SetDbValueDef($rsnew, $this->Pass_Server->CurrentValue, NULL, $this->Pass_Server->ReadOnly || $this->Pass_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_TdServer\r\n\t\t\t$this->User_TdServer->SetDbValueDef($rsnew, $this->User_TdServer->CurrentValue, NULL, $this->User_TdServer->ReadOnly || $this->User_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_TdServer\r\n\t\t\t$this->Pass_TdServer->SetDbValueDef($rsnew, $this->Pass_TdServer->CurrentValue, NULL, $this->Pass_TdServer->ReadOnly || $this->Pass_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cue\r\n\t\t\t// Fecha_Actualizacion\r\n\r\n\t\t\t$this->Fecha_Actualizacion->SetDbValueDef($rsnew, ew_CurrentDate(), NULL);\r\n\t\t\t$rsnew['Fecha_Actualizacion'] = &$this->Fecha_Actualizacion->DbValue;\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->SetDbValueDef($rsnew, CurrentUserName(), NULL);\r\n\t\t\t$rsnew['Usuario'] = &$this->Usuario->DbValue;\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "public function testMalformedData(){\n $array_test = ['email' => '[email protected]', 'pubid' => 4];\n\n $api = new ApiConnection();\n $dataCheck = [\n 'status' => 402,\n 'message' => \"data is malformed. email only content text and number.\",\n 'data' => []\n ];\n $this->assertEquals($dataCheck, $api->updateAccount($array_test));\n }", "public function testValidateThrowMissingColumnException()\n {\n $this->job->setCsvData([['Id'], ['test', 'test2']]);\n\n try {\n $this->job->validate();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), EntityException::MGS_CSV_ROW_COUNT_MISMATCH);\n }\n }", "public function valid() {\n // TODO: Check numProcessed against itemlimit\n return !is_null($this->currentRow);\n }", "protected function processAndValidatePrimaryColumnData(array &$primaryColumnData)\n {\n $this->processAndValidateColumnData($primaryColumnData);\n }", "private function cleanData(array $data) {\n $options = $this->getOptions();\n\n $disallowedDataKeys = array(\n $options->getIdColumnName(),\n $options->getLeftColumnName(),\n $options->getRightColumnName(),\n $options->getLevelColumnName(),\n $options->getParentIdColumnName(),\n );\n\n return array_diff_key($data, array_flip($disallowedDataKeys));\n }", "function validate_row($srcrow, $table) {\n\n foreach ($table as $dstrow) {\n if ($srcrow['cbsId'] == $dstrow['cbsId']) {\n // print(\"Match found for \" . $srcrow['cbsId'] . \"\\n\");\n return true;\n }\n }\n print(\"No Match found for \" . $srcrow['cbsId'] . \" \" . $srcrow['cbsName'] . \" \\n\");\n return false;\n}", "protected function _prepareRowForDb(array $rowData)\n {\n /**\n * Convert all empty strings to null values, as\n * a) we don't use empty string in DB\n * b) empty strings instead of numeric values will product errors in Sql Server\n */\n foreach ($rowData as $key => $val) {\n if ($val === '') {\n $rowData[$key] = null;\n }\n }\n return $rowData;\n }", "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "private function validate($lineData, &$index)\n {\n // validation\n if (count($lineData) != 13 || 460 != $lineData[0]) {\n echo $this->echo(sprintf(\"Invalid, line index: %s.\\n\", ++$index));\n return false;\n }\n\n return true;\n }", "public function validateFieldData($postArray) \n{\n //for each field - check maxLenth if set, and check required just in case. Required should already be set - but just in case it should be checked again before filing.\n $errorArray=array();\n \n foreach ($this->tableStructure as $index=>$fieldArray) {\n $columnName=$fieldArray['columnName'];\n $val= isset($postArray[$columnName]) ? $postArray[$columnName] : '';\n $maxLength=isset($fieldArray['maxLength']) ? $fieldArray['maxLength'] : '';\n \n if (($val != '') && ($maxLength != '')) {\n if (strlen($val) > $maxLength) {\n $errorArray[$columnName]=\"Exceeds maximum length of \".$maxLength.\".\";\n }\n }\n \n if ($val == '') {\n if (isset($fieldArray['required']) && $fieldArray['required'] == 1) {\n $errorArray[$columnName]=\"Required field.\";\n } \n }\n } \n \n return $errorArray; \n}", "function validate(array $data)\n\t{\n\t}", "public function prepareRow($row) {\n\t\n if ($row->DateQuit) {\n\t\t$row->DateQuit = $this->formatdate($row->DateQuit);\t\t\n }\n if ($row->Postcode) {\n\t\t$Postcode = preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $row->Postcode);\n\t\tif (ctype_digit($Postcode) && strlen($Postcode) == \"4\") {\n\t\t\t$row->Postcode = $Postcode;\t\t\t\n\t\t} else {\n\t\t\t$row->Postcode = \"\";\n\t\t}\n } \n if ($row->State) {\n\t\t$states = array( 'ACT','NSW','NT','QLD','SA','TAS','VIC','WA');\n\t\t$str = strtoupper($row->State);\n\t\tif (in_array($str, $states)) {\n\t\t\t$row->State = $str;\n\t\t} else {\n\t\t\t$row->State = \"\";\n\t\t}\n } \n if ($row->Gender) {\n\t\t$gender_options = array('male', 'female');\n\t\tif (in_array(strtolower($row->Gender), $gender_options)) {\n\t\t\t$gender = strtolower($row->Gender);\n\t\t\t$row->Gender = $gender;\n\t\t} else {\n\t\t\t$row->Gender = \"\";\n\t\t}\n }\n if ($row->DateOfBirth) {\t\n\t\t$row->DateOfBirth = $this->formatdate($row->DateOfBirth);\n }\n if ($row->DateTreatmentStart) {\t\n\t\t$row->DateTreatmentStart = $this->formatdate($row->DateTreatmentStart);\n }\n if ($row->PhoneMobile) {\n\t\t$PhoneMobile = preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $row->PhoneMobile);\n\t\tif (ctype_digit($PhoneMobile)) {\n\t\t\tif (substr( trim($PhoneMobile ), 0, 2 ) == \"61\" && strlen( trim($PhoneMobile) ) >= \"11\") {\n\t\t\t\t$newphone = substr(trim($PhoneMobile), 2);\n\t\t\t\t$row->PhoneMobile = $newphone;\n\t\t\t}\n\t\t\telse if (substr( trim($PhoneMobile ), 0, 1 ) == \"0\" && strlen( trim($PhoneMobile) ) >= \"10\") {\n\t\t\t\t$newphone = substr(trim($PhoneMobile), 1);\n\t\t\t\t$row->PhoneMobile = $newphone;\t\t\t\t\n\t\t\t}\n\t\t\tif (!(strlen($row->PhoneMobile) >= \"9\" && strlen($row->PhoneMobile) <= \"11\")) {\n\t\t\t\t$row->PhoneMobile = \"\";\n\t\t\t}\n\t\t\t//$row->PhoneMobile = '91'.$PhoneMobile;\n\t\t} else {\n\t\t\t$row->PhoneMobile = \"\";\n\t\t}\n } \n return TRUE;\n }", "public function updateRow($data)\r\n\t{\r\n\t\t$data = (array)$data;\r\n\t\t$data = $this->cleanupFieldNames($data);\r\n\t\t\r\n\t\t// Build SQL\r\n\t\t$sql = 'UPDATE `'.$this->name.'` SET ';\r\n\t\t$values = array();\r\n\t\t$pkFound = false;\r\n\t\tforeach($data as $key => $val)\r\n\t\t{\r\n\t\t\t// Ignore if field is not in table\r\n\t\t\tif (!$this->hasField($key))\r\n\t\t\t{\r\n\t\t\t\tunset($data[$key]);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Include value, but not if primary key and table has auto-incr PK\r\n\t\t\t$include = true;\r\n\t\t\tif ($key == $this->primaryKey)\r\n\t\t\t{\r\n\t\t\t\tif ($this->primaryKeyIsAutoIncrement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$include = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Found non-empty primary key\r\n\t\t\t\tif (!empty($val))\r\n\t\t\t\t{\r\n\t\t\t\t\t$pkFound = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Include and process special value\r\n\t\t\tif ($include)\r\n\t\t\t{\r\n\t\t\t\tif ($val === 'NULL')\r\n\t\t\t\t{\r\n\t\t\t\t\t$values[] = \"`$key` = NULL\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$values[] = \"`$key` = :$key\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t// Quit if has no primary key\r\n\t\tif (!$pkFound)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Cannot update: The supplied data does not contain a primary key');\r\n\t\t}\r\n\t\r\n\t\t// No fields were found - update makes no sense\r\n\t\tif (count($values) == 0)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('No fields were added to the UPDATE query');\r\n\t\t}\r\n\t\t\t\r\n\t\t// Add values to query\r\n\t\t$sql .= implode(', ', $values);\r\n\t\r\n\t\t// Add where\r\n\t\t$sql .= ' WHERE `'.$this->primaryKey.'` = :' . $this->primaryKey;\r\n\r\n\t\t// Execute\r\n\t\t$result = $this->db->runQuery($sql, $data);\r\n\t\t\r\n\t\treturn $this->db->getAffectedRows();\r\n\t}", "function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$this->Ruta_Archivo->OldUploadPath = 'ArchivosPase';\r\n\t\t\t$this->Ruta_Archivo->UploadPath = $this->Ruta_Archivo->OldUploadPath;\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Serie_Equipo\r\n\t\t\t$this->Serie_Equipo->SetDbValueDef($rsnew, $this->Serie_Equipo->CurrentValue, NULL, $this->Serie_Equipo->ReadOnly);\r\n\r\n\t\t\t// Id_Hardware\r\n\t\t\t$this->Id_Hardware->SetDbValueDef($rsnew, $this->Id_Hardware->CurrentValue, NULL, $this->Id_Hardware->ReadOnly);\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly);\r\n\r\n\t\t\t// Modelo_Net\r\n\t\t\t$this->Modelo_Net->SetDbValueDef($rsnew, $this->Modelo_Net->CurrentValue, NULL, $this->Modelo_Net->ReadOnly);\r\n\r\n\t\t\t// Marca_Arranque\r\n\t\t\t$this->Marca_Arranque->SetDbValueDef($rsnew, $this->Marca_Arranque->CurrentValue, NULL, $this->Marca_Arranque->ReadOnly);\r\n\r\n\t\t\t// Nombre_Titular\r\n\t\t\t$this->Nombre_Titular->SetDbValueDef($rsnew, $this->Nombre_Titular->CurrentValue, NULL, $this->Nombre_Titular->ReadOnly);\r\n\r\n\t\t\t// Dni_Titular\r\n\t\t\t$this->Dni_Titular->SetDbValueDef($rsnew, $this->Dni_Titular->CurrentValue, NULL, $this->Dni_Titular->ReadOnly);\r\n\r\n\t\t\t// Cuil_Titular\r\n\t\t\t$this->Cuil_Titular->SetDbValueDef($rsnew, $this->Cuil_Titular->CurrentValue, NULL, $this->Cuil_Titular->ReadOnly);\r\n\r\n\t\t\t// Nombre_Tutor\r\n\t\t\t$this->Nombre_Tutor->SetDbValueDef($rsnew, $this->Nombre_Tutor->CurrentValue, NULL, $this->Nombre_Tutor->ReadOnly);\r\n\r\n\t\t\t// DniTutor\r\n\t\t\t$this->DniTutor->SetDbValueDef($rsnew, $this->DniTutor->CurrentValue, NULL, $this->DniTutor->ReadOnly);\r\n\r\n\t\t\t// Domicilio\r\n\t\t\t$this->Domicilio->SetDbValueDef($rsnew, $this->Domicilio->CurrentValue, NULL, $this->Domicilio->ReadOnly);\r\n\r\n\t\t\t// Tel_Tutor\r\n\t\t\t$this->Tel_Tutor->SetDbValueDef($rsnew, $this->Tel_Tutor->CurrentValue, NULL, $this->Tel_Tutor->ReadOnly);\r\n\r\n\t\t\t// CelTutor\r\n\t\t\t$this->CelTutor->SetDbValueDef($rsnew, $this->CelTutor->CurrentValue, NULL, $this->CelTutor->ReadOnly);\r\n\r\n\t\t\t// Cue_Establecimiento_Alta\r\n\t\t\t$this->Cue_Establecimiento_Alta->SetDbValueDef($rsnew, $this->Cue_Establecimiento_Alta->CurrentValue, NULL, $this->Cue_Establecimiento_Alta->ReadOnly);\r\n\r\n\t\t\t// Escuela_Alta\r\n\t\t\t$this->Escuela_Alta->SetDbValueDef($rsnew, $this->Escuela_Alta->CurrentValue, NULL, $this->Escuela_Alta->ReadOnly);\r\n\r\n\t\t\t// Directivo_Alta\r\n\t\t\t$this->Directivo_Alta->SetDbValueDef($rsnew, $this->Directivo_Alta->CurrentValue, NULL, $this->Directivo_Alta->ReadOnly);\r\n\r\n\t\t\t// Cuil_Directivo_Alta\r\n\t\t\t$this->Cuil_Directivo_Alta->SetDbValueDef($rsnew, $this->Cuil_Directivo_Alta->CurrentValue, NULL, $this->Cuil_Directivo_Alta->ReadOnly);\r\n\r\n\t\t\t// Dpto_Esc_alta\r\n\t\t\t$this->Dpto_Esc_alta->SetDbValueDef($rsnew, $this->Dpto_Esc_alta->CurrentValue, NULL, $this->Dpto_Esc_alta->ReadOnly);\r\n\r\n\t\t\t// Localidad_Esc_Alta\r\n\t\t\t$this->Localidad_Esc_Alta->SetDbValueDef($rsnew, $this->Localidad_Esc_Alta->CurrentValue, NULL, $this->Localidad_Esc_Alta->ReadOnly);\r\n\r\n\t\t\t// Domicilio_Esc_Alta\r\n\t\t\t$this->Domicilio_Esc_Alta->SetDbValueDef($rsnew, $this->Domicilio_Esc_Alta->CurrentValue, NULL, $this->Domicilio_Esc_Alta->ReadOnly);\r\n\r\n\t\t\t// Rte_Alta\r\n\t\t\t$this->Rte_Alta->SetDbValueDef($rsnew, $this->Rte_Alta->CurrentValue, NULL, $this->Rte_Alta->ReadOnly);\r\n\r\n\t\t\t// Tel_Rte_Alta\r\n\t\t\t$this->Tel_Rte_Alta->SetDbValueDef($rsnew, $this->Tel_Rte_Alta->CurrentValue, NULL, $this->Tel_Rte_Alta->ReadOnly);\r\n\r\n\t\t\t// Email_Rte_Alta\r\n\t\t\t$this->Email_Rte_Alta->SetDbValueDef($rsnew, $this->Email_Rte_Alta->CurrentValue, NULL, $this->Email_Rte_Alta->ReadOnly);\r\n\r\n\t\t\t// Serie_Server_Alta\r\n\t\t\t$this->Serie_Server_Alta->SetDbValueDef($rsnew, $this->Serie_Server_Alta->CurrentValue, NULL, $this->Serie_Server_Alta->ReadOnly);\r\n\r\n\t\t\t// Cue_Establecimiento_Baja\r\n\t\t\t$this->Cue_Establecimiento_Baja->SetDbValueDef($rsnew, $this->Cue_Establecimiento_Baja->CurrentValue, NULL, $this->Cue_Establecimiento_Baja->ReadOnly);\r\n\r\n\t\t\t// Escuela_Baja\r\n\t\t\t$this->Escuela_Baja->SetDbValueDef($rsnew, $this->Escuela_Baja->CurrentValue, NULL, $this->Escuela_Baja->ReadOnly);\r\n\r\n\t\t\t// Directivo_Baja\r\n\t\t\t$this->Directivo_Baja->SetDbValueDef($rsnew, $this->Directivo_Baja->CurrentValue, NULL, $this->Directivo_Baja->ReadOnly);\r\n\r\n\t\t\t// Cuil_Directivo_Baja\r\n\t\t\t$this->Cuil_Directivo_Baja->SetDbValueDef($rsnew, $this->Cuil_Directivo_Baja->CurrentValue, NULL, $this->Cuil_Directivo_Baja->ReadOnly);\r\n\r\n\t\t\t// Dpto_Esc_Baja\r\n\t\t\t$this->Dpto_Esc_Baja->SetDbValueDef($rsnew, $this->Dpto_Esc_Baja->CurrentValue, NULL, $this->Dpto_Esc_Baja->ReadOnly);\r\n\r\n\t\t\t// Localidad_Esc_Baja\r\n\t\t\t$this->Localidad_Esc_Baja->SetDbValueDef($rsnew, $this->Localidad_Esc_Baja->CurrentValue, NULL, $this->Localidad_Esc_Baja->ReadOnly);\r\n\r\n\t\t\t// Domicilio_Esc_Baja\r\n\t\t\t$this->Domicilio_Esc_Baja->SetDbValueDef($rsnew, $this->Domicilio_Esc_Baja->CurrentValue, NULL, $this->Domicilio_Esc_Baja->ReadOnly);\r\n\r\n\t\t\t// Rte_Baja\r\n\t\t\t$this->Rte_Baja->SetDbValueDef($rsnew, $this->Rte_Baja->CurrentValue, NULL, $this->Rte_Baja->ReadOnly);\r\n\r\n\t\t\t// Tel_Rte_Baja\r\n\t\t\t$this->Tel_Rte_Baja->SetDbValueDef($rsnew, $this->Tel_Rte_Baja->CurrentValue, NULL, $this->Tel_Rte_Baja->ReadOnly);\r\n\r\n\t\t\t// Email_Rte_Baja\r\n\t\t\t$this->Email_Rte_Baja->SetDbValueDef($rsnew, $this->Email_Rte_Baja->CurrentValue, NULL, $this->Email_Rte_Baja->ReadOnly);\r\n\r\n\t\t\t// Serie_Server_Baja\r\n\t\t\t$this->Serie_Server_Baja->SetDbValueDef($rsnew, $this->Serie_Server_Baja->CurrentValue, NULL, $this->Serie_Server_Baja->ReadOnly);\r\n\r\n\t\t\t// Fecha_Pase\r\n\t\t\t$this->Fecha_Pase->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->Fecha_Pase->CurrentValue, 7), NULL, $this->Fecha_Pase->ReadOnly);\r\n\r\n\t\t\t// Id_Estado_Pase\r\n\t\t\t$this->Id_Estado_Pase->SetDbValueDef($rsnew, $this->Id_Estado_Pase->CurrentValue, 0, $this->Id_Estado_Pase->ReadOnly);\r\n\r\n\t\t\t// Ruta_Archivo\r\n\t\t\tif ($this->Ruta_Archivo->Visible && !$this->Ruta_Archivo->ReadOnly && !$this->Ruta_Archivo->Upload->KeepFile) {\r\n\t\t\t\t$this->Ruta_Archivo->Upload->DbValue = $rsold['Ruta_Archivo']; // Get original value\r\n\t\t\t\tif ($this->Ruta_Archivo->Upload->FileName == \"\") {\r\n\t\t\t\t\t$rsnew['Ruta_Archivo'] = NULL;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$rsnew['Ruta_Archivo'] = $this->Ruta_Archivo->Upload->FileName;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($this->Ruta_Archivo->Visible && !$this->Ruta_Archivo->Upload->KeepFile) {\r\n\t\t\t\t$this->Ruta_Archivo->UploadPath = 'ArchivosPase';\r\n\t\t\t\t$OldFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->DbValue);\r\n\t\t\t\tif (!ew_Empty($this->Ruta_Archivo->Upload->FileName)) {\r\n\t\t\t\t\t$NewFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->FileName);\r\n\t\t\t\t\t$FileCount = count($NewFiles);\r\n\t\t\t\t\tfor ($i = 0; $i < $FileCount; $i++) {\r\n\t\t\t\t\t\t$fldvar = ($this->Ruta_Archivo->Upload->Index < 0) ? $this->Ruta_Archivo->FldVar : substr($this->Ruta_Archivo->FldVar, 0, 1) . $this->Ruta_Archivo->Upload->Index . substr($this->Ruta_Archivo->FldVar, 1);\r\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\r\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\r\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file)) {\r\n\t\t\t\t\t\t\t\tif (!in_array($file, $OldFiles)) {\r\n\t\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $this->Ruta_Archivo->UploadPath), $file); // Get new file name\r\n\t\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\r\n\t\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file1)) // Make sure did not clash with existing upload file\r\n\t\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename(ew_UploadPathEx(TRUE, $this->Ruta_Archivo->UploadPath), $file1, TRUE); // Use indexed name\r\n\t\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file, ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file1);\r\n\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->Ruta_Archivo->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\r\n\t\t\t\t\t$rsnew['Ruta_Archivo'] = $this->Ruta_Archivo->Upload->FileName;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$NewFiles = array();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t\tif ($this->Ruta_Archivo->Visible && !$this->Ruta_Archivo->Upload->KeepFile) {\r\n\t\t\t\t\t\t$OldFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->DbValue);\r\n\t\t\t\t\t\tif (!ew_Empty($this->Ruta_Archivo->Upload->FileName)) {\r\n\t\t\t\t\t\t\t$NewFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->FileName);\r\n\t\t\t\t\t\t\t$NewFiles2 = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $rsnew['Ruta_Archivo']);\r\n\t\t\t\t\t\t\t$FileCount = count($NewFiles);\r\n\t\t\t\t\t\t\tfor ($i = 0; $i < $FileCount; $i++) {\r\n\t\t\t\t\t\t\t\t$fldvar = ($this->Ruta_Archivo->Upload->Index < 0) ? $this->Ruta_Archivo->FldVar : substr($this->Ruta_Archivo->FldVar, 0, 1) . $this->Ruta_Archivo->Upload->Index . substr($this->Ruta_Archivo->FldVar, 1);\r\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\r\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $NewFiles[$i];\r\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\r\n\t\t\t\t\t\t\t\t\t\t$this->Ruta_Archivo->Upload->SaveToFile($this->Ruta_Archivo->UploadPath, (@$NewFiles2[$i] <> \"\") ? $NewFiles2[$i] : $NewFiles[$i], TRUE, $i); // Just replace\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$NewFiles = array();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$FileCount = count($OldFiles);\r\n\t\t\t\t\t\tfor ($i = 0; $i < $FileCount; $i++) {\r\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\r\n\t\t\t\t\t\t\t\t@unlink(ew_UploadPathEx(TRUE, $this->Ruta_Archivo->OldUploadPath) . $OldFiles[$i]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\r\n\t\t// Ruta_Archivo\r\n\t\tew_CleanUploadTempPath($this->Ruta_Archivo, $this->Ruta_Archivo->Upload->Index);\r\n\t\treturn $EditRow;\r\n\t}", "public function validateTableData($postArray,$editId) \n{\n \n $fldErrors=array();\n $tblErrors=array();\n $errorMesg=array();\n \n $fldErrors=$this->validateFieldData($postArray);\n \n $tblErrors=$this->validateTableDataToFile($postArray,$editId); \n\n $errorMesg=$this->mergeErrorArrays($fldErrors,$tblErrors);\n \n return $errorMesg;\n \n}", "public function validationUpdate()\n\t{\n\t\t$validationUpdate=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\t$validationUpdate[]=array(\n\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t'maxlength'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t'required'=>$row['Null']=='NO' ? '\\'required\\'=>true,' : false,\n\t\t\t\t'email'=>preg_match('/email/',$row['Field']) ? '\\'email\\'=>true,' : false,\n\t\t\t);\n\t\t}\n\t\treturn $validationUpdate;\n\t}", "function check_del($rowindex) {\r\n /* called on row delete validation */\r\n return True;\r\n }", "function check_insert($i) {\r\n $no_error = True;\r\n\r\n foreach ($this->properties as $colvar=>$col) {\r\n #~ if (strpos($colvar,'_phone') !== false or strpos($colvar,'_fax') !== false) {\r\n if (strpos($colvar,'_phone') === false and strpos($colvar,'_fax') === false) continue;\r\n #~ if (!preg_match('/[,\\-\\/]/',$this->ds->{$colvar}[$i])) continue;\r\n if (!preg_match('/[^0-9 ]/',$this->ds->{$colvar}[$i])) continue;\r\n $this->error_msgs[] = \"[\".($i+1).\"] {$col->label} must be numeric only\";\r\n #~ $this->error_msgs[] = \"[\".($i+1).\"] {$col->label} must not contain these characters: , / -\";\r\n $this->error_rows[$i] = True;\r\n $no_error = False;\r\n }\r\n\r\n # place holder function\r\n if ($this->ds->total[$i] == 0) {\r\n $this->error_msgs[] = \"[\".($i+1).\"] Total must not zero\";\r\n $this->error_rows[$i] = True;\r\n $no_error = False;\r\n }\r\n\r\n if ($this->ds->list_price[$i] == 0) {\r\n $this->error_msgs[] = \"[\".($i+1).\"] List price must not zero\";\r\n $this->error_rows[$i] = True;\r\n $no_error = False;\r\n }\r\n $this->ds->cu_name[$i] = strtoupper($this->ds->cu_name[$i]);\r\n\r\n return $no_error;\r\n }", "public function validate_and_convert_id($insert_data)\r\n {\r\n // Perform type cast to ensure it is array\r\n //$insert_data = (array) $insert_data;\r\n \r\n if($this->is_error === true){return;}\r\n \r\n // Convert name to id name\r\n $insert_data = $this->_convert_id($insert_data);\r\n \r\n $new_dataset = array();\r\n $data_hit = false;\r\n \r\n if($this->is_error === true){return;}\r\n\r\n // Validate the column and transfer data\r\n foreach ($this->column_list() as $checker)\r\n {\r\n $column = $checker[\"name\"];\r\n\r\n // @todo - strict check, as currently as the key exist it allow it to be pass\r\n if(array_key_exists($column, $insert_data))\r\n {\r\n $new_dataset[$column] = $insert_data[$column];\r\n $data_hit = true;\r\n }\r\n elseif ($checker[\"must_have\"] === true)\r\n {\r\n $display_list = json_encode($insert_data);\r\n $this->set_error(\r\n \"MBE-\".$this->model_code.\"-VACI-1\", \r\n \"Internal error, please contact admin\", \r\n \"Missing $column in $display_list for model \".$this->model_name);\r\n }\r\n }\r\n \r\n return $new_dataset;\r\n }", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$rsnew = array();\n\n\t\t\t// nomr\n\t\t\t$this->nomr->SetDbValueDef($rsnew, $this->nomr->CurrentValue, \"\", $this->nomr->ReadOnly);\n\n\t\t\t// ket_nama\n\t\t\t$this->ket_nama->SetDbValueDef($rsnew, $this->ket_nama->CurrentValue, NULL, $this->ket_nama->ReadOnly);\n\n\t\t\t// ket_tgllahir\n\t\t\t$this->ket_tgllahir->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->ket_tgllahir->CurrentValue, 0), NULL, $this->ket_tgllahir->ReadOnly);\n\n\t\t\t// ket_alamat\n\t\t\t$this->ket_alamat->SetDbValueDef($rsnew, $this->ket_alamat->CurrentValue, NULL, $this->ket_alamat->ReadOnly);\n\n\t\t\t// ket_jeniskelamin\n\t\t\t$this->ket_jeniskelamin->SetDbValueDef($rsnew, $this->ket_jeniskelamin->CurrentValue, NULL, $this->ket_jeniskelamin->ReadOnly);\n\n\t\t\t// ket_title\n\t\t\t$this->ket_title->SetDbValueDef($rsnew, $this->ket_title->CurrentValue, NULL, $this->ket_title->ReadOnly);\n\n\t\t\t// dokterpengirim\n\t\t\t$this->dokterpengirim->SetDbValueDef($rsnew, $this->dokterpengirim->CurrentValue, 0, $this->dokterpengirim->ReadOnly);\n\n\t\t\t// statusbayar\n\t\t\t$this->statusbayar->SetDbValueDef($rsnew, $this->statusbayar->CurrentValue, 0, $this->statusbayar->ReadOnly);\n\n\t\t\t// kirimdari\n\t\t\t$this->kirimdari->SetDbValueDef($rsnew, $this->kirimdari->CurrentValue, 0, $this->kirimdari->ReadOnly);\n\n\t\t\t// keluargadekat\n\t\t\t$this->keluargadekat->SetDbValueDef($rsnew, $this->keluargadekat->CurrentValue, \"\", $this->keluargadekat->ReadOnly);\n\n\t\t\t// panggungjawab\n\t\t\t$this->panggungjawab->SetDbValueDef($rsnew, $this->panggungjawab->CurrentValue, \"\", $this->panggungjawab->ReadOnly);\n\n\t\t\t// masukrs\n\t\t\t$this->masukrs->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->masukrs->CurrentValue, 0), NULL, $this->masukrs->ReadOnly);\n\n\t\t\t// noruang\n\t\t\t$this->noruang->SetDbValueDef($rsnew, $this->noruang->CurrentValue, 0, $this->noruang->ReadOnly);\n\n\t\t\t// tempat_tidur_id\n\t\t\t$this->tempat_tidur_id->SetDbValueDef($rsnew, $this->tempat_tidur_id->CurrentValue, 0, $this->tempat_tidur_id->ReadOnly);\n\n\t\t\t// nott\n\t\t\t$this->nott->SetDbValueDef($rsnew, $this->nott->CurrentValue, \"\", $this->nott->ReadOnly);\n\n\t\t\t// NIP\n\t\t\t$this->NIP->SetDbValueDef($rsnew, $this->NIP->CurrentValue, \"\", $this->NIP->ReadOnly);\n\n\t\t\t// dokter_penanggungjawab\n\t\t\t$this->dokter_penanggungjawab->SetDbValueDef($rsnew, $this->dokter_penanggungjawab->CurrentValue, 0, $this->dokter_penanggungjawab->ReadOnly);\n\n\t\t\t// KELASPERAWATAN_ID\n\t\t\t$this->KELASPERAWATAN_ID->SetDbValueDef($rsnew, $this->KELASPERAWATAN_ID->CurrentValue, NULL, $this->KELASPERAWATAN_ID->ReadOnly);\n\n\t\t\t// NO_SKP\n\t\t\t$this->NO_SKP->SetDbValueDef($rsnew, $this->NO_SKP->CurrentValue, NULL, $this->NO_SKP->ReadOnly);\n\n\t\t\t// sep_tglsep\n\t\t\t$this->sep_tglsep->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglsep->CurrentValue, 5), NULL, $this->sep_tglsep->ReadOnly);\n\n\t\t\t// sep_tglrujuk\n\t\t\t$this->sep_tglrujuk->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglrujuk->CurrentValue, 5), NULL, $this->sep_tglrujuk->ReadOnly);\n\n\t\t\t// sep_kodekelasrawat\n\t\t\t$this->sep_kodekelasrawat->SetDbValueDef($rsnew, $this->sep_kodekelasrawat->CurrentValue, NULL, $this->sep_kodekelasrawat->ReadOnly);\n\n\t\t\t// sep_norujukan\n\t\t\t$this->sep_norujukan->SetDbValueDef($rsnew, $this->sep_norujukan->CurrentValue, NULL, $this->sep_norujukan->ReadOnly);\n\n\t\t\t// sep_kodeppkasal\n\t\t\t$this->sep_kodeppkasal->SetDbValueDef($rsnew, $this->sep_kodeppkasal->CurrentValue, NULL, $this->sep_kodeppkasal->ReadOnly);\n\n\t\t\t// sep_namappkasal\n\t\t\t$this->sep_namappkasal->SetDbValueDef($rsnew, $this->sep_namappkasal->CurrentValue, NULL, $this->sep_namappkasal->ReadOnly);\n\n\t\t\t// sep_kodeppkpelayanan\n\t\t\t$this->sep_kodeppkpelayanan->SetDbValueDef($rsnew, $this->sep_kodeppkpelayanan->CurrentValue, NULL, $this->sep_kodeppkpelayanan->ReadOnly);\n\n\t\t\t// sep_jenisperawatan\n\t\t\t$this->sep_jenisperawatan->SetDbValueDef($rsnew, $this->sep_jenisperawatan->CurrentValue, NULL, $this->sep_jenisperawatan->ReadOnly);\n\n\t\t\t// sep_catatan\n\t\t\t$this->sep_catatan->SetDbValueDef($rsnew, $this->sep_catatan->CurrentValue, NULL, $this->sep_catatan->ReadOnly);\n\n\t\t\t// sep_kodediagnosaawal\n\t\t\t$this->sep_kodediagnosaawal->SetDbValueDef($rsnew, $this->sep_kodediagnosaawal->CurrentValue, NULL, $this->sep_kodediagnosaawal->ReadOnly);\n\n\t\t\t// sep_namadiagnosaawal\n\t\t\t$this->sep_namadiagnosaawal->SetDbValueDef($rsnew, $this->sep_namadiagnosaawal->CurrentValue, NULL, $this->sep_namadiagnosaawal->ReadOnly);\n\n\t\t\t// sep_lakalantas\n\t\t\t$this->sep_lakalantas->SetDbValueDef($rsnew, $this->sep_lakalantas->CurrentValue, NULL, $this->sep_lakalantas->ReadOnly);\n\n\t\t\t// sep_lokasilaka\n\t\t\t$this->sep_lokasilaka->SetDbValueDef($rsnew, $this->sep_lokasilaka->CurrentValue, NULL, $this->sep_lokasilaka->ReadOnly);\n\n\t\t\t// sep_user\n\t\t\t$this->sep_user->SetDbValueDef($rsnew, $this->sep_user->CurrentValue, NULL, $this->sep_user->ReadOnly);\n\n\t\t\t// sep_flag_cekpeserta\n\t\t\t$this->sep_flag_cekpeserta->SetDbValueDef($rsnew, $this->sep_flag_cekpeserta->CurrentValue, NULL, $this->sep_flag_cekpeserta->ReadOnly);\n\n\t\t\t// sep_flag_generatesep\n\t\t\t$this->sep_flag_generatesep->SetDbValueDef($rsnew, $this->sep_flag_generatesep->CurrentValue, NULL, $this->sep_flag_generatesep->ReadOnly);\n\n\t\t\t// sep_nik\n\t\t\t$this->sep_nik->SetDbValueDef($rsnew, $this->sep_nik->CurrentValue, NULL, $this->sep_nik->ReadOnly);\n\n\t\t\t// sep_namapeserta\n\t\t\t$this->sep_namapeserta->SetDbValueDef($rsnew, $this->sep_namapeserta->CurrentValue, NULL, $this->sep_namapeserta->ReadOnly);\n\n\t\t\t// sep_jeniskelamin\n\t\t\t$this->sep_jeniskelamin->SetDbValueDef($rsnew, $this->sep_jeniskelamin->CurrentValue, NULL, $this->sep_jeniskelamin->ReadOnly);\n\n\t\t\t// sep_pisat\n\t\t\t$this->sep_pisat->SetDbValueDef($rsnew, $this->sep_pisat->CurrentValue, NULL, $this->sep_pisat->ReadOnly);\n\n\t\t\t// sep_tgllahir\n\t\t\t$this->sep_tgllahir->SetDbValueDef($rsnew, $this->sep_tgllahir->CurrentValue, NULL, $this->sep_tgllahir->ReadOnly);\n\n\t\t\t// sep_kodejeniskepesertaan\n\t\t\t$this->sep_kodejeniskepesertaan->SetDbValueDef($rsnew, $this->sep_kodejeniskepesertaan->CurrentValue, NULL, $this->sep_kodejeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_namajeniskepesertaan\n\t\t\t$this->sep_namajeniskepesertaan->SetDbValueDef($rsnew, $this->sep_namajeniskepesertaan->CurrentValue, NULL, $this->sep_namajeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_nokabpjs\n\t\t\t$this->sep_nokabpjs->SetDbValueDef($rsnew, $this->sep_nokabpjs->CurrentValue, NULL, $this->sep_nokabpjs->ReadOnly);\n\n\t\t\t// sep_status_peserta\n\t\t\t$this->sep_status_peserta->SetDbValueDef($rsnew, $this->sep_status_peserta->CurrentValue, NULL, $this->sep_status_peserta->ReadOnly);\n\n\t\t\t// sep_umur_pasien_sekarang\n\t\t\t$this->sep_umur_pasien_sekarang->SetDbValueDef($rsnew, $this->sep_umur_pasien_sekarang->CurrentValue, NULL, $this->sep_umur_pasien_sekarang->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "abstract public function validate(array $data, array $fields);", "function fn_check_table_fields($data, $table_name, $dbc_name = '')\n{\n\t$_fields = fn_get_table_fields($table_name, array(), false, $dbc_name);\n\tif (is_array($_fields)) {\n\t\tforeach ($data as $k => $v) {\n\t\t\tif (!in_array($k, $_fields)) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\tif (func_num_args() > 3) {\n\t\t\tfor ($i = 3; $i < func_num_args(); $i++) {\n\t\t\t\tunset($data[func_get_arg($i)]);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}\n\treturn false;\n}", "public function testValidatorForRequiredForEmpty()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n // Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n 'datasource_name' => '',\n 'table_id' => null,\n 'starting_row_number' => null,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data doesn't update\n $this->assertEquals($postDataAdd['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($postDataAdd['table_id'], $updatedTable->table_id);\n $this->assertEquals($postDataAdd['starting_row_number'], $updatedTable->starting_row_number);\n\n\n //Check response\n $updateResponse\n ->assertStatus(422)\n ->assertJsonFragment([\n \"datasource_name\" => [\"データソース名は必ず指定してください。\"],\n \"starting_row_number\" => [\"開始行は必ず指定してください。\"],\n \"table_id\" => [\"テーブルIDは必ず指定してください。\"],\n ]);\n }", "public function isValid() {\n\n foreach ($this->entity as $nameColumn => $column) {\n\n $validate = null;\n // Se for chave primaria e tiver valor, valida inteiro somente sem nenhuma outra validacao.\n if ($column['contraint'] == 'pk' && $column['value']) {\n $validate = new Zend_Validate_Digits();\n } else {\n\n//______________________________________________________________________________ VALIDANDO POR TIPO DA COLUNA NO BANCO\n // Se tiver valor comeca validacoes de acordo com o tipo.\n // Se nao pergunta se é obrigatorio, se for obrigatorio valida.\n if ($column['value']) {\n // Se for inteiro\n if ($column['type'] == 'integer' || $column['type'] == 'smallint') {\n $validate = new Zend_Validate_Digits();\n // Se for data\n } else if ($column['type'] == 'numeric') {\n $column['value'] = str_replace('.', '', $column['value']);\n $column['value'] = (float) str_replace(',', '.', $column['value']);\n $validate = new Zend_Validate_Float();\n } else if ($column['type'] == 'date') {\n\n\t\t\t\t\t\t$posBarra = strpos($column['value'], '/');\n\t\t\t\t\t\t$pos = strpos($column['value'], '-');\n\t\t\t\t\t\tif ($posBarra !== false) {\n\t\t\t\t\t\t\t$date = explode('/', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[0], $date[2])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\t$date = explode('-', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[2], $date[0])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n // Se for texto\n } else if ($column['type'] == 'character' || $column['type'] == 'character varying') {\n\n // Se for Bollean\n } else if ($column['type'] == 'boolean') {\n\n // Se for texto\n } else if ($column['type'] == 'text') {\n \n } else if ($column['type'] == 'timestamp without time zone') {\n if (strpos($column['value'], '/')) {\n\n if (strpos($column['value'], ' ')) {\n $arrDate = explode(' ', $column['value']);\n\n // Validando a data\n $date = explode('/', $arrDate[0]);\n if (!checkdate($date[1], $arrDate[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[0] . self::MSG_DATA_INVALIDA));\n }\n\n // Validando a hora\n $validateTime = new Zend_Validate_Date('hh:mm');\n $validateTime->isValid($arrDate[1]);\n if ($validateTime->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[1] . self::MSG_DATA_HORA_INVALIDA));\n }\n } else {\n // Validando a data\n $date = explode('/', trim($column['value']));\n if (!checkdate($date[1], $date[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n }\n }\n }\n }\n\n//______________________________________________________________________________ VALIDANDO POR LIMITE DA COLUNA NO BANCO\n // Validando quantidade de caracteres.\n if ($column['maximum']) {\n $validateMax = new Zend_Validate_StringLength(array('max' => $column['maximum']));\n $validateMax->isValid($column['value']);\n if ($validateMax->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => (reset($validateMax->getMessages())));\n }\n $validateMax = null;\n }\n } else {\n//______________________________________________________________________________ VALIDANDO POR NAO VAZIO DA COLUNA NO BANCO\n // Validando se nao tiver valor e ele for obrigatorio.\n if ($column['is_null'] == 'NO' && $column['contraint'] != 'pk') {\n $validate = new Zend_Validate_NotEmpty();\n }\n }\n\n//______________________________________________________________________________ VALIDANDO A CLOUNA E COLOCANDO A MENSAGEM\n if ($validate) {\n $validate->isValid($column['value']);\n if ($validate->getErrors()) {\n\t\t\t\t\t\t$msg = $validate->getMessages();\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ( reset($msg) ));\n }\n\n $validate = null;\n }\n }\n }\n\t\t\n if ($this->error)\n return false;\n else\n return true;\n }", "public function DataIsValid()\n {\n $bDataIsValid = parent::DataIsValid();\n if ($this->HasContent() && $bDataIsValid) {\n if (intval($this->data) < 12 && intval($this->data) >= -11) {\n $bDataIsValid = true;\n } else {\n $bDataIsValid = false;\n $oMessageManager = TCMSMessageManager::GetInstance();\n $sConsumerName = TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER;\n $sFieldTitle = $this->oDefinition->GetName();\n $oMessageManager->AddMessage($sConsumerName, 'TABLEEDITOR_FIELD_TIMEZONE_NOT_VALID', array('sFieldName' => $this->name, 'sFieldTitle' => $sFieldTitle));\n }\n }\n\n return $bDataIsValid;\n }" ]
[ "0.65720755", "0.65195394", "0.64467067", "0.63926315", "0.63761115", "0.6222439", "0.6207895", "0.6151898", "0.61306554", "0.6127452", "0.6084676", "0.6047883", "0.60110384", "0.5918179", "0.5876885", "0.5859545", "0.5847386", "0.58383036", "0.57409394", "0.57371116", "0.56803364", "0.5645451", "0.56291115", "0.5620307", "0.56034046", "0.55802786", "0.55777335", "0.55765355", "0.5570389", "0.55526423", "0.5538929", "0.553747", "0.5502374", "0.54980934", "0.5491567", "0.548786", "0.54847246", "0.54664135", "0.5465247", "0.5447735", "0.54386467", "0.5432613", "0.542707", "0.5418984", "0.5396628", "0.5375231", "0.5359407", "0.5336008", "0.5332805", "0.53327656", "0.5324134", "0.5322319", "0.53212816", "0.5315293", "0.5309877", "0.5290316", "0.5267977", "0.5262515", "0.52515715", "0.5247182", "0.52450895", "0.5224564", "0.52216053", "0.5208785", "0.5206839", "0.52042997", "0.5173821", "0.51668876", "0.5166174", "0.5162427", "0.51592535", "0.51592535", "0.5152024", "0.51520187", "0.51467514", "0.51460105", "0.51428634", "0.51387805", "0.5135269", "0.5131426", "0.5126342", "0.5126314", "0.5122765", "0.5121441", "0.51163614", "0.5104675", "0.51037616", "0.51004523", "0.50962394", "0.509219", "0.5090552", "0.50892675", "0.5088735", "0.5085309", "0.5083643", "0.5082458", "0.5079454", "0.50790566", "0.506039", "0.505196" ]
0.66200906
0
Validate row data for delete behaviour
public function validateRowForDelete(array $rowData, $rowNumber) { if (empty($rowData[self::COLUMN_RULE_ID])) { $this->addRowError(self::ERROR_RULE_ID_IS_EMPTY, $rowNumber); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_del($rowindex) {\r\n /* called on row delete validation */\r\n return True;\r\n }", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "protected function _validateRowForDelete(array $rowData, $rowNumber)\n {\n if ($this->_checkUniqueKey($rowData, $rowNumber)) {\n $email = strtolower($rowData[self::COLUMN_EMAIL]);\n $website = $rowData[self::COLUMN_WEBSITE];\n $addressId = $rowData[self::COLUMN_ADDRESS_ID];\n\n $customerId = $this->_getCustomerId($email, $website);\n if ($customerId === false) {\n $this->addRowError(self::ERROR_CUSTOMER_NOT_FOUND, $rowNumber);\n } else {\n if (!strlen($addressId)) {\n $this->addRowError(self::ERROR_ADDRESS_ID_IS_EMPTY, $rowNumber);\n } elseif (!$this->addressStorage->doesExist(\n (string)$addressId,\n (string)$customerId\n )) {\n $this->addRowError(self::ERROR_ADDRESS_NOT_FOUND, $rowNumber);\n }\n }\n }\n }", "public function deleteRow($row);", "public function validateMultiDelete()\n {\n return true;\n }", "public static function deleteData($row){\n\n\t\t$result = DB::delete($row['table'])->where('id', $row['id'])->execute();\n\t\treturn 1;\n\n\t}", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['Id_Item'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "public function checkIsValidForDelete() {\n $errors = false;\n if(strlen(trim($this->idGroup)) == 0){\n $errors = \"Group identifier is mandatory\";\n }else if(!preg_match('/^\\d+$/', $this->idGroup)){\n $errors = \"Group identifier format is invalid\";\n }else if($this->existsGroup() !== true) {\n $errors = \"Group doesn't exist\";\n }\n return $errors;\n }", "public function validateDelete ($postArray,$editId) \n{\n $retMesg='';\n return $retMesg;\n\n}", "function DeleteRows() {\n\t\tglobal $conn, $Security, $patient_detail;\n\t\t$DeleteRows = TRUE;\n\t\t$sWrkFilter = $patient_detail->CurrentFilter;\n\n\t\t// Set up filter (Sql Where Clause) and get Return SQL\n\t\t// SQL constructor in patient_detail class, patient_detailinfo.php\n\n\t\t$patient_detail->CurrentFilter = $sWrkFilter;\n\t\t$sSql = $patient_detail->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setMessage(\"No records found\"); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\n\t\tif ($rs) $rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $patient_detail->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;\n\t\t\t\t$sThisKey .= $row['DetailNo'];\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\t$DeleteRows = $conn->Execute($patient_detail->DeleteSQL($row)); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($patient_detail->CancelMessage <> \"\") {\n\t\t\t\t$this->setMessage($patient_detail->CancelMessage);\n\t\t\t\t$patient_detail->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setMessage(\"Delete cancelled\");\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call recordset deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$patient_detail->Row_Deleted($row);\n\t\t\t}\t\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['Id_tercero'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['id'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "public function delete_form_db($conn,$table,$condition_column,$condition_data,$userid){\r\n $query=\"DELETE FROM \".$table.\" WHERE \".$condition_column.\"= :data AND user_id= \".$userid;\r\n $get=$conn->prepare($query);\r\n $get->bindValue(':data', $condition_data);\r\n if($get->execute()){return true;}\r\n\r\n\r\n}", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['id'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t}\n\t\tif (!$DeleteRows) {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "function delete()\n {\n if ($this->GET('sure')) {\n $function = basename($this->table->tablename()) . \"_onRowDelete\";\n if (function_exists($function)) {\n $function($this->table->data($this->GET('id')), &$this->table);\n }\n\n $this->table->delete($this->GET('id'));\n $this->table->write();\n $this->browse();\n return;\n }\n $this->displayHead();\n echo 'Do you really want to<br>delete row \\'' . $this->GET('id') . '\\'?<p>';\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=delete&table=' . $this->table->tablename() . '&id=' . $this->GET('id') . '&sure=1\">Yes</a> | ';\n echo '<a href=\"' . $this->SELF . '?method=browse&table=' . $this->table->tablename() . '\">No</a>';\n }", "function DeleteRows() {\r\n\t\tglobal $conn, $Language, $Security, $rekeningju;\r\n\t\t$DeleteRows = TRUE;\r\n\t\t$sSql = $rekeningju->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\r\n\t\t\t$rs->Close();\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tif (!$Security->CanDelete()) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t// Clone old rows\r\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\r\n\t\tif ($rs)\r\n\t\t\t$rs->Close();\r\n\r\n\t\t// Call row deleting event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$DeleteRows = $rekeningju->Row_Deleting($row);\r\n\t\t\t\tif (!$DeleteRows) break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t\t$sKey = \"\";\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$sThisKey = \"\";\r\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;\r\n\t\t\t\t$sThisKey .= $row['kode_otomatis'];\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\t$DeleteRows = $conn->Execute($rekeningju->DeleteSQL($row)); // Delete\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($DeleteRows === FALSE)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\r\n\t\t\t\t$sKey .= $sThisKey;\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t// Set up error message\r\n\t\t\tif ($rekeningju->CancelMessage <> \"\") {\r\n\t\t\t\t$this->setFailureMessage($rekeningju->CancelMessage);\r\n\t\t\t\t$rekeningju->CancelMessage = \"\";\r\n\t\t\t} else {\r\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t} else {\r\n\t\t}\r\n\r\n\t\t// Call Row Deleted event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$rekeningju->Row_Deleted($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $DeleteRows;\r\n\t}", "public function deleteRow(Request $request)\n {\n $result=MyRow::where('id',$request->id)->delete();\n if ($result) echo 'Data Deleted';\n }", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['row_id'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t}\n\t\tif (!$DeleteRows) {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "function delete()\r\n {\r\n $cids = JRequest::getVar( 'cid', array(0), 'post', 'array' );\r\n\r\n $row =& $this->getTable();\r\n\r\n if (count( $cids )) {\r\n foreach($cids as $cid) {\r\n if (!$row->delete( $cid )) {\r\n $this->setError( $row->getErrorMsg() );\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public function deleteData(){\n //buatlah query\n $sqlQuery = \"DELETE FROM \" . $this->t_name . \" WHERE id = ?\";\n\n //persiapkan stmt\n $stmt = $this->conn->prepare($sqlQuery);\n\n //cukup converte id\n $this->id=htmlspecialchars(strip_tags($this->id));\n\n //bind\n $stmt->bindParam(1,$this->id);\n\n //eksekusi\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "public function executeDelete()\n {\n $valid = $this->hasRequiredParameters($this->requiredParams);\n if ($valid instanceof Frapi_Error) {\n return $valid;\n }\n \n return $this->toArray();\n }", "public function testValidateAndDelete() {\r\n\t\ttry {\r\n\t\t\t$postData = array();\r\n\t\t\t$this->ShopProductAttribute->validateAndDelete('invalidShopProductAttributeId', $postData);\r\n\t\t} catch (OutOfBoundsException $e) {\r\n\t\t\t$this->assertEqual($e->getMessage(), 'Invalid Shop Product Attribute');\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t$postData = array(\r\n\t\t\t\t'ShopProductAttribute' => array(\r\n\t\t\t\t\t'confirm' => 0));\r\n\t\t\t$result = $this->ShopProductAttribute->validateAndDelete('shopproductattribute-1', $postData);\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$this->assertEqual($e->getMessage(), 'You need to confirm to delete this Shop Product Attribute');\r\n\t\t}\r\n\r\n\t\t$postData = array(\r\n\t\t\t'ShopProductAttribute' => array(\r\n\t\t\t\t'confirm' => 1));\r\n\t\t$result = $this->ShopProductAttribute->validateAndDelete('shopproductattribute-1', $postData);\r\n\t\t$this->assertTrue($result);\r\n\t}", "function validate_user_delete(array $inputs, array &$form): bool\n{\n if (App::$db->getRowById('wall', $inputs['id'])['poster'] !== $_SESSION['email']) {\n $form['error'] = 'ERROR YOU\\'RE NOT ALLOWED TO DELETE THAT';\n return false;\n }\n\n return true;\n}", "public function checkIsValidForDelete() {\n $errors = false;\n $building = new BUILDING_Model($this->idBuilding);\n if (strlen(trim($this->idBuilding)) == 0) {\n $errors= \"Building identifier is mandatory\";\n }else if (strlen(trim($this->idBuilding)) < 5) {\n $errors = \"Building identifier can't be less than 5 characters\";\n }else if (strlen(trim($this->idBuilding)) > 5) {\n $errors = \"Building identifier can't be larger than 5 characters\";\n }else if(!preg_match('/[A-Z0-9]/', $this->idBuilding)){\n $errors = \"Building identifier format is invalid\";\n }else if(!$building->existsBuilding()){\n $errors = \"There isn't a building with that identifier\";\n }else if (strlen(trim($this->idFloor)) == 0) {\n $errors= \"Floor identifier is mandatory\";\n }else if (strlen(trim($this->idFloor)) < 2) {\n $errors = \"Floor identifier can't be less than 2 characters\";\n }else if (strlen(trim($this->idFloor)) > 2) {\n $errors = \"Floor identifier can't be larger than 2 characters\";\n }else if(!preg_match('/[A-Z0-9]/', $this->idFloor)){\n $errors = \"Floor identifier format is invalid\";\n }else if (!$this->existsFloor()) {\n $errors= \"There isn't a floor with that identifier in the building\";\n }\n return $errors;\n }", "private function Delete()\n {\n $return = false;\n $action = $this->Action();\n $table = $this->Table();\n $where = $this->Where();\n if($action && $table && Checker::isArray($where, false) && isset($where[Where::VALUES]))\n {\n $return[Where::QUERY] = \"$action FROM $table\".$where[Where::QUERY];\n $return[Where::VALUES] = $where[Where::VALUES];\n }\n return $return;\n }", "public function deleteValid($primary) {\t\n\t\tif(!empty($primary)){\n\t\t\tif(is_array($this -> _primary)){\n\t\t\t\t$primaryKey = current($this -> _primary);\n\t\t\t} else {\n\t\t\t\t$primaryKey = $this -> _primary;\n\t\t\t}\n\t\t\t$primary = is_numeric($primary) ? (float) $primary : $this -> quote($primary);\n\t\t\t$row = $this -> fetchRow($primaryKey . \"=\" . $primary);\n\t\t\t\n\t\t\tif(!is_null($row)){\n\t\t\t\treturn $row -> delete();\n\t\t\t} \n\t\t} \n\t\treturn false;\n\t\t\n\t}", "abstract public function validateData();", "function DeleteRows() {\r\n\t\tglobal $conn, $Language, $Security;\r\n\t\t$DeleteRows = TRUE;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\r\n\t\t\t$rs->Close();\r\n\t\t\treturn FALSE;\r\n\t\t} else {\r\n\t\t\t$this->LoadRowValues($rs); // Load row values\r\n\t\t}\r\n\t\tif (!$Security->CanDelete()) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t$conn->BeginTrans();\r\n\r\n\t\t// Clone old rows\r\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\r\n\t\tif ($rs)\r\n\t\t\t$rs->Close();\r\n\r\n\t\t// Call row deleting event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\r\n\t\t\t\tif (!$DeleteRows) break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t\t$sKey = \"\";\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$sThisKey = \"\";\r\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\r\n\t\t\t\t$sThisKey .= $row['identries'];\r\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\r\n\t\t\t\t$sThisKey .= $row['id'];\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($DeleteRows === FALSE)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\r\n\t\t\t\t$sKey .= $sThisKey;\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t// Set up error message\r\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t// Use the message, do nothing\r\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t} else {\r\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t\t$conn->CommitTrans(); // Commit the changes\r\n\t\t} else {\r\n\t\t\t$conn->RollbackTrans(); // Rollback changes\r\n\t\t}\r\n\r\n\t\t// Call Row Deleted event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$this->Row_Deleted($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $DeleteRows;\r\n\t}", "public function testDeleteValidUser() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"user\");\n\n\t\t// create a new User and insert to into mySQL\n\t\t$user = new User(null, $this->VALID_SALT, $this->VALID_HASH, $this->VALID_EMAIL, $this->VALID_NAME);\n\t\t$user->insert($this->getPDO());\n\n\t\t// delete the User from mySQL\n\t\t$this->assertSame($numRows + 1, $this->getConnection()->getRowCount(\"user\"));\n\t\t$user->delete($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoUser = User::getUserByUserId($this->getPDO(), $user->getUserId());\n\t\t$this->assertNull($pdoUser);\n\t\t$this->assertSame($numRows, $this->getConnection()->getRowCount(\"user\"));\n\t}", "public function deleteRow($postArray,$editId,$tableName)\n{\n $retString='';\n \n $retString=$this->deletePreProcessing($postArray,$editId);\n \n $sql=\"delete from $tableName where id=$editId\";\n \n $ret=$this->updateTableData($sql,false);\n \n}", "public function deleteRows() {\n if ($this->db->deleteRows($this->table_name)) {\n $this->db->save();\n return true;\n } else {\n return false;\n }\n }", "function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['pegawai_id'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['tgl_shift'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['khusus_lembur'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['khusus_extra'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['temp_id_auto'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public function delete_invoice_row() {\n\n $deleteFlag = false;\n\n // Count the entries and rows from the invoice\n $count = $this->mockinvoice_model->count_invoice_entries( $_POST[ 'mockInvoiceId' ] );\n\n // Don't delete, but clear the data if it is the last one\n if ( $count[0]->invoiceRowCount == 1 ) {\n // Set null values\n $data = array(\n 'category' => null,\n 'description' => null,\n 'amount' => null\n );\n // Clear the data of the mock invoice row\n $this->mockinvoice_row_model->save( $data, $_POST[ 'mockInvoiceRowId' ] );\n\n // Else, more than 1 row so we delete\n } else {\n // Delete the mock invoice row\n $this->mockinvoice_row_model->delete_where( 'mockInvoiceRowId', $_POST[ 'mockInvoiceRowId' ] );\n $deleteFlag = true;\n }\n\n\n // Send back how many rows there were and if 1 was deleted\n $returnArray[] = array( 'initialCount' => $count, 'rowDeleted' => $deleteFlag );\n $this->json_library->print_array_json_unless_empty( $returnArray );\n }", "function postDelete($request){\r\n global $context;\r\n try{\r\n $data= new $this->model;\r\n $validate=new Validator();\r\n $validate->validate($request->post,[$data->col_pk=>'Requierd|Integer']);\r\n\r\n if(count($request->post)==0){\r\n return $this->view(\"Error/index\",['ErrorNumber'=>0,'ErrorMessage'=>\"Invalid Request !!\"]);\r\n }else{\r\n\r\n $data->data[$data->col_pk]=$request->post[$data->col_pk];\r\n if(!$data->delete()){\r\n if($request->isAjax()) return json_error($data->error);\r\n throw new \\Exception($data->error);\r\n }\r\n if($request->isAjax()) return json_success(\"Delete Success !!\");\r\n redirectTo($context->controller_path.\"/all\");\r\n }\r\n\r\n }\r\n catch (\\Exception $ex)\r\n {\r\n if($request->isAjax()) return json_error($ex->getMessage().$obj->error);\r\n return $this->view(\"Error/index\",['ErrorNumber'=>0,'ErrorMessage'=>$ex->getMessage().$obj->error]);\r\n }\r\n }", "public function deleteUserValidator() {\n return Validator::make($this->request->all(), [\n 'user_id' => 'required|integer'\n ]);\n }", "public function testValidateAndDelete() {\n\t\ttry {\n\t\t\t$postData = array();\n\t\t\t$this->CreditNote->validateAndDelete('invalidCreditNoteId', $postData);\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->assertEqual($e->getMessage(), 'Invalid Credit Note');\n\t\t}\n\t\ttry {\n\t\t\t$postData = array(\n\t\t\t\t'CreditNote' => array(\n\t\t\t\t\t'confirm' => 0));\n\t\t\t$result = $this->CreditNote->validateAndDelete('creditnote-1', $postData);\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertEqual($e->getMessage(), 'You need to confirm to delete this Credit Note');\n\t\t}\n\n\t\t$postData = array(\n\t\t\t'CreditNote' => array(\n\t\t\t\t'confirm' => 1));\n\t\t$result = $this->CreditNote->validateAndDelete('creditnote-1', $postData);\n\t\t$this->assertTrue($result);\n\t}", "function delete() {\n\n validate_submitted_data(array(\n \"id\" => \"required|numeric\"\n ));\n\n $id = $this->input->post('id');\n if ($this->input->post('undo')) {\n if ($this->Sales_Invoices_model->delete($id, true)) {\n echo json_encode(array(\"success\" => true, \"data\" => $this->_row_data($id), \"message\" => lang('record_undone')));\n } else {\n echo json_encode(array(\"success\" => false, lang('error_occurred')));\n }\n } else {\n if ($this->Sales_Invoices_model->delete($id)) {\n echo json_encode(array(\"success\" => true, 'message' => lang('record_deleted')));\n } else {\n echo json_encode(array(\"success\" => false, 'message' => lang('record_cannot_be_deleted')));\n }\n }\n }", "function DeleteRows() {\n\t\tglobal $conn, $Language, $Security;\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['idservicio_medico_prestado'];\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "public function testDeleteValidUser(): void {\n\t\t// Count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"user\");\n\t\t$userId = generateUuidV4();\n\n\t\t$user = new User($userId, $this->VALID_ACTIVATION, $this->VALID_USEREMAIL, $this->VALID_HASH, $this->VALID_USERNAME);\n\t\t$user->insert($this->getPDO());\n\t\t// Delete the User from mySQL\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"user\"));\n\t\t$user->delete($this->getPDO());\n\t\t// Grab the data from mySQL and enforce the User does not exist\n\t\t$pdoUser = User::getUserByUserId($this->getPDO(), $user->getUserId());\n\t\t$this->assertNull($pdoUser);\n\t\t$this->assertEquals($numRows, $this->getConnection()->getRowCount(\"user\"));\n\t}", "public function deleteCar($data){\n //\n if($data['error'] == 0){\n\n $car_id = htmlspecialchars(strip_tags($data['car_id']));\n\n // check if car id exists\n # TO DO -> check if row exists\n // $this->db->query('SELECT `id` FROM '. CARS_TABLE . '');\n $this->db->query('UPDATE ' . CARS_TABLE . ' SET deleted = 1 WHERE id = :car_id');\n \n $this->db->bind(':car_id', $car_id);\n\n # execute\n if($this->db->execute()){\n if ( $this->db->rowCount() >= 1 ){\n return true;\n }else{\n return false;\n }\n }else{\n return false;\n }\n\n }else{\n\n return false;\n }\n \n }", "public function delete()\n\t{\n\t\tif( !isset($this->attributes[static::$primaryKey]) || $this->attributes[static::$primaryKey] <= 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn DataBase::delete(\"DELETE FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $this->attributes[static::$primaryKey]);\n\t}", "public function testDeleteValidReading() : void {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"reading\");\n\n // create a new Reading and insert into mySQL\n $reading = new Reading(null,$this->sensor->getSensorId(), $this->VALID_SENSORVALUE, $this->VALID_SENSORDATETIME);\n $reading->insert($this->getPDO());\n\n // delete the Reading from mySQL\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"reading\"));\n $reading->delete($this->getPDO());\n\n // grab the data from mySQL and enforce the Reading does not exist\n $pdoReading = Reading::getReadingByReadingId($this->getPDO(), $reading->getReadingId());\n $this->assertNull($pdoReading);\n $this->assertEquals($numRows, $this->getConnection()->getRowCount(\"reading\"));\n }", "protected function handle_delete_item_validate($Item, $args)\n {\n /*\n * Return TRUE to allow delete\n * Return array of errors when stopping delete action\n */\n return array();\n }", "function preDelete($record)\n\t{\n\t\tif (is_numeric($record['id']) && $record['id']<=1999)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// return false if type is used\n\t\tif($this->checkFinanceTypeIsUsed($record['id']))\n\t\t{\n\t\t\t$this->display_error(atktext(\"feedback_delete_constrain_error\"));\n\t\t\tdie;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function _onDelete(&$row, $old_row)\n {\n $engine = &$this->data->getProperty('engine');\n if (!$engine->startTransaction()) {\n // This error must be caught here to avoid the rollback\n return false;\n }\n\n // Process the row\n $done = $this->data->deleteRow($row) &&\n $this->_onDbAction('Delete', $row, $old_row);\n $done = $engine->endTransaction($done) && $done;\n\n return $done;\n }", "public function validateDelete(array $input)\n {\n $this->checkProfileExists($input['id']);\n }", "public function delete(){\r\n\t\tif(!$this->input->is_ajax_request()) show_404();\r\n\r\n\t\t//$this->auth->set_access('delete');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\tif($this->input->post('ang_id') === NULL) ajax_response();\r\n\r\n\t\t$all_deleted = array();\r\n\t\tforeach($this->input->post('ang_id') as $row){\r\n\t\t\t//$row = uintval($row);\r\n\t\t\t//permanent delete row, check MY_Model, you can set flag with ->update_single_column\r\n\t\t\t$this->m_anggota->permanent_delete($row);\r\n\r\n\t\t\t//this is sample code if you cannot delete, but you must update status\r\n\t\t\t//$this->m_anggota->update_single_column('ang_deleted', 1, $row);\r\n\t\t\t$all_deleted[] = $row;\r\n\t\t}\r\n\t\twrite_log('anggota', 'delete', 'PK = ' . implode(\",\", $all_deleted));\r\n\r\n\t\tajax_response();\r\n\t}", "public function deleteRowByPrimaryKey()\n {\n if ($this->getTipoId() === null) {\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'tipoId = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getTipoId())\n );\n }", "function deleteData()\n{\n global $myDataGrid;\n global $f;\n global $tbl;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n }\n if ($tbl->deleteMultiple($arrKeys)) {\n $myDataGrid->message = $tbl->strMessage;\n $f->setValues('step', getDataListRecruitmentProcessTypeStep(null, true));\n } else {\n $myDataGrid->errorMessage = \"Failed to delete data \" . $tbl->strEntityName;\n }\n}", "public function validateDelete(ValidationHook $hook)\n {\n return;\n }", "function validateRow($row) { \n \n if(!$this->fields) {\n return $row;\n }\n \n $return = [];\n foreach($this->fields as $key => $field) {\n $return[$key] = $this->validateField($row, $key);\n }\n return $return;\n }", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "private function _delete()\n {\n if (!$this->isLoaded()) {\n return false;\n }\n\n $className = get_called_class();\n $db = self::getDb();\n $useValue = self::sModifyStr($this->getPrimaryValue(), 'formatToQuery');\n $db->query(\"delete from \" . self::structGet('tableName') . \" where \" . self::structGet('primaryKey') . \" = {$useValue}\",\n \"{$className}->_delete()\");\n if ($db->error()) {\n return false;\n }\n\n if (self::structGet('cbAuditing')) {\n $cbAuditing = self::structGet('cbAuditing');\n if (is_array($cbAuditing)) {\n call_user_func($cbAuditing, $this, $this->getPrimaryValue(), 'delete', false);\n } else {\n $cbAuditing($this, $this->getPrimaryValue(), 'delete', false);\n }\n }\n\n // Vamos processar eventListener:delete\n self::_handleEventListeners('delete', $this, $this->getPrimaryValue(), false);\n\n // Vamos marcar o objeto como !loaded\n $this->setLoaded(false);\n\n // Vamos processar eventListener:afterDelete\n self::_handleEventListeners('afterDelete', $this, $this->getPrimaryValue(), false);\n\n return true;\n }", "private function validateRowData($rowData)\n\t{\n\t\t$validationData = array();\n\t\t$validationData[self::COL_STUDENT_NR] = $rowData[0];\n\t\t$validationData[self::COL_FIRSTNAME] = $rowData[1];\n\t\t$validationData[self::COL_LASTNAME] = $rowData[2];\n\t\t$validationData[self::COL_EMAIL] = $rowData[3];\n\n\t\t$validator = Validator::make($validationData, [\n\t\t\t self::COL_STUDENT_NR => 'required|integer',\n\t\t\t self::COL_FIRSTNAME => 'required|string',\n\t\t\t self::COL_LASTNAME => 'required|string',\n\t\t\t self::COL_EMAIL => 'required|email'\n\t\t]);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn $validator->errors();\n\t\t}\n\n\t\treturn null;\n\t}", "public function testQuestionDeleteWithValidData() {\n $response = $this->get('question/' . $this->question->id . '/delete');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_item='$this->iid_item'\")) === FALSE) {\n $sClauError = 'UbiGasto.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return FALSE;\n }\n return TRUE;\n }", "public function deleteStudentInfoFromEventTable(){\n \n $deleteId = $_POST[\"edeleteId\"];\n \n if ($this->databaseConnection()){\n $queryDelete = $this->db_connection->prepare('DELETE FROM events WHERE eid = :deleteId');\n $queryDelete->bindValue(':deleteId', $deleteId ,PDO::PARAM_INT);\n $queryDelete->execute();\n // Return something to display the we have delete the entry \n }\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDblSt = $oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_nom=$this->iid_nom AND id_nivel='$this->iid_nivel'\")) === false) {\n $sClauError = 'PersonaNota.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "public function delete() \n {\n // Create query\n $query = 'DELETE FROM ' . $this->table . ' WHERE id = :id';\n \n // Prepare Statement\n $stmt = $this->conn->prepare($query);\n \n // clean data\n $this->id = htmlspecialchars(strip_tags($this->id));\n \n // Bind Data\n $stmt-> bindParam(':id', $this->id);\n \n // Execute query\n if($stmt->execute()) {\n return true;\n }\n\n // Print error if something goes wrong\n printf(\"Error: %s.\\n\", $stmt->error);\n return false;\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_item='$this->iid_item' \")) === FALSE) {\n $sClauError = 'Tarifa.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return FALSE;\n }\n return TRUE;\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDbl->exec(\"DELETE FROM $nom_tabla WHERE nivel_stgr='$this->inivel_stgr'\")) === false) {\n $sClauError = 'NivelStgr.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "public function testDeleteValidScheduleItem() {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"scheduleItem\");\n // create a new ScheduleItem and insert to into mySQL\n $scheduleItem = new ScheduleItem(null,$this->VALID_SCHEDULE_ITEM_DESCRIPTION, $this->VALID_SCHEDULE_ITEM_NAME,$this->VALID_SCHEDULE_START_TIME, $this->VALID_SCHEDULE_END_TIME, $this->VALID_USER_ID);\n $scheduleItem->insert($this->getPDO());\n // delete the ScheduleItem from mySQL\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"scheduleItem\"));\n $scheduleItem->delete($this->getPDO());\n // grab the data from mySQL and enforce the ScheduleItem does not exist\n $pdoScheduleItem = ScheduleItem::getScheduleItemByScheduleItemUserId($this->getPDO(), $scheduleItem->getScheduleItemUserId());\n $this->assertEquals($pdoScheduleItem->count(),0);\n $this->assertEquals($numRows, $this->getConnection()->getRowCount(\"scheduleItem\"));\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDblSt = $oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_situacion='$this->iid_situacion'\")) === false) {\n $sClauError = 'Nota.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "public function isDelete();", "public function delete()\n{\n $query = \"DELETE FROM \" . $this->table_name . \" WHERE `user_id`=:user_id\";\n \n // prepare the query\n $stmt = $this->conn->prepare( $query );\n // unique ID of record to be edited\n $this->user_id=htmlspecialchars(strip_tags($this->user_id));\n $stmt->bindParam(':user_id', $this->user_id);\n\n \n if($stmt->execute()){\n return true;\n }\n \n // return false if email does not exist in the database\n $this->errmsg=implode(\",\",$stmt->errorInfo());\n return false;\n}", "function ValidRow($row) {\n\t$ValidRow = TRUE;\n\treturn $ValidRow;\n}", "public function delete() {\n $where = func_get_args();\n $this->_set_where($where);\n\n $this->_callbacks('before_delete', array($where));\n\n $result = $this->db->delete($this->_table());\n\n $this->_callbacks('after_delete', array($where, $result));\n\n return $this->db->affected_rows();\n }", "protected function validateDelete() {\r\n\t\t// check permissions\r\n\t\tif (!WCF::getSession()->getPermission('admin.user.canDeleteUser')) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn $this->__validateAccessibleGroups(array_keys($this->objects));\r\n\t}", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_activ='$this->iid_activ' AND id_asignatura='$this->iid_asignatura' AND id_nom=$this->iid_nom\")) === false) {\n $sClauError = 'Matricula.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "protected function canDelete($record) { return false; }", "public function deletedata($table,$where)\n{\n\t$this->db->where($where);\n\t$this->db->delete($table);\n\tif($this->db->affected_rows()>0){\n\t\techo 1;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "public function testDeleteValidAccess() {\n\t\t//count the number of rows and save it later\n\t\t$numRows = $this->getConnection()->getRowCount(\"access\");\n\n\t\t//create new access and insert it into mySQL\n\t\t$access = new Access(null, $this->VALID_ACCESSNAME);\n\t\t$access->insert($this->getPDO());\n\n\t\t//delete the access from mySQL\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"access\"));\n\t\t$access->delete($this->getPDO());\n\n\t\t//grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoAccess = Access::getAccessByAccessId($this->getPDO(), $access->getAccessId());\n\t\t$this->assertNull($pdoAccess);\n\t\t$this->assertEquals($numRows, $this->getConnection()->getRowCount(\"access\"));\n\t}", "function deleteData($id) \n {\n $sql = 'delete from vacancy where id = \"'.\n $this->db->real_escape_string($id).'\"';\n if (!$this->db->query($sql)) {\n return false;\n }\n $this->dispatch('ondelete');\n return $this->db->affected_rows; \n }", "abstract public function shouldIDelete();", "public function deleteRow($table)\r\n\t\t{\r\n\r\n\t\t\tif($this->_where != \"\" and $this->_where != 'false'){\r\n\t\t\t\t$sqlDelete = \"DELETE FROM `{$this->_prefix}{$table}`\" . $this->_where;\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse echo \"Error: Please provide a where clause when trying to delete a row\";\r\n\r\n\t\t\t$this->_query = $this->_prepare($sqlDelete);\r\n\t\t\t$eStatus = $this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\t\t\t$this->close();\r\n\r\n\t\t\treturn $eStatus;\r\n\t\t}", "function DeleteRows() {\n\t\tglobal $conn, $Language, $Security, $frm_fp_units_accomplishment;\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $frm_fp_units_accomplishment->SQL();\n\t\t$conn->raiseErrorFn = 'up_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $frm_fp_units_accomplishment->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= UP_COMPOSITE_KEY_SEPARATOR;\n\t\t\t\t$sThisKey .= $row['units_id'];\n\t\t\t\t$conn->raiseErrorFn = 'up_ErrorFn';\n\t\t\t\t$DeleteRows = $conn->Execute($frm_fp_units_accomplishment->DeleteSQL($row)); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($frm_fp_units_accomplishment->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($frm_fp_units_accomplishment->CancelMessage);\n\t\t\t\t$frm_fp_units_accomplishment->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$frm_fp_units_accomplishment->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "public function hard_delete(){\n\t\tif($this->data[$this->primary_key]){\n\t\t\treturn $this->db\n\t\t\t\t->where($this->primary_key, $this->data[$this->primary_key])\n\t\t\t\t->delete($this->table);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function PersonalData_Deleted($row) {\n\n\t//echo \"PersonalData Deleted\";\n}", "public function deleteCustomValidate()\n {\n // sprawdzanie czy zolnierz jest na misji\n if(self::checkSoldierIsOnMission($this->id)){\n $this->errors = \"Żołnierz przebywa aktualnie lub będzie przebywać na misji.\";\n return false;\n }\n \n // sprawdzanie czy zolnierz jest na szkoleniu\n if(self::checkSoldierIsOnTraining($this->id)){\n $this->errors = \"Żołnierz przebywa aktualnie lub będzie przebywać na szkoleniu.\";\n return false;\n }\n \n return true;\n }", "public function deleteRowByPrimaryKey()\n {\n if (!$this->getId())\n throw new Exception('Primary Key does not contain a value');\n return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());\n }", "public function deleteRowByPrimaryKey()\n {\n if (!$this->getId())\n throw new Exception('Primary Key does not contain a value');\n return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());\n }", "public function delete(){\n\n $query = 'DELETE FROM ' . $this->table . ' WHERE id=:id';\n $stmt = $this->conn->prepare($query);\n $this->id = htmlspecialchars(strip_tags($this->id));\n $stmt->bindParam(':id', $this->id);\n if($stmt->execute()){\n return true;\n }\n else{\n printf(\"Error: %s.\\n\", $stmt->error);\n return false;\n }\n }", "public function deleteRowByPrimaryKey()\n {\n if ($this->getMensajeId() === null) {\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'mensajeId = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getMensajeId())\n );\n }", "public function delete() : bool {\n\t\tif (!isset($this->{$this->primaryKey}) || !$this->{$this->primaryKey}) {\n\t\t\tthrow new Exception('No item found to remove', 500);\n\t\t}\n\n\t\t$this->database->query(\n\t\t\t'DELETE FROM ' . $this->tableNamePrefixed . ' \n\t\t\t\t\tWHERE ' . $this->primaryKey . ' = ' . $this->{$this->primaryKey}\n\t\t\t\t\t);\n\n\t\treturn true;\n\t}", "function delete() {\n $del = $this->CI->db->delete(\"data_quiz\", array(\"id_quiz\" => $this->id_quiz));\n return $this->CI->db->affected_rows() > 0;\n }", "public function delete()\n {\n if ($id = $this->getData('id')) {\n if ($this->getDB()->delete($this->table, array('id' => $id))) {\n $this->data = [];\n return true;\n }\n }\n\n return false;\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDblSt = $oDbl->exec(\"DELETE FROM $nom_tabla WHERE dl='$this->iid_dl' \")) === false) {\n $sClauError = 'Delegacion.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "public function deleteRow($query,$params=[]){\r\n\t\t\ttry {\r\n\t\t\t\t$stmt=$this->db->prepare($query);\r\n\t\t\t\t$stmt->execute($params);\r\n\t\t\t\treturn true;\r\n\t\t\t} catch (PDOException $e) {\r\n\t\t\tthrow new Exception($e->getMessage());\r\n\t\t\t}\r\n\t\t}", "function deleteData($conn, $param) {\n \n if (!$conn) {\n echo \"master connection failed\\n\";\n return false;\n }\n\n $query = \"\\n DELETE \";\n $query .= \"\\n FROM \" . $param[\"table\"];\n $query .= \"\\n WHERE \" . $param[\"prk\"];\n $query .= \"\\n =\" . $this->parameterEscape($conn,\n $param[\"prkVal\"]);\n\n $resultSet = $conn->Execute($query);\n\n if ($resultSet === FALSE) {\n $errorMessage = \"데이터 삭제에 실패 하였습니다.\";\n return false;\n } else {\n return true;\n } \n }", "function deleterec($adata)\n\t{\n\t\t$this->db->where(\"noteman\", $adata[\"noteman\"]);\n\t\t$this->db->delete(\"tblteman\");\n\n\t\t/* ATAU BISA JUGA DENGAN INI\n\t\t$kriteria = array(\"noteman\" => $adata[\"noteman\"]);\n\t\t$this->db->delete(\"tblteman\", $kriteria);\n\t\treturn (($this->db->affected_rows() > 0)?TRUE:FALSE);\n\t\t*/\n\n\t\treturn (($this->db->affected_rows() > 0)?TRUE:FALSE);\n\t}", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDblSt = $oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_region=$this->iid_region\")) === false) {\n $sClauError = 'Region.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "public function testDeleteValidKid(): void\n {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"kid\");\n\n $kidId = generateUuidV4();\n $kid = new Kid($kidId, $this->adult->getAdultId(), $this->VALID_AVATAR_URL, $this->VALID_CLOUDINARY_TOKEN, $this->VALID_HASH, $this->VALID_NAME, $this->VALID_USERNAME);\n $kid->insert($this->getPDO());\n\n\n // delete the Kid from mySQL\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"kid\"));\n $kid->delete($this->getPDO());\n\n // grab the data from mySQL and enforce the Kid does not exist\n $pdoKid = Kid::getKidByKidId($this->getPDO(), $kid->getKidId());\n $this->assertNull($pdoKid);\n $this->assertEquals($numRows, $this->getConnection()->getRowCount(\"kid\"));\n }", "protected function _preDelete() {}", "abstract public function validateData($data);", "function PersonalData_Deleted($row) {\r\n\r\n\t//echo \"PersonalData Deleted\";\r\n}" ]
[ "0.73021", "0.6691338", "0.6319402", "0.63003045", "0.6299784", "0.62914497", "0.623044", "0.62237966", "0.6204081", "0.6192909", "0.61627024", "0.6136963", "0.6127818", "0.61245763", "0.6115297", "0.61081517", "0.6096627", "0.6093777", "0.6082443", "0.60793763", "0.60744476", "0.60696393", "0.6065683", "0.60593873", "0.60591304", "0.6050804", "0.604863", "0.6042101", "0.602392", "0.6017279", "0.60172373", "0.6016778", "0.6013487", "0.60107195", "0.60072964", "0.60059214", "0.5997307", "0.59899247", "0.5987988", "0.59816766", "0.5979032", "0.59592", "0.5952799", "0.5949361", "0.5947899", "0.59452426", "0.59420633", "0.5938756", "0.5930304", "0.59298813", "0.59238696", "0.59079164", "0.59021634", "0.5899882", "0.58964163", "0.58936644", "0.58839", "0.58757704", "0.58742386", "0.58688146", "0.58681864", "0.58589166", "0.58565605", "0.5854148", "0.58539116", "0.58530426", "0.58522385", "0.5831838", "0.58188564", "0.5816914", "0.5815617", "0.58135223", "0.57990897", "0.5794455", "0.57893544", "0.5776756", "0.5769239", "0.5766195", "0.5751768", "0.57478225", "0.5746286", "0.5738208", "0.5737759", "0.5737759", "0.57324624", "0.5731479", "0.57294375", "0.57197183", "0.5716878", "0.5716594", "0.5713655", "0.571102", "0.5710333", "0.5708584", "0.57071954", "0.5705619", "0.57035416", "0.5699854", "0.56810266", "0.5677288" ]
0.6700755
1
Validate row data for update behaviour
public function validateRowForUpdate(array $rowData, $rowNumber) { if (!empty($rowData['conditions_serialized'])) { $conditions = $this->serializer->unserialize($rowData['conditions_serialized']); if (is_array($conditions)) { $this->validateConditions($conditions, $rowNumber); } else { $errorMessage = __('invalid conditions serialized.'); $this->addRowError($errorMessage, $rowNumber); } } if (!empty($rowData['actions_serialized'])) { $actions = $this->serializer->unserialize($rowData['actions_serialized']); if (is_array($actions)) { $this->validateActions($actions, $rowNumber); } else { $errorMessage = __('invalid actions serialized.'); $this->addRowError($errorMessage, $rowNumber); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _validateRowForUpdate(array $rowData, $rowNumber)\n {\n $multiSeparator = $this->getMultipleValueSeparator();\n if ($this->_checkUniqueKey($rowData, $rowNumber)) {\n $email = strtolower($rowData[self::COLUMN_EMAIL]);\n $website = $rowData[self::COLUMN_WEBSITE];\n $addressId = $rowData[self::COLUMN_ADDRESS_ID];\n $customerId = $this->_getCustomerId($email, $website);\n\n if ($customerId === false) {\n $this->addRowError(self::ERROR_CUSTOMER_NOT_FOUND, $rowNumber);\n } else {\n if ($this->_checkRowDuplicate($customerId, $addressId)) {\n $this->addRowError(self::ERROR_DUPLICATE_PK, $rowNumber);\n } else {\n // check simple attributes\n foreach ($this->_attributes as $attributeCode => $attributeParams) {\n $websiteId = $this->_websiteCodeToId[$website];\n $attributeParams = $this->adjustAttributeDataForWebsite($attributeParams, $websiteId);\n\n if (in_array($attributeCode, $this->_ignoredAttributes)) {\n continue;\n }\n if (isset($rowData[$attributeCode]) && strlen($rowData[$attributeCode])) {\n $this->isAttributeValid(\n $attributeCode,\n $attributeParams,\n $rowData,\n $rowNumber,\n $multiSeparator\n );\n } elseif ($attributeParams['is_required']\n && !$this->addressStorage->doesExist(\n (string)$addressId,\n (string)$customerId\n )\n ) {\n $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNumber, $attributeCode);\n }\n }\n\n if (isset($rowData[self::COLUMN_POSTCODE])\n && isset($rowData[self::COLUMN_COUNTRY_ID])\n && !$this->postcodeValidator->isValid(\n $rowData[self::COLUMN_COUNTRY_ID],\n $rowData[self::COLUMN_POSTCODE]\n )\n ) {\n $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNumber, self::COLUMN_POSTCODE);\n }\n\n if (isset($rowData[self::COLUMN_COUNTRY_ID]) && isset($rowData[self::COLUMN_REGION])) {\n $countryRegions = isset(\n $this->_countryRegions[strtolower($rowData[self::COLUMN_COUNTRY_ID])]\n ) ? $this->_countryRegions[strtolower(\n $rowData[self::COLUMN_COUNTRY_ID]\n )] : [];\n\n if (!empty($rowData[self::COLUMN_REGION]) && !empty($countryRegions) && !isset(\n $countryRegions[strtolower($rowData[self::COLUMN_REGION])]\n )\n ) {\n $this->addRowError(self::ERROR_INVALID_REGION, $rowNumber, self::COLUMN_REGION);\n }\n }\n }\n }\n }\n }", "abstract public function validateData();", "function checkValues($row,&$data,$insert,$from_update=false) {\n global $Language;\n $hp = Codendi_HTMLPurifier::instance();\n for ($c=0; $c < count($this->parsed_labels); $c++) {\n $label = $this->parsed_labels[$c];\n $val = $data[$c];\n $field = $this->used_fields[$label];\n if ($field) $field_name = $field->getName();\n \n // check if val in predefined vals (if applicable)\n unset($predef_vals);\n if (isset($this->predefined_values[$c])) {$predef_vals = $this->predefined_values[$c];}\n if (isset($predef_vals)) {\n\tif (!$this->checkPredefinedValues($field,$field_name,$label,$val,$predef_vals,$row,$data)) {\n\t return false;\n\t}\n }\n \n // check whether we specify None for a field which is mandatory\n if ($field && !$field->isEmptyOk() &&\n\t $field_name != \"artifact_id\") {\n\tif ($field_name == \"submitted_by\" ||\n\t $field_name == \"open_date\") {\n\t //submitted on and submitted by are accepted as \"\" on inserts and\n\t //we put time() importing user as default\n\t} else {\n\t \n\t $is_empty = ( ($field->isSelectBox() || $field->isMultiSelectBox()) ? ($val==$Language->getText('global','none')) : ($val==''));\n\n\t if ($is_empty) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_current',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML),\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t}\n }\n \n // for date fields: check format\n if ($field && $field->isDateField()) {\n\tif ($field_name == \"open_date\" && $val == \"\") {\n\t //is ok.\n\t} else {\n\t \n\t if ($val == \"-\" || $val == \"\") {\n\t //ok. transform it by hand into 0 before updating db\n\t $data[$c] = \"\";\n\t } else {\n\t list($unix_time,$ok) = util_importdatefmt_to_unixtime($val);\n\t if (!$ok) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','incorrect_date',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t $date = format_date(\"Y-m-d\",$unix_time);\n\t $data[$c] = $date;\n\t }\n\t}\n }\n } // end of for parsed_labels\n\n\n if (!$insert && $label == $this->lbl_list['follow_ups']) {\n /* check whether we need to remove known follow-ups */\n \n }\n \n // if we come from update case ( column tracker_id is specified but for this concrete artifact no aid is given)\n // we have to check whether all mandatory fields are specified and not empty\n if ($from_update) {\n\n \n while (list($label,$field) = each($this->used_fields)) {\n\tif ($field) $field_name = $field->getName();\n\t\n\tif ($field) {\n if ($field_name != \"artifact_id\" &&\n $field_name != \"open_date\" &&\n $field_name != \"submitted_by\" &&\n $label != $this->lbl_list['follow_ups'] &&\n $label != $this->lbl_list['is_dependent_on'] &&\n $label != $this->lbl_list['add_cc'] &&\n $label != $this->lbl_list['cc_comment'] &&\n !$field->isEmptyOk() && !in_array($label,$this->parsed_labels)) {\n\t \n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_line',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n }\n\t}\n }\n \n \n }//end from_update\n \n return true;\n }", "public function isValidUpdate($data) { \n\t\t$options = array('presence' => 'optional');\n\t\treturn $this -> validate($data,$options);\n\t}", "public function validateUpdate($obj);", "function validate_on_update() {}", "protected function onUpdating()\n {\n return $this->isDataOnUpdateValid();\n }", "private function validateUpdate($data){\n return Validator::make($data, [\n 'context' => 'required|in:answer,complete,scoring',\n 'answer' => 'required_if:context,==,answer',\n 'answer.questionId' => 'required_if:context,==,answer',\n ]);\n }", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "public function updateRow($data)\r\n\t{\r\n\t\t$data = (array)$data;\r\n\t\t$data = $this->cleanupFieldNames($data);\r\n\t\t\r\n\t\t// Build SQL\r\n\t\t$sql = 'UPDATE `'.$this->name.'` SET ';\r\n\t\t$values = array();\r\n\t\t$pkFound = false;\r\n\t\tforeach($data as $key => $val)\r\n\t\t{\r\n\t\t\t// Ignore if field is not in table\r\n\t\t\tif (!$this->hasField($key))\r\n\t\t\t{\r\n\t\t\t\tunset($data[$key]);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Include value, but not if primary key and table has auto-incr PK\r\n\t\t\t$include = true;\r\n\t\t\tif ($key == $this->primaryKey)\r\n\t\t\t{\r\n\t\t\t\tif ($this->primaryKeyIsAutoIncrement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$include = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Found non-empty primary key\r\n\t\t\t\tif (!empty($val))\r\n\t\t\t\t{\r\n\t\t\t\t\t$pkFound = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Include and process special value\r\n\t\t\tif ($include)\r\n\t\t\t{\r\n\t\t\t\tif ($val === 'NULL')\r\n\t\t\t\t{\r\n\t\t\t\t\t$values[] = \"`$key` = NULL\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$values[] = \"`$key` = :$key\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t// Quit if has no primary key\r\n\t\tif (!$pkFound)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Cannot update: The supplied data does not contain a primary key');\r\n\t\t}\r\n\t\r\n\t\t// No fields were found - update makes no sense\r\n\t\tif (count($values) == 0)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('No fields were added to the UPDATE query');\r\n\t\t}\r\n\t\t\t\r\n\t\t// Add values to query\r\n\t\t$sql .= implode(', ', $values);\r\n\t\r\n\t\t// Add where\r\n\t\t$sql .= ' WHERE `'.$this->primaryKey.'` = :' . $this->primaryKey;\r\n\r\n\t\t// Execute\r\n\t\t$result = $this->db->runQuery($sql, $data);\r\n\t\t\r\n\t\treturn $this->db->getAffectedRows();\r\n\t}", "private function validateRowData($rowData)\n\t{\n\t\t$validationData = array();\n\t\t$validationData[self::COL_STUDENT_NR] = $rowData[0];\n\t\t$validationData[self::COL_FIRSTNAME] = $rowData[1];\n\t\t$validationData[self::COL_LASTNAME] = $rowData[2];\n\t\t$validationData[self::COL_EMAIL] = $rowData[3];\n\n\t\t$validator = Validator::make($validationData, [\n\t\t\t self::COL_STUDENT_NR => 'required|integer',\n\t\t\t self::COL_FIRSTNAME => 'required|string',\n\t\t\t self::COL_LASTNAME => 'required|string',\n\t\t\t self::COL_EMAIL => 'required|email'\n\t\t]);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn $validator->errors();\n\t\t}\n\n\t\treturn null;\n\t}", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Nro_Serie\r\n\t\t\t$this->Nro_Serie->SetDbValueDef($rsnew, $this->Nro_Serie->CurrentValue, \"\", $this->Nro_Serie->ReadOnly || $this->Nro_Serie->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly || $this->SN->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cant_Net_Asoc\r\n\t\t\t$this->Cant_Net_Asoc->SetDbValueDef($rsnew, $this->Cant_Net_Asoc->CurrentValue, NULL, $this->Cant_Net_Asoc->ReadOnly || $this->Cant_Net_Asoc->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Marca\r\n\t\t\t$this->Id_Marca->SetDbValueDef($rsnew, $this->Id_Marca->CurrentValue, 0, $this->Id_Marca->ReadOnly || $this->Id_Marca->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Modelo\r\n\t\t\t$this->Id_Modelo->SetDbValueDef($rsnew, $this->Id_Modelo->CurrentValue, 0, $this->Id_Modelo->ReadOnly || $this->Id_Modelo->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_SO\r\n\t\t\t$this->Id_SO->SetDbValueDef($rsnew, $this->Id_SO->CurrentValue, 0, $this->Id_SO->ReadOnly || $this->Id_SO->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Estado\r\n\t\t\t$this->Id_Estado->SetDbValueDef($rsnew, $this->Id_Estado->CurrentValue, 0, $this->Id_Estado->ReadOnly || $this->Id_Estado->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_Server\r\n\t\t\t$this->User_Server->SetDbValueDef($rsnew, $this->User_Server->CurrentValue, NULL, $this->User_Server->ReadOnly || $this->User_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_Server\r\n\t\t\t$this->Pass_Server->SetDbValueDef($rsnew, $this->Pass_Server->CurrentValue, NULL, $this->Pass_Server->ReadOnly || $this->Pass_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_TdServer\r\n\t\t\t$this->User_TdServer->SetDbValueDef($rsnew, $this->User_TdServer->CurrentValue, NULL, $this->User_TdServer->ReadOnly || $this->User_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_TdServer\r\n\t\t\t$this->Pass_TdServer->SetDbValueDef($rsnew, $this->Pass_TdServer->CurrentValue, NULL, $this->Pass_TdServer->ReadOnly || $this->Pass_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cue\r\n\t\t\t// Fecha_Actualizacion\r\n\r\n\t\t\t$this->Fecha_Actualizacion->SetDbValueDef($rsnew, ew_CurrentDate(), NULL);\r\n\t\t\t$rsnew['Fecha_Actualizacion'] = &$this->Fecha_Actualizacion->DbValue;\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->SetDbValueDef($rsnew, CurrentUserName(), NULL);\r\n\t\t\t$rsnew['Usuario'] = &$this->Usuario->DbValue;\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}", "public static function validateUpdate($data) {\n\t\t$v = parent::getValidationObject($data);\n\n\t\t//Set rules\n\t\t$v->rule('optional', 'name')\n\t\t ->rule('lengthMin', 'name', 1)->message(__('Name size is too small!'))\n\t\t ->rule('relationData', 'property', 'int')->message(__('Incorrect data format for category properties!'));\n\n\t\t//Validate\n\t\treturn parent::validate($v, self::$__validationErrors);\n\t}", "public function checkIsValidForUpdate() {\n $errors = array();\n\n if (strlen($this->phone) >0 && !is_numeric($this->phone)){\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n if (strlen($this->phone) < 1) {\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"User is not valid\");\n }\n }", "public function validRowForSave($row) {\n\n $params = $this->_request->getParams();\n $table = $params['table'];\n //-----------------------\n // Проверим строку на валидность\n $jsons = $this->_isValidRow($row);\n if (isset($jsons['class_message'])) { // Ошибка валидации\n return $jsons;\n }\n\n // Проверка валидации особых случаев\n if ($table == 'admin.blog_posts_tags') {\n $params = array();\n $params['table'] = 'blog_posts_tags';\n $params['fieldKey1'] = 'post_id';\n $params['fieldKey2'] = 'tag';\n $params['adapter'] = $this->db;\n $params['id'] = $row['id'];\n\n $validator = new Default_Form_Validate_DbMultipleKey($params);\n $value = $row['post_id'] . ';' . $row['tag'];\n if (!$validator->isValid($value)) {\n $messages = $validator->getMessages();\n $newMess = array();\n $newMess[] = '<em>' . Zend_Registry::get('Zend_Translate')->_('Ошибка формы! Неверно введены данные в форму.') . '</em>';\n $messages = array_values($messages);\n $newMess[] = $messages[0];\n $jsons = array(\n 'class_message' => 'warning',\n 'messages' => $newMess\n );\n }\n }\n\n return $jsons;\n }", "function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t\tif ($this->fbid->CurrentValue <> \"\") { // Check field with unique index\n\t\t\t$sFilterChk = \"(`fbid` = \" . ew_AdjustSql($this->fbid->CurrentValue) . \")\";\n\t\t\t$sFilterChk .= \" AND NOT (\" . $sFilter . \")\";\n\t\t\t$this->CurrentFilter = $sFilterChk;\n\t\t\t$sSqlChk = $this->SQL();\n\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t$rsChk = $conn->Execute($sSqlChk);\n\t\t\t$conn->raiseErrorFn = '';\n\t\t\tif ($rsChk === FALSE) {\n\t\t\t\treturn FALSE;\n\t\t\t} elseif (!$rsChk->EOF) {\n\t\t\t\t$sIdxErrMsg = str_replace(\"%f\", $this->fbid->FldCaption(), $Language->Phrase(\"DupIndex\"));\n\t\t\t\t$sIdxErrMsg = str_replace(\"%v\", $this->fbid->CurrentValue, $sIdxErrMsg);\n\t\t\t\t$this->setFailureMessage($sIdxErrMsg);\n\t\t\t\t$rsChk->Close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$rsChk->Close();\n\t\t}\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// fbid\n\t\t\t$this->fbid->SetDbValueDef($rsnew, $this->fbid->CurrentValue, NULL, $this->fbid->ReadOnly);\n\n\t\t\t// name\n\t\t\t$this->name->SetDbValueDef($rsnew, $this->name->CurrentValue, \"\", $this->name->ReadOnly);\n\n\t\t\t// email\n\t\t\t$this->_email->SetDbValueDef($rsnew, $this->_email->CurrentValue, \"\", $this->_email->ReadOnly);\n\n\t\t\t// password\n\t\t\t$this->password->SetDbValueDef($rsnew, $this->password->CurrentValue, NULL, $this->password->ReadOnly);\n\n\t\t\t// validated_mobile\n\t\t\t$this->validated_mobile->SetDbValueDef($rsnew, $this->validated_mobile->CurrentValue, NULL, $this->validated_mobile->ReadOnly);\n\n\t\t\t// role_id\n\t\t\t$this->role_id->SetDbValueDef($rsnew, $this->role_id->CurrentValue, 0, $this->role_id->ReadOnly);\n\n\t\t\t// image\n\t\t\t$this->image->SetDbValueDef($rsnew, $this->image->CurrentValue, NULL, $this->image->ReadOnly);\n\n\t\t\t// newsletter\n\t\t\t$this->newsletter->SetDbValueDef($rsnew, $this->newsletter->CurrentValue, 0, $this->newsletter->ReadOnly);\n\n\t\t\t// points\n\t\t\t$this->points->SetDbValueDef($rsnew, $this->points->CurrentValue, NULL, $this->points->ReadOnly);\n\n\t\t\t// last_modified\n\t\t\t$this->last_modified->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->last_modified->CurrentValue, 7), NULL, $this->last_modified->ReadOnly);\n\n\t\t\t// p2\n\t\t\t$this->p2->SetDbValueDef($rsnew, $this->p2->CurrentValue, NULL, $this->p2->ReadOnly || (EW_ENCRYPTED_PASSWORD && $rs->fields('p2') == $this->p2->CurrentValue));\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\tif ($EditRow) {\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\n\t\t}\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "abstract public function validateData($data);", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\tif ($this->Supplier_Number->CurrentValue <> \"\") { // Check field with unique index\n\t\t\t$sFilterChk = \"(`Supplier_Number` = '\" . ew_AdjustSql($this->Supplier_Number->CurrentValue, $this->DBID) . \"')\";\n\t\t\t$sFilterChk .= \" AND NOT (\" . $sFilter . \")\";\n\t\t\t$this->CurrentFilter = $sFilterChk;\n\t\t\t$sSqlChk = $this->SQL();\n\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t\t$rsChk = $conn->Execute($sSqlChk);\n\t\t\t$conn->raiseErrorFn = '';\n\t\t\tif ($rsChk === FALSE) {\n\t\t\t\treturn FALSE;\n\t\t\t} elseif (!$rsChk->EOF) {\n\t\t\t\t$sIdxErrMsg = str_replace(\"%f\", $this->Supplier_Number->FldCaption(), $Language->Phrase(\"DupIndex\"));\n\t\t\t\t$sIdxErrMsg = str_replace(\"%v\", $this->Supplier_Number->CurrentValue, $sIdxErrMsg);\n\t\t\t\t$this->setFailureMessage($sIdxErrMsg);\n\t\t\t\t$rsChk->Close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$rsChk->Close();\n\t\t}\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Begin transaction\n\t\t\tif ($this->getCurrentDetailTable() <> \"\")\n\t\t\t\t$conn->BeginTrans();\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$rsnew = array();\n\n\t\t\t// Supplier_Number\n\t\t\t$this->Supplier_Number->SetDbValueDef($rsnew, $this->Supplier_Number->CurrentValue, \"\", $this->Supplier_Number->ReadOnly);\n\n\t\t\t// Supplier_Name\n\t\t\t$this->Supplier_Name->SetDbValueDef($rsnew, $this->Supplier_Name->CurrentValue, \"\", $this->Supplier_Name->ReadOnly);\n\n\t\t\t// Address\n\t\t\t$this->Address->SetDbValueDef($rsnew, $this->Address->CurrentValue, \"\", $this->Address->ReadOnly);\n\n\t\t\t// City\n\t\t\t$this->City->SetDbValueDef($rsnew, $this->City->CurrentValue, \"\", $this->City->ReadOnly);\n\n\t\t\t// Country\n\t\t\t$this->Country->SetDbValueDef($rsnew, $this->Country->CurrentValue, \"\", $this->Country->ReadOnly);\n\n\t\t\t// Contact_Person\n\t\t\t$this->Contact_Person->SetDbValueDef($rsnew, $this->Contact_Person->CurrentValue, \"\", $this->Contact_Person->ReadOnly);\n\n\t\t\t// Phone_Number\n\t\t\t$this->Phone_Number->SetDbValueDef($rsnew, $this->Phone_Number->CurrentValue, \"\", $this->Phone_Number->ReadOnly);\n\n\t\t\t// Email\n\t\t\t$this->_Email->SetDbValueDef($rsnew, $this->_Email->CurrentValue, \"\", $this->_Email->ReadOnly);\n\n\t\t\t// Mobile_Number\n\t\t\t$this->Mobile_Number->SetDbValueDef($rsnew, $this->Mobile_Number->CurrentValue, \"\", $this->Mobile_Number->ReadOnly);\n\n\t\t\t// Notes\n\t\t\t$this->Notes->SetDbValueDef($rsnew, $this->Notes->CurrentValue, \"\", $this->Notes->ReadOnly);\n\n\t\t\t// Balance\n\t\t\t$this->Balance->SetDbValueDef($rsnew, $this->Balance->CurrentValue, NULL, $this->Balance->ReadOnly);\n\n\t\t\t// Is_Stock_Available\n\t\t\t$this->Is_Stock_Available->SetDbValueDef($rsnew, ((strval($this->Is_Stock_Available->CurrentValue) == \"Y\") ? \"Y\" : \"N\"), \"N\", $this->Is_Stock_Available->ReadOnly);\n\n\t\t\t// Date_Added\n\t\t\t$this->Date_Added->SetDbValueDef($rsnew, $this->Date_Added->CurrentValue, NULL, $this->Date_Added->ReadOnly);\n\n\t\t\t// Added_By\n\t\t\t$this->Added_By->SetDbValueDef($rsnew, $this->Added_By->CurrentValue, NULL, $this->Added_By->ReadOnly);\n\n\t\t\t// Date_Updated\n\t\t\t$this->Date_Updated->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['Date_Updated'] = &$this->Date_Updated->DbValue;\n\n\t\t\t// Updated_By\n\t\t\t$this->Updated_By->SetDbValueDef($rsnew, CurrentUserName(), NULL);\n\t\t\t$rsnew['Updated_By'] = &$this->Updated_By->DbValue;\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t}\n\n\t\t\t\t// Update detail records\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\t$DetailTblVar = explode(\",\", $this->getCurrentDetailTable());\n\t\t\t\t\tif (in_array(\"a_purchases\", $DetailTblVar) && $GLOBALS[\"a_purchases\"]->DetailEdit) {\n\t\t\t\t\t\tif (!isset($GLOBALS[\"a_purchases_grid\"])) $GLOBALS[\"a_purchases_grid\"] = new ca_purchases_grid(); // Get detail page object\n\t\t\t\t\t\t$EditRow = $GLOBALS[\"a_purchases_grid\"]->GridUpdate();\n\t\t\t\t\t}\n\t\t\t\t\tif (in_array(\"a_stock_items\", $DetailTblVar) && $GLOBALS[\"a_stock_items\"]->DetailEdit) {\n\t\t\t\t\t\tif (!isset($GLOBALS[\"a_stock_items_grid\"])) $GLOBALS[\"a_stock_items_grid\"] = new ca_stock_items_grid(); // Get detail page object\n\t\t\t\t\t\t$EditRow = $GLOBALS[\"a_stock_items_grid\"]->GridUpdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Commit/Rollback transaction\n\t\t\t\tif ($this->getCurrentDetailTable() <> \"\") {\n\t\t\t\t\tif ($EditRow) {\n\t\t\t\t\t\t$conn->CommitTrans(); // Commit transaction\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$conn->RollbackTrans(); // Rollback transaction\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "public function isUpdateRequired();", "public function validationUpdate()\n\t{\n\t\t$validationUpdate=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\t$validationUpdate[]=array(\n\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t'maxlength'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t'required'=>$row['Null']=='NO' ? '\\'required\\'=>true,' : false,\n\t\t\t\t'email'=>preg_match('/email/',$row['Field']) ? '\\'email\\'=>true,' : false,\n\t\t\t);\n\t\t}\n\t\treturn $validationUpdate;\n\t}", "function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// model_id\n\t\t\t$this->model_id->SetDbValueDef($rsnew, $this->model_id->CurrentValue, 0, $this->model_id->ReadOnly);\n\n\t\t\t// title\n\t\t\t$this->title->SetDbValueDef($rsnew, $this->title->CurrentValue, NULL, $this->title->ReadOnly);\n\n\t\t\t// description\n\t\t\t$this->description->SetDbValueDef($rsnew, $this->description->CurrentValue, NULL, $this->description->ReadOnly);\n\n\t\t\t// s_order\n\t\t\t$this->s_order->SetDbValueDef($rsnew, $this->s_order->CurrentValue, 0, $this->s_order->ReadOnly);\n\n\t\t\t// status\n\t\t\t$this->status->SetDbValueDef($rsnew, $this->status->CurrentValue, 0, $this->status->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "protected function updateRow()\n { \n $tableName = $this->getTableName($this->className);\n $assignedValues = $this->getAssignedValues();\n $updateDetails = [];\n\n for ($i = 0; $i < count($assignedValues['columns']); $i++) { \n array_push($updateDetails, $assignedValues['columns'][$i] .' =\\''. $assignedValues['values'][$i].'\\'');\n }\n\n $connection = Connection::connect();\n\n $allUpdates = implode(', ' , $updateDetails);\n $update = $connection->prepare('update '.$tableName.' set '. $allUpdates.' where id='.$this->resultRows[0]['id']);\n \n if ($update->execute()) { \n return 'Row updated';\n } else { \n throw new Exception(\"Unable to update row\"); \n }\n }", "protected function updateDBRow(array $data = [])\n {\n $action = 'update';\n if ( !$this->exists ) {\n return $this->addError( \"Can't \" . $this->getActionString( 'present', $action ) . \" because it doesn't exist.\" );\n }\n $messageNoChanges = 'No changes were made to ' . $this->entityName . $this->getIDBadge( null, 'primary' );\n\n\n if ( empty( $data ) ) {\n $this->messages->add( $messageNoChanges, 'warning' );\n return false;\n }\n $result = $this->db->update( $this->tableName, $data, ['ID' => $this->id] );\n $dataHTMLTable = $this->getDataHTMLTable( $data );\n if ( $result === 0 ) {\n return $this->addError( $messageNoChanges . '. Attempted to update the following data:' . $dataHTMLTable );\n }\n if ( empty( $result ) ) {\n return $this->addError( 'Failed to ' . $this->getActionString( 'present', $action ) . $this->getIDBadge( null, 'danger' ) . ' with the following data:' . $dataHTMLTable );\n }\n $this->messages->add( ucfirst( $this->getActionString( 'past', $action ) ) . $this->getIDBadge( null, 'success' ) . ' with the following data:' . $dataHTMLTable, 'success' );\n $this->changed = [];\n return $result;\n }", "function isValidUpdate($productItem, $id) {\n return isValidInsert($productItem, false) && is_numeric($id) && $id > 0;\n}", "public function isDataValid(): bool;", "public static function validateUpdateRequest() {\n $errors = array();\n $data = array();\n self::checkID($errors, $data);\n self::checkName($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'home']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "function validateupdate(){\n\t\tglobal $_REQUEST;\t\t\n\t\t\n\t\tif(!empty($this->errors)){\n\t\t\t$result = false;\n\t\t}else{\n\t\t\t$result = true;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function isDataValid() \n {\n return true;\n }", "function validateRow($row) { \n \n if(!$this->fields) {\n return $row;\n }\n \n $return = [];\n foreach($this->fields as $key => $field) {\n $return[$key] = $this->validateField($row, $key);\n }\n return $return;\n }", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "public function validateData($data): void;", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "function EditRow() {\r\n\t\tglobal $conn, $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Con_SIM\r\n\t\t\t$this->Con_SIM->SetDbValueDef($rsnew, $this->Con_SIM->CurrentValue, NULL, $this->Con_SIM->ReadOnly);\r\n\r\n\t\t\t// Observaciones\r\n\t\t\t$this->Observaciones->SetDbValueDef($rsnew, $this->Observaciones->CurrentValue, NULL, $this->Observaciones->ReadOnly);\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$rsnew = array();\n\n\t\t\t// nomr\n\t\t\t$this->nomr->SetDbValueDef($rsnew, $this->nomr->CurrentValue, \"\", $this->nomr->ReadOnly);\n\n\t\t\t// ket_nama\n\t\t\t$this->ket_nama->SetDbValueDef($rsnew, $this->ket_nama->CurrentValue, NULL, $this->ket_nama->ReadOnly);\n\n\t\t\t// ket_tgllahir\n\t\t\t$this->ket_tgllahir->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->ket_tgllahir->CurrentValue, 0), NULL, $this->ket_tgllahir->ReadOnly);\n\n\t\t\t// ket_alamat\n\t\t\t$this->ket_alamat->SetDbValueDef($rsnew, $this->ket_alamat->CurrentValue, NULL, $this->ket_alamat->ReadOnly);\n\n\t\t\t// ket_jeniskelamin\n\t\t\t$this->ket_jeniskelamin->SetDbValueDef($rsnew, $this->ket_jeniskelamin->CurrentValue, NULL, $this->ket_jeniskelamin->ReadOnly);\n\n\t\t\t// ket_title\n\t\t\t$this->ket_title->SetDbValueDef($rsnew, $this->ket_title->CurrentValue, NULL, $this->ket_title->ReadOnly);\n\n\t\t\t// dokterpengirim\n\t\t\t$this->dokterpengirim->SetDbValueDef($rsnew, $this->dokterpengirim->CurrentValue, 0, $this->dokterpengirim->ReadOnly);\n\n\t\t\t// statusbayar\n\t\t\t$this->statusbayar->SetDbValueDef($rsnew, $this->statusbayar->CurrentValue, 0, $this->statusbayar->ReadOnly);\n\n\t\t\t// kirimdari\n\t\t\t$this->kirimdari->SetDbValueDef($rsnew, $this->kirimdari->CurrentValue, 0, $this->kirimdari->ReadOnly);\n\n\t\t\t// keluargadekat\n\t\t\t$this->keluargadekat->SetDbValueDef($rsnew, $this->keluargadekat->CurrentValue, \"\", $this->keluargadekat->ReadOnly);\n\n\t\t\t// panggungjawab\n\t\t\t$this->panggungjawab->SetDbValueDef($rsnew, $this->panggungjawab->CurrentValue, \"\", $this->panggungjawab->ReadOnly);\n\n\t\t\t// masukrs\n\t\t\t$this->masukrs->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->masukrs->CurrentValue, 0), NULL, $this->masukrs->ReadOnly);\n\n\t\t\t// noruang\n\t\t\t$this->noruang->SetDbValueDef($rsnew, $this->noruang->CurrentValue, 0, $this->noruang->ReadOnly);\n\n\t\t\t// tempat_tidur_id\n\t\t\t$this->tempat_tidur_id->SetDbValueDef($rsnew, $this->tempat_tidur_id->CurrentValue, 0, $this->tempat_tidur_id->ReadOnly);\n\n\t\t\t// nott\n\t\t\t$this->nott->SetDbValueDef($rsnew, $this->nott->CurrentValue, \"\", $this->nott->ReadOnly);\n\n\t\t\t// NIP\n\t\t\t$this->NIP->SetDbValueDef($rsnew, $this->NIP->CurrentValue, \"\", $this->NIP->ReadOnly);\n\n\t\t\t// dokter_penanggungjawab\n\t\t\t$this->dokter_penanggungjawab->SetDbValueDef($rsnew, $this->dokter_penanggungjawab->CurrentValue, 0, $this->dokter_penanggungjawab->ReadOnly);\n\n\t\t\t// KELASPERAWATAN_ID\n\t\t\t$this->KELASPERAWATAN_ID->SetDbValueDef($rsnew, $this->KELASPERAWATAN_ID->CurrentValue, NULL, $this->KELASPERAWATAN_ID->ReadOnly);\n\n\t\t\t// NO_SKP\n\t\t\t$this->NO_SKP->SetDbValueDef($rsnew, $this->NO_SKP->CurrentValue, NULL, $this->NO_SKP->ReadOnly);\n\n\t\t\t// sep_tglsep\n\t\t\t$this->sep_tglsep->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglsep->CurrentValue, 5), NULL, $this->sep_tglsep->ReadOnly);\n\n\t\t\t// sep_tglrujuk\n\t\t\t$this->sep_tglrujuk->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglrujuk->CurrentValue, 5), NULL, $this->sep_tglrujuk->ReadOnly);\n\n\t\t\t// sep_kodekelasrawat\n\t\t\t$this->sep_kodekelasrawat->SetDbValueDef($rsnew, $this->sep_kodekelasrawat->CurrentValue, NULL, $this->sep_kodekelasrawat->ReadOnly);\n\n\t\t\t// sep_norujukan\n\t\t\t$this->sep_norujukan->SetDbValueDef($rsnew, $this->sep_norujukan->CurrentValue, NULL, $this->sep_norujukan->ReadOnly);\n\n\t\t\t// sep_kodeppkasal\n\t\t\t$this->sep_kodeppkasal->SetDbValueDef($rsnew, $this->sep_kodeppkasal->CurrentValue, NULL, $this->sep_kodeppkasal->ReadOnly);\n\n\t\t\t// sep_namappkasal\n\t\t\t$this->sep_namappkasal->SetDbValueDef($rsnew, $this->sep_namappkasal->CurrentValue, NULL, $this->sep_namappkasal->ReadOnly);\n\n\t\t\t// sep_kodeppkpelayanan\n\t\t\t$this->sep_kodeppkpelayanan->SetDbValueDef($rsnew, $this->sep_kodeppkpelayanan->CurrentValue, NULL, $this->sep_kodeppkpelayanan->ReadOnly);\n\n\t\t\t// sep_jenisperawatan\n\t\t\t$this->sep_jenisperawatan->SetDbValueDef($rsnew, $this->sep_jenisperawatan->CurrentValue, NULL, $this->sep_jenisperawatan->ReadOnly);\n\n\t\t\t// sep_catatan\n\t\t\t$this->sep_catatan->SetDbValueDef($rsnew, $this->sep_catatan->CurrentValue, NULL, $this->sep_catatan->ReadOnly);\n\n\t\t\t// sep_kodediagnosaawal\n\t\t\t$this->sep_kodediagnosaawal->SetDbValueDef($rsnew, $this->sep_kodediagnosaawal->CurrentValue, NULL, $this->sep_kodediagnosaawal->ReadOnly);\n\n\t\t\t// sep_namadiagnosaawal\n\t\t\t$this->sep_namadiagnosaawal->SetDbValueDef($rsnew, $this->sep_namadiagnosaawal->CurrentValue, NULL, $this->sep_namadiagnosaawal->ReadOnly);\n\n\t\t\t// sep_lakalantas\n\t\t\t$this->sep_lakalantas->SetDbValueDef($rsnew, $this->sep_lakalantas->CurrentValue, NULL, $this->sep_lakalantas->ReadOnly);\n\n\t\t\t// sep_lokasilaka\n\t\t\t$this->sep_lokasilaka->SetDbValueDef($rsnew, $this->sep_lokasilaka->CurrentValue, NULL, $this->sep_lokasilaka->ReadOnly);\n\n\t\t\t// sep_user\n\t\t\t$this->sep_user->SetDbValueDef($rsnew, $this->sep_user->CurrentValue, NULL, $this->sep_user->ReadOnly);\n\n\t\t\t// sep_flag_cekpeserta\n\t\t\t$this->sep_flag_cekpeserta->SetDbValueDef($rsnew, $this->sep_flag_cekpeserta->CurrentValue, NULL, $this->sep_flag_cekpeserta->ReadOnly);\n\n\t\t\t// sep_flag_generatesep\n\t\t\t$this->sep_flag_generatesep->SetDbValueDef($rsnew, $this->sep_flag_generatesep->CurrentValue, NULL, $this->sep_flag_generatesep->ReadOnly);\n\n\t\t\t// sep_nik\n\t\t\t$this->sep_nik->SetDbValueDef($rsnew, $this->sep_nik->CurrentValue, NULL, $this->sep_nik->ReadOnly);\n\n\t\t\t// sep_namapeserta\n\t\t\t$this->sep_namapeserta->SetDbValueDef($rsnew, $this->sep_namapeserta->CurrentValue, NULL, $this->sep_namapeserta->ReadOnly);\n\n\t\t\t// sep_jeniskelamin\n\t\t\t$this->sep_jeniskelamin->SetDbValueDef($rsnew, $this->sep_jeniskelamin->CurrentValue, NULL, $this->sep_jeniskelamin->ReadOnly);\n\n\t\t\t// sep_pisat\n\t\t\t$this->sep_pisat->SetDbValueDef($rsnew, $this->sep_pisat->CurrentValue, NULL, $this->sep_pisat->ReadOnly);\n\n\t\t\t// sep_tgllahir\n\t\t\t$this->sep_tgllahir->SetDbValueDef($rsnew, $this->sep_tgllahir->CurrentValue, NULL, $this->sep_tgllahir->ReadOnly);\n\n\t\t\t// sep_kodejeniskepesertaan\n\t\t\t$this->sep_kodejeniskepesertaan->SetDbValueDef($rsnew, $this->sep_kodejeniskepesertaan->CurrentValue, NULL, $this->sep_kodejeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_namajeniskepesertaan\n\t\t\t$this->sep_namajeniskepesertaan->SetDbValueDef($rsnew, $this->sep_namajeniskepesertaan->CurrentValue, NULL, $this->sep_namajeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_nokabpjs\n\t\t\t$this->sep_nokabpjs->SetDbValueDef($rsnew, $this->sep_nokabpjs->CurrentValue, NULL, $this->sep_nokabpjs->ReadOnly);\n\n\t\t\t// sep_status_peserta\n\t\t\t$this->sep_status_peserta->SetDbValueDef($rsnew, $this->sep_status_peserta->CurrentValue, NULL, $this->sep_status_peserta->ReadOnly);\n\n\t\t\t// sep_umur_pasien_sekarang\n\t\t\t$this->sep_umur_pasien_sekarang->SetDbValueDef($rsnew, $this->sep_umur_pasien_sekarang->CurrentValue, NULL, $this->sep_umur_pasien_sekarang->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "function ValidRow($row) {\n\t$ValidRow = TRUE;\n\treturn $ValidRow;\n}", "public function validateData(){\n return true;\n }", "function isValidUpdate($user, $id)\n{\n return isValidInsert($user) && is_numeric($id) && $id > 0;\n}", "function update(){\n\n // Check the required fields to see if each required field exists.\n forEach($requiredFields as $field){\n if(!$this->bean->contains($field)){\n throw new Exception(\"Required field $field does not exists.\");\n }\n }\n\n // Check to see if there are any fields that are not specified as a possible field.\n forEach($this->bean as $key => $value){\n if(!$possibleFields->contains($key)){\n throw new Exception(\"Invalid field $key passed to model.\");\n }\n }\n \n // Validate bean. \n if(!validate($this->bean)){\n throw new Exception(\"Bean is not valid. For a more detailed message throw a custom exception in validation function.\");\n }\n }", "public function processDataInput()\n\t{\n\t\t$this->buildNewRecordData();\n\n\t\tif( !$this->recheckUserPermissions() )\n\t\t{\n\t\t\t//\tprevent the page from reading database values\n\t\t\t$this->oldRecordData = $this->newRecordData;\n\t\t\t$this->cachedRecord = $this->newRecordData;\n\t\t\t$this->recordValuesToEdit = null;\n\t\t\treturn false;\n\t\t}\n\n\t\tif( !$this->checkCaptcha() )\n\t\t{\n\t\t\t$this->setMessage($this->message);\n\t\t\treturn false;\n\t\t}\n\n\t\t//\tcheck Deny Duplicate values\n\t\tforeach($this->newRecordData as $f => $value)\n\t\t{\n\t\t\tif( !$this->pSet->allowDuplicateValues($f) )\n\t\t\t{\n\t\t\t\t$this->errorFields[] = $f;\n\t\t\t\t$this->setMessage( $this->pSet->label( $f ) . \" \" . mlang_message(\"INLINE_DENY_DUPLICATES\") );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/* process the records and update 1 by one */\n\t\tforeach( $this->parsedSelection as $idx => $s ) \n\t\t{\n\t\t\t$this->currentWhereExpr = $this->getSingleRecordWhereClause( $s );\n\t\t\t$strSQL = $this->gQuery->gSQLWhere( $this->currentWhereExpr );\n\t\t\tLogInfo($strSQL);\n\n\t\t\t$fetchedArray = $this->connection->query( $strSQL )->fetchAssoc();\n\t\t\tif( !$fetchedArray )\n\t\t\t\tcontinue;\n\t\t\t$fetchedArray = $this->cipherer->DecryptFetchedArray( $fetchedArray );\n\t\t\tif( !$this->isRecordEditable( $fetchedArray ) )\n\t\t\t\tcontinue;\n\t\t\t$this->setUpdatedLatLng( $this->getNewRecordData(), $fetchedArray );\n\n\t\t\t$this->oldKeys = $s;\n\t\t\t$this->recordBeingUpdated = $fetchedArray;\n\n\t\t\tif( !$this->callBeforeEditEvent( ) )\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\tif( $this->callCustomEditEvent( ) )\n\t\t\t{\n\t\t\t\tif( !DoUpdateRecord( $this ) )\n\t\t\t\t\tcontinue;\n\t\t\t\t//\tsuccess if at least one record updated\n\t\t\t}\n\t\t\t++$this->nUpdated;\n\t\t\t$this->mergeNewRecordData();\n\t\t\t$this->auditLogEdit();\n\t\t\t$this->callAfterEditEvent();\n\t\t\t\n\t\t\tif( $this->isPopupMode() )\n\t\t\t\t$this->inlineReportData[ $this->rowIds[ $idx ] ] = $this->getRowSaveStatusJSON( $s );\n\t\t}\n\t\n\t\t$this->updatedSuccessfully = ($this->nUpdated > 0);\n\n\t\t//\tdo save the record\n\n\t\tif( !$this->updatedSuccessfully )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$this->messageType = MESSAGE_INFO;\n\t\t$this->setSuccessfulEditMessage();\n\t\t\n\t\t$this->callAfterSuccessfulSave();\n\n\t\treturn true;\n\t}", "public function testValidatorForRequiredForEmpty()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n // Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n 'datasource_name' => '',\n 'table_id' => null,\n 'starting_row_number' => null,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data doesn't update\n $this->assertEquals($postDataAdd['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($postDataAdd['table_id'], $updatedTable->table_id);\n $this->assertEquals($postDataAdd['starting_row_number'], $updatedTable->starting_row_number);\n\n\n //Check response\n $updateResponse\n ->assertStatus(422)\n ->assertJsonFragment([\n \"datasource_name\" => [\"データソース名は必ず指定してください。\"],\n \"starting_row_number\" => [\"開始行は必ず指定してください。\"],\n \"table_id\" => [\"テーブルIDは必ず指定してください。\"],\n ]);\n }", "public function testValidatorForRequired()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n // Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data doesn't update\n $this->assertEquals($postDataAdd['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($postDataAdd['table_id'], $updatedTable->table_id);\n $this->assertEquals($postDataAdd['starting_row_number'], $updatedTable->starting_row_number);\n\n\n //Check response\n $updateResponse\n ->assertStatus(422)\n ->assertJsonFragment([\n \"datasource_name\" => [\"データソース名は必ず指定してください。\"],\n \"starting_row_number\" => [\"開始行は必ず指定してください。\"],\n \"table_id\" => [\"テーブルIDは必ず指定してください。\"],\n ]);\n }", "private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }", "public function validateUpdate($id, $data)\n {\n return Validator::make($data, [\n 'state_id' => [\n 'required','exists:mysql2.states_master,id',\n ],\n 'mfp_name' => [\n 'required','exists:mysql2.commodity_master,id',\n ],\n 'botanical_name' => [\n 'required','string','alpha_spaces',\n ],\n 'local_name' => [\n 'required','string','alpha_spaces',\n ],\n 'msp_price' => [\n 'required','numeric'\n ],\n 'image' => 'nullable|mimes:pdf,jpeg,jpg|max:20480',\n ],\n [\n 'image.max' => 'Image size should not be greater than 20 MB',\n ]);\n }", "public function validateRowForReplace(array $rowData, $rowNumber)\n {\n $this->validateRowForDelete($rowData, $rowNumber);\n $this->validateRowForUpdate($rowData, $rowNumber);\n }", "abstract protected function updateSpecificProperties($row);", "public function checkIsValidForUpdate() {\n $errors = array();\n\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"Notification is not valid\");\n }\n }", "public function checkIntegrity();", "function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$this->Ruta_Archivo->OldUploadPath = 'ArchivosPase';\r\n\t\t\t$this->Ruta_Archivo->UploadPath = $this->Ruta_Archivo->OldUploadPath;\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Serie_Equipo\r\n\t\t\t$this->Serie_Equipo->SetDbValueDef($rsnew, $this->Serie_Equipo->CurrentValue, NULL, $this->Serie_Equipo->ReadOnly);\r\n\r\n\t\t\t// Id_Hardware\r\n\t\t\t$this->Id_Hardware->SetDbValueDef($rsnew, $this->Id_Hardware->CurrentValue, NULL, $this->Id_Hardware->ReadOnly);\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly);\r\n\r\n\t\t\t// Modelo_Net\r\n\t\t\t$this->Modelo_Net->SetDbValueDef($rsnew, $this->Modelo_Net->CurrentValue, NULL, $this->Modelo_Net->ReadOnly);\r\n\r\n\t\t\t// Marca_Arranque\r\n\t\t\t$this->Marca_Arranque->SetDbValueDef($rsnew, $this->Marca_Arranque->CurrentValue, NULL, $this->Marca_Arranque->ReadOnly);\r\n\r\n\t\t\t// Nombre_Titular\r\n\t\t\t$this->Nombre_Titular->SetDbValueDef($rsnew, $this->Nombre_Titular->CurrentValue, NULL, $this->Nombre_Titular->ReadOnly);\r\n\r\n\t\t\t// Dni_Titular\r\n\t\t\t$this->Dni_Titular->SetDbValueDef($rsnew, $this->Dni_Titular->CurrentValue, NULL, $this->Dni_Titular->ReadOnly);\r\n\r\n\t\t\t// Cuil_Titular\r\n\t\t\t$this->Cuil_Titular->SetDbValueDef($rsnew, $this->Cuil_Titular->CurrentValue, NULL, $this->Cuil_Titular->ReadOnly);\r\n\r\n\t\t\t// Nombre_Tutor\r\n\t\t\t$this->Nombre_Tutor->SetDbValueDef($rsnew, $this->Nombre_Tutor->CurrentValue, NULL, $this->Nombre_Tutor->ReadOnly);\r\n\r\n\t\t\t// DniTutor\r\n\t\t\t$this->DniTutor->SetDbValueDef($rsnew, $this->DniTutor->CurrentValue, NULL, $this->DniTutor->ReadOnly);\r\n\r\n\t\t\t// Domicilio\r\n\t\t\t$this->Domicilio->SetDbValueDef($rsnew, $this->Domicilio->CurrentValue, NULL, $this->Domicilio->ReadOnly);\r\n\r\n\t\t\t// Tel_Tutor\r\n\t\t\t$this->Tel_Tutor->SetDbValueDef($rsnew, $this->Tel_Tutor->CurrentValue, NULL, $this->Tel_Tutor->ReadOnly);\r\n\r\n\t\t\t// CelTutor\r\n\t\t\t$this->CelTutor->SetDbValueDef($rsnew, $this->CelTutor->CurrentValue, NULL, $this->CelTutor->ReadOnly);\r\n\r\n\t\t\t// Cue_Establecimiento_Alta\r\n\t\t\t$this->Cue_Establecimiento_Alta->SetDbValueDef($rsnew, $this->Cue_Establecimiento_Alta->CurrentValue, NULL, $this->Cue_Establecimiento_Alta->ReadOnly);\r\n\r\n\t\t\t// Escuela_Alta\r\n\t\t\t$this->Escuela_Alta->SetDbValueDef($rsnew, $this->Escuela_Alta->CurrentValue, NULL, $this->Escuela_Alta->ReadOnly);\r\n\r\n\t\t\t// Directivo_Alta\r\n\t\t\t$this->Directivo_Alta->SetDbValueDef($rsnew, $this->Directivo_Alta->CurrentValue, NULL, $this->Directivo_Alta->ReadOnly);\r\n\r\n\t\t\t// Cuil_Directivo_Alta\r\n\t\t\t$this->Cuil_Directivo_Alta->SetDbValueDef($rsnew, $this->Cuil_Directivo_Alta->CurrentValue, NULL, $this->Cuil_Directivo_Alta->ReadOnly);\r\n\r\n\t\t\t// Dpto_Esc_alta\r\n\t\t\t$this->Dpto_Esc_alta->SetDbValueDef($rsnew, $this->Dpto_Esc_alta->CurrentValue, NULL, $this->Dpto_Esc_alta->ReadOnly);\r\n\r\n\t\t\t// Localidad_Esc_Alta\r\n\t\t\t$this->Localidad_Esc_Alta->SetDbValueDef($rsnew, $this->Localidad_Esc_Alta->CurrentValue, NULL, $this->Localidad_Esc_Alta->ReadOnly);\r\n\r\n\t\t\t// Domicilio_Esc_Alta\r\n\t\t\t$this->Domicilio_Esc_Alta->SetDbValueDef($rsnew, $this->Domicilio_Esc_Alta->CurrentValue, NULL, $this->Domicilio_Esc_Alta->ReadOnly);\r\n\r\n\t\t\t// Rte_Alta\r\n\t\t\t$this->Rte_Alta->SetDbValueDef($rsnew, $this->Rte_Alta->CurrentValue, NULL, $this->Rte_Alta->ReadOnly);\r\n\r\n\t\t\t// Tel_Rte_Alta\r\n\t\t\t$this->Tel_Rte_Alta->SetDbValueDef($rsnew, $this->Tel_Rte_Alta->CurrentValue, NULL, $this->Tel_Rte_Alta->ReadOnly);\r\n\r\n\t\t\t// Email_Rte_Alta\r\n\t\t\t$this->Email_Rte_Alta->SetDbValueDef($rsnew, $this->Email_Rte_Alta->CurrentValue, NULL, $this->Email_Rte_Alta->ReadOnly);\r\n\r\n\t\t\t// Serie_Server_Alta\r\n\t\t\t$this->Serie_Server_Alta->SetDbValueDef($rsnew, $this->Serie_Server_Alta->CurrentValue, NULL, $this->Serie_Server_Alta->ReadOnly);\r\n\r\n\t\t\t// Cue_Establecimiento_Baja\r\n\t\t\t$this->Cue_Establecimiento_Baja->SetDbValueDef($rsnew, $this->Cue_Establecimiento_Baja->CurrentValue, NULL, $this->Cue_Establecimiento_Baja->ReadOnly);\r\n\r\n\t\t\t// Escuela_Baja\r\n\t\t\t$this->Escuela_Baja->SetDbValueDef($rsnew, $this->Escuela_Baja->CurrentValue, NULL, $this->Escuela_Baja->ReadOnly);\r\n\r\n\t\t\t// Directivo_Baja\r\n\t\t\t$this->Directivo_Baja->SetDbValueDef($rsnew, $this->Directivo_Baja->CurrentValue, NULL, $this->Directivo_Baja->ReadOnly);\r\n\r\n\t\t\t// Cuil_Directivo_Baja\r\n\t\t\t$this->Cuil_Directivo_Baja->SetDbValueDef($rsnew, $this->Cuil_Directivo_Baja->CurrentValue, NULL, $this->Cuil_Directivo_Baja->ReadOnly);\r\n\r\n\t\t\t// Dpto_Esc_Baja\r\n\t\t\t$this->Dpto_Esc_Baja->SetDbValueDef($rsnew, $this->Dpto_Esc_Baja->CurrentValue, NULL, $this->Dpto_Esc_Baja->ReadOnly);\r\n\r\n\t\t\t// Localidad_Esc_Baja\r\n\t\t\t$this->Localidad_Esc_Baja->SetDbValueDef($rsnew, $this->Localidad_Esc_Baja->CurrentValue, NULL, $this->Localidad_Esc_Baja->ReadOnly);\r\n\r\n\t\t\t// Domicilio_Esc_Baja\r\n\t\t\t$this->Domicilio_Esc_Baja->SetDbValueDef($rsnew, $this->Domicilio_Esc_Baja->CurrentValue, NULL, $this->Domicilio_Esc_Baja->ReadOnly);\r\n\r\n\t\t\t// Rte_Baja\r\n\t\t\t$this->Rte_Baja->SetDbValueDef($rsnew, $this->Rte_Baja->CurrentValue, NULL, $this->Rte_Baja->ReadOnly);\r\n\r\n\t\t\t// Tel_Rte_Baja\r\n\t\t\t$this->Tel_Rte_Baja->SetDbValueDef($rsnew, $this->Tel_Rte_Baja->CurrentValue, NULL, $this->Tel_Rte_Baja->ReadOnly);\r\n\r\n\t\t\t// Email_Rte_Baja\r\n\t\t\t$this->Email_Rte_Baja->SetDbValueDef($rsnew, $this->Email_Rte_Baja->CurrentValue, NULL, $this->Email_Rte_Baja->ReadOnly);\r\n\r\n\t\t\t// Serie_Server_Baja\r\n\t\t\t$this->Serie_Server_Baja->SetDbValueDef($rsnew, $this->Serie_Server_Baja->CurrentValue, NULL, $this->Serie_Server_Baja->ReadOnly);\r\n\r\n\t\t\t// Fecha_Pase\r\n\t\t\t$this->Fecha_Pase->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->Fecha_Pase->CurrentValue, 7), NULL, $this->Fecha_Pase->ReadOnly);\r\n\r\n\t\t\t// Id_Estado_Pase\r\n\t\t\t$this->Id_Estado_Pase->SetDbValueDef($rsnew, $this->Id_Estado_Pase->CurrentValue, 0, $this->Id_Estado_Pase->ReadOnly);\r\n\r\n\t\t\t// Ruta_Archivo\r\n\t\t\tif ($this->Ruta_Archivo->Visible && !$this->Ruta_Archivo->ReadOnly && !$this->Ruta_Archivo->Upload->KeepFile) {\r\n\t\t\t\t$this->Ruta_Archivo->Upload->DbValue = $rsold['Ruta_Archivo']; // Get original value\r\n\t\t\t\tif ($this->Ruta_Archivo->Upload->FileName == \"\") {\r\n\t\t\t\t\t$rsnew['Ruta_Archivo'] = NULL;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$rsnew['Ruta_Archivo'] = $this->Ruta_Archivo->Upload->FileName;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($this->Ruta_Archivo->Visible && !$this->Ruta_Archivo->Upload->KeepFile) {\r\n\t\t\t\t$this->Ruta_Archivo->UploadPath = 'ArchivosPase';\r\n\t\t\t\t$OldFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->DbValue);\r\n\t\t\t\tif (!ew_Empty($this->Ruta_Archivo->Upload->FileName)) {\r\n\t\t\t\t\t$NewFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->FileName);\r\n\t\t\t\t\t$FileCount = count($NewFiles);\r\n\t\t\t\t\tfor ($i = 0; $i < $FileCount; $i++) {\r\n\t\t\t\t\t\t$fldvar = ($this->Ruta_Archivo->Upload->Index < 0) ? $this->Ruta_Archivo->FldVar : substr($this->Ruta_Archivo->FldVar, 0, 1) . $this->Ruta_Archivo->Upload->Index . substr($this->Ruta_Archivo->FldVar, 1);\r\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\r\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\r\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file)) {\r\n\t\t\t\t\t\t\t\tif (!in_array($file, $OldFiles)) {\r\n\t\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $this->Ruta_Archivo->UploadPath), $file); // Get new file name\r\n\t\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\r\n\t\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file1)) // Make sure did not clash with existing upload file\r\n\t\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename(ew_UploadPathEx(TRUE, $this->Ruta_Archivo->UploadPath), $file1, TRUE); // Use indexed name\r\n\t\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file, ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file1);\r\n\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->Ruta_Archivo->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\r\n\t\t\t\t\t$rsnew['Ruta_Archivo'] = $this->Ruta_Archivo->Upload->FileName;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$NewFiles = array();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t\tif ($this->Ruta_Archivo->Visible && !$this->Ruta_Archivo->Upload->KeepFile) {\r\n\t\t\t\t\t\t$OldFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->DbValue);\r\n\t\t\t\t\t\tif (!ew_Empty($this->Ruta_Archivo->Upload->FileName)) {\r\n\t\t\t\t\t\t\t$NewFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->FileName);\r\n\t\t\t\t\t\t\t$NewFiles2 = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $rsnew['Ruta_Archivo']);\r\n\t\t\t\t\t\t\t$FileCount = count($NewFiles);\r\n\t\t\t\t\t\t\tfor ($i = 0; $i < $FileCount; $i++) {\r\n\t\t\t\t\t\t\t\t$fldvar = ($this->Ruta_Archivo->Upload->Index < 0) ? $this->Ruta_Archivo->FldVar : substr($this->Ruta_Archivo->FldVar, 0, 1) . $this->Ruta_Archivo->Upload->Index . substr($this->Ruta_Archivo->FldVar, 1);\r\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\r\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $NewFiles[$i];\r\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\r\n\t\t\t\t\t\t\t\t\t\t$this->Ruta_Archivo->Upload->SaveToFile($this->Ruta_Archivo->UploadPath, (@$NewFiles2[$i] <> \"\") ? $NewFiles2[$i] : $NewFiles[$i], TRUE, $i); // Just replace\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$NewFiles = array();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$FileCount = count($OldFiles);\r\n\t\t\t\t\t\tfor ($i = 0; $i < $FileCount; $i++) {\r\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\r\n\t\t\t\t\t\t\t\t@unlink(ew_UploadPathEx(TRUE, $this->Ruta_Archivo->OldUploadPath) . $OldFiles[$i]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\r\n\t\t// Ruta_Archivo\r\n\t\tew_CleanUploadTempPath($this->Ruta_Archivo, $this->Ruta_Archivo->Upload->Index);\r\n\t\treturn $EditRow;\r\n\t}", "public function validate(){\n\n if(!$this->convert_and_validate_rows()){\n return 0;\n }\n\n if(!$this->validate_columns()){\n return 0;\n }\n\n if(!$this->validate_regions()){\n return 0;\n }\n\n return 1;\n }", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$this->featured_image->OldUploadPath = \"../uploads/product/\";\n\t\t\t$this->featured_image->UploadPath = $this->featured_image->OldUploadPath;\n\t\t\t$rsnew = array();\n\n\t\t\t// cat_id\n\t\t\t$this->cat_id->SetDbValueDef($rsnew, $this->cat_id->CurrentValue, 0, $this->cat_id->ReadOnly || $this->cat_id->MultiUpdate <> \"1\");\n\n\t\t\t// company_id\n\t\t\t$this->company_id->SetDbValueDef($rsnew, $this->company_id->CurrentValue, 0, $this->company_id->ReadOnly || $this->company_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_model\n\t\t\t$this->pro_model->SetDbValueDef($rsnew, $this->pro_model->CurrentValue, NULL, $this->pro_model->ReadOnly || $this->pro_model->MultiUpdate <> \"1\");\n\n\t\t\t// pro_name\n\t\t\t$this->pro_name->SetDbValueDef($rsnew, $this->pro_name->CurrentValue, NULL, $this->pro_name->ReadOnly || $this->pro_name->MultiUpdate <> \"1\");\n\n\t\t\t// pro_description\n\t\t\t$this->pro_description->SetDbValueDef($rsnew, $this->pro_description->CurrentValue, NULL, $this->pro_description->ReadOnly || $this->pro_description->MultiUpdate <> \"1\");\n\n\t\t\t// pro_condition\n\t\t\t$this->pro_condition->SetDbValueDef($rsnew, $this->pro_condition->CurrentValue, NULL, $this->pro_condition->ReadOnly || $this->pro_condition->MultiUpdate <> \"1\");\n\n\t\t\t// pro_features\n\t\t\t$this->pro_features->SetDbValueDef($rsnew, $this->pro_features->CurrentValue, NULL, $this->pro_features->ReadOnly || $this->pro_features->MultiUpdate <> \"1\");\n\n\t\t\t// post_date\n\t\t\t$this->post_date->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['post_date'] = &$this->post_date->DbValue;\n\n\t\t\t// ads_id\n\t\t\t$this->ads_id->SetDbValueDef($rsnew, $this->ads_id->CurrentValue, NULL, $this->ads_id->ReadOnly || $this->ads_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_base_price\n\t\t\t$this->pro_base_price->SetDbValueDef($rsnew, $this->pro_base_price->CurrentValue, NULL, $this->pro_base_price->ReadOnly || $this->pro_base_price->MultiUpdate <> \"1\");\n\n\t\t\t// pro_sell_price\n\t\t\t$this->pro_sell_price->SetDbValueDef($rsnew, $this->pro_sell_price->CurrentValue, NULL, $this->pro_sell_price->ReadOnly || $this->pro_sell_price->MultiUpdate <> \"1\");\n\n\t\t\t// featured_image\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->ReadOnly && strval($this->featured_image->MultiUpdate) == \"1\" && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->Upload->DbValue = $rsold['featured_image']; // Get original value\n\t\t\t\tif ($this->featured_image->Upload->FileName == \"\") {\n\t\t\t\t\t$rsnew['featured_image'] = NULL;\n\t\t\t\t} else {\n\t\t\t\t\t$rsnew['featured_image'] = $this->featured_image->Upload->FileName;\n\t\t\t\t}\n\t\t\t\t$this->featured_image->ImageWidth = 875; // Resize width\n\t\t\t\t$this->featured_image->ImageHeight = 665; // Resize height\n\t\t\t}\n\n\t\t\t// folder_image\n\t\t\t$this->folder_image->SetDbValueDef($rsnew, $this->folder_image->CurrentValue, \"\", $this->folder_image->ReadOnly || $this->folder_image->MultiUpdate <> \"1\");\n\n\t\t\t// pro_status\n\t\t\t$tmpBool = $this->pro_status->CurrentValue;\n\t\t\tif ($tmpBool <> \"Y\" && $tmpBool <> \"N\")\n\t\t\t\t$tmpBool = (!empty($tmpBool)) ? \"Y\" : \"N\";\n\t\t\t$this->pro_status->SetDbValueDef($rsnew, $tmpBool, \"N\", $this->pro_status->ReadOnly || $this->pro_status->MultiUpdate <> \"1\");\n\n\t\t\t// branch_id\n\t\t\t$this->branch_id->SetDbValueDef($rsnew, $this->branch_id->CurrentValue, NULL, $this->branch_id->ReadOnly || $this->branch_id->MultiUpdate <> \"1\");\n\n\t\t\t// lang\n\t\t\t$this->lang->SetDbValueDef($rsnew, $this->lang->CurrentValue, \"\", $this->lang->ReadOnly || $this->lang->MultiUpdate <> \"1\");\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->UploadPath = \"../uploads/product/\";\n\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file)) {\n\t\t\t\t\t\t\t\t$OldFileFound = FALSE;\n\t\t\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\t\t\tfor ($j = 0; $j < $OldFileCount; $j++) {\n\t\t\t\t\t\t\t\t\t$file1 = $OldFiles[$j];\n\t\t\t\t\t\t\t\t\tif ($file1 == $file) { // Old file found, no need to delete anymore\n\t\t\t\t\t\t\t\t\t\tunset($OldFiles[$j]);\n\t\t\t\t\t\t\t\t\t\t$OldFileFound = TRUE;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($OldFileFound) // No need to check if file exists further\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx($this->featured_image->PhysicalUploadPath(), $file); // Get new file name\n\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\n\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1) || file_exists($this->featured_image->PhysicalUploadPath() . $file1)) // Make sure no file name clash\n\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename($this->featured_image->PhysicalUploadPath(), $file1, TRUE); // Use indexed name\n\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file, ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1);\n\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->featured_image->Upload->DbValue = empty($OldFiles) ? \"\" : implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $OldFiles);\n\t\t\t\t\t$this->featured_image->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\n\t\t\t\t\t$this->featured_image->SetDbValueDef($rsnew, $this->featured_image->Upload->FileName, \"\", $this->featured_image->ReadOnly || $this->featured_image->MultiUpdate <> \"1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t\t\t$NewFiles2 = array($rsnew['featured_image']);\n\t\t\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $NewFiles[$i];\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\n\t\t\t\t\t\t\t\t\t\tif (@$NewFiles2[$i] <> \"\") // Use correct file name\n\t\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $NewFiles2[$i];\n\t\t\t\t\t\t\t\t\t\tif (!$this->featured_image->Upload->ResizeAndSaveToFile($this->featured_image->ImageWidth, $this->featured_image->ImageHeight, EW_THUMBNAIL_DEFAULT_QUALITY, $NewFiles[$i], TRUE, $i)) {\n\t\t\t\t\t\t\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UploadErrMsg7\"));\n\t\t\t\t\t\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$NewFiles = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\tfor ($i = 0; $i < $OldFileCount; $i++) {\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\n\t\t\t\t\t\t\t\t@unlink($this->featured_image->OldPhysicalUploadPath() . $OldFiles[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\n\t\t// featured_image\n\t\tew_CleanUploadTempPath($this->featured_image, $this->featured_image->Upload->Index);\n\t\treturn $EditRow;\n\t}", "public function update(){\n\t\t$this->beforeSave();\n\t\t$tableName = $this->tableName();\n\t\t$fields = $this->fields();\n\t\t// Remove fields set as ignored by rules validation.\n\t\t$fields = $this->removeIgnored($fields);\n\t\t// Create PDO placeholders.\n\t\t$params = implode(', ', array_map(fn($name) => $name . ' = :' . $name, $fields));\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\t$where = $primaryKey . ' = :' . $primaryKey;\n\t\t$statement = $this->db->prepare('UPDATE ' . $tableName . ' SET ' . $params . ' WHERE ' . $where);\n\t\t// Bind values to placeholders.\n\t\tforeach($fields as $field){\n\t\t\t$this->binder($statement, ':' . $field, $this->{$field});\n\t\t}\n\t\t$statement->bindValue(':' . $primaryKey, $this->{$primaryKey});\n\t\tif($statement->execute()){\n\t\t\t$this->afterSave();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function testValueValidationForUpdate()\n {\n $eavValue = $this->getEavValueRepo()->findOneBy(['value' => 'customer_invoice']);\n\n $this->assertNotNull($eavValue);\n\n $eavValue->setValue('not_existing_type');\n\n $this->em->persist($eavValue);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavValue->getDocument()->getLastViolations();\n\n $this->assertCount(1, $violations);\n }", "public function updateRow($row);", "public function check () {\n $modelName = $this->field->model->name;\n $fieldName = $this->field->name;\n $bean = $this->field->model->bean;\n $ctx = @$this->field->constraints['context'];\n $update = $ctx ? strpos(\",,{$ctx->value},\", ',update,') : true;\n return $this->dispatch(\n (!$this->value) || ($this->field && $this->field->value) || ($bean->id && !$update),\n \"{$this->field->title} is required\"\n );\n }", "public function save(){\n\t\t$res = true;\n\t\t$changedData = $this->changedData();\n\t\tif(count($changedData)){\n\t\t\tif(!empty($this->orig)){\n\t\t\t\t$res = (dbHelper::updateQry($this->tableName,$changedData,array($this->primaryKey=>$this->data[$this->primaryKey]))?true:false);\n\t\t\t\t$this->orig = $this->data;\n\t\t\t} else {\n\t\t\t\t//if this row has been deleted but someone else saves data to it this will automatically restore the row from $data\n\t\t\t\t$res = (dbHelper::insertQry($this->tableName,$this->data)?true:false);\n\t\t\t\t$this->data[$this->primaryKey] = db::insertID();\n\t\t\t\tdbData::addRow($this->tableName,$this->primaryKey,$this->data);\n\t\t\t\t$this->orig =& dbData::rowRefrence($this->tableName,$this->primaryKey,$this->data[$this->primaryKey]);\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "private function array_validator(array $data)\n {\n if (!array_key_exists(0, $data))\n {\n $this->is_valid = false;\n return false;\n }\n\n if ($data[0] === false)\n {\n $this->is_empty = true;\n return false;\n }\n\n if (!is_array($data[0]))\n {\n // 1 dimensional data -- diverge from typical here to\n // function for 1 dimensional data?\n }\n\n $this->columns = $this->set_columns(array_keys($data[0]));\n \n if (empty($this->columns))\n {\n $this->is_empty = false;\n return false;\n }\n\n $this->set_number_of_columns(count($this->columns));\n $number_of_rows = 0;\n\n foreach ($data as $row)\n {\n ++$number_of_rows;\n if (count(array_keys($row)) > $this->number_of_columns)\n {\n // invalid data\n // data must have same number of columns throughout.\n // although, there is a desgin decision here: it is possible\n // that this ought to be considered valid data, and a filling\n // of the data could be performed... *thinking on that*\n }\n \n foreach ($this->columns as $key)\n {\n if (!array_key_exists($key, $row))\n {\n // invalid data? or possibly same decison as above\n // and fill the data...\n }\n }\n }\n\n $this->set_number_of_rows($number_of_rows);\n\n // valid array. from here, either pass $data to a building function\n // or simply say $this->data = $data. unsure of design yet.\n }", "public function testUpdateValidReading(): void {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"reading\");\n\n // create a new Reading and insert into mySQL\n $reading = new Reading(null, $this->sensor->getSensorId(), $this->VALID_SENSORVALUE, $this->VALID_SENSORDATETIME);\n $reading->insert($this->getPDO());\n\n // edit the Reading and update it in mySQL\n\t\t $reading->setSensorValue($this->VALID_SENSORVALUE2);\n\t\t $reading->update($this->getPDO());\n\n // grab the data from mySQL and enforce the fields match our expectations\n $pdoReading = Reading::getReadingByReadingId($this->getPDO(), $reading->getReadingId());\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"reading\"));\n $this->assertEquals($pdoReading->getReadingSensorId(), $this->sensor->getSensorId());\n $this->assertEquals($pdoReading->getSensorValue(), $this->VALID_SENSORVALUE2);\n $this->assertEquals($pdoReading->getSensorDateTime()->getTimestamp(), $this->VALID_SENSORDATETIME->getTimestamp());\n }", "public function testValidatorForMinimum()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => '1',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n //Execute -----------------------------\n $updatePostData = [\n 'datasource_name' => \"normal\",\n 'table_id' => 0,\n 'starting_row_number' => 0,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data doesn't update\n $this->assertEquals($postDataAdd['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($postDataAdd['table_id'], $updatedTable->table_id);\n $this->assertEquals($postDataAdd['starting_row_number'], $updatedTable->starting_row_number);\n\n\n //Check response\n $updateResponse\n ->assertStatus(422)\n ->assertJsonFragment([\"開始行には、1以上の数字を指定してください。\"])\n ->assertJsonFragment([\"テーブルIDには、1以上の数字を指定してください。\"]);\n }", "protected function validateQuery(): bool {\n\t\t$columnsCount = count($this->columns);\n\t\t$valuesCount = count($this->values);\n\t\tif ($columnsCount === 0 || $valuesCount === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($this->values as $valueRow) {\n\t\t\tif (count($valueRow) !== $columnsCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn parent::validateQuery();\n\t}", "public function update(){\r\n\t\tif (!$this->hasChanged) return self::RES_UNCHANGED;\r\n\t\t$table = $this->getTable();\r\n\t\tif ($this->new){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the record doesn't exist.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\tif (!$table->hasPrimaryKey()){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the table does not have a primary key.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$where = array();\r\n\t\t$changeCount = 0;\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\tif ($value->hasChanged()){\r\n\t\t\t\t$vals[] = \"`$name` = \".$value->getSQLValue();\r\n\t\t\t\t$changeCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\t$where[] = \"`$name` = \".$this->values[$name]->getSQLValue();\r\n\t\t}\r\n\t\t$sql = 'UPDATE '.$this->getFullTableName().' SET '.implode(', ',$vals).' WHERE '.implode(' AND ',$where).' LIMIT 1';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to update record in '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function modifyRecords(){\n \n // Get the sql statement\n $sql = $this->updateSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->requestUpdateValues as $key => $value) {\n $stmt->bindParam($this->params['columnName_Pdo'][$key], $this->requestUpdateValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }", "public function isValidRow(array $record): bool\r\n {\r\n $this->lastError = '';\r\n if (count($record) !== $this->getColumnCount()) {\r\n $this->lastError = 'The number of columns in the record does'\r\n . ' not match the number of defined columns';\r\n return false;\r\n }\r\n\r\n foreach ($this->columns as $id => $rules) {\r\n if (!array_key_exists($id, $record)) {\r\n $this->lastError = sprintf(\r\n 'No value for column \"%s\" is given', $id\r\n );\r\n return false;\r\n }\r\n if (!$this->isValidFieldValue($id, $record[$id])) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public function validate(phpDataMapper_Model_Row $row)\n\t{\n\t\t// Check validation rules on each feild\n\t\tforeach($this->fields as $field => $fieldAttrs) {\n\t\t\tif(isset($fieldAttrs['required']) && true === $fieldAttrs['required']) {\n\t\t\t\t// Required field\n\t\t\t\tif(empty($row->$field)) {\n\t\t\t\t\t$this->addError(\"Required field '\" . $field . \"' was left blank\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check for errors\n\t\tif($this->hasErrors()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "abstract protected function validate($data);", "public function validate() {\n\t\t// field validation:\n\t\t$sw = $this->exists();\n\t\t$this->errors = validation::validate($this->new_data, $this->vrules, $sw);\n\t\tif ($this->errors) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// uniques:\n\t\tif ($this->errors = $this->check_uniques()) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function testSaveDataTableUpdateRows() {\r\n\t\t// Prepare the database table via SQL\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n\t\t// Create a datatable where only one column should be updated\r\n\t\t$datatable = new avorium_core_data_DataTable(3, 2);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'STRING_VALUE');\r\n\t\t// Store a new record without any null values\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$datatable->setCellValue($i, 0, $records[$i]['UUID']);\r\n\t\t\t$datatable->setCellValue($i, 1, 'New value '.$i);\r\n\t\t}\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t\t// Read out the database, all other columns must have the old values\r\n\t\t$result = $this->executeQuery('select UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE from POTEST order by UUID');\r\n\t\t$this->assertEquals(3, count($result), 'Wrong row count');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$this->assertEquals($records[$i]['UUID'], $result[$i]['UUID'], 'UUID from database is not as expected in row '.$i.'.');\r\n\t\t\t$this->assertEquals($records[$i]['bool']?1:0, $result[$i]['BOOLEAN_VALUE'], 'Boolean value from database is not as expected in row '.$i.'.');\r\n\t\t\t$this->assertEquals($records[$i]['int'], $result[$i]['INT_VALUE'], 'Integer value from database is not as expected in row '.$i.'.');\r\n\t\t\t$this->assertEquals('New value '.$i, $result[$i]['STRING_VALUE'], 'String value from database is not as expected in row '.$i.'.');\r\n\t\t}\r\n\t}", "protected function _prepareDataForUpdate(array $rowData):array\n {\n $multiSeparator = $this->getMultipleValueSeparator();\n $email = strtolower($rowData[self::COLUMN_EMAIL]);\n $customerId = $this->_getCustomerId($email, $rowData[self::COLUMN_WEBSITE]);\n // entity table data\n $entityRowNew = [];\n $entityRowUpdate = [];\n // attribute values\n $attributes = [];\n // customer default addresses\n $defaults = [];\n $newAddress = true;\n // get address id\n if ($rowData[self::COLUMN_ADDRESS_ID]\n && $this->addressStorage->doesExist(\n $rowData[self::COLUMN_ADDRESS_ID],\n (string)$customerId\n )\n ) {\n $newAddress = false;\n $addressId = $rowData[self::COLUMN_ADDRESS_ID];\n } else {\n $addressId = $this->_getNextEntityId();\n }\n $entityRow = [\n 'entity_id' => $addressId,\n 'parent_id' => $customerId,\n 'updated_at' => (new \\DateTime())->format(\\Magento\\Framework\\Stdlib\\DateTime::DATETIME_PHP_FORMAT),\n ];\n $websiteId = $this->_websiteCodeToId[$rowData[self::COLUMN_WEBSITE]];\n\n foreach ($this->_attributes as $attributeAlias => $attributeParams) {\n if (array_key_exists($attributeAlias, $rowData)) {\n $attributeParams = $this->adjustAttributeDataForWebsite($attributeParams, $websiteId);\n\n if (!strlen($rowData[$attributeAlias])) {\n if ($newAddress) {\n $value = null;\n } else {\n continue;\n }\n } elseif ($newAddress && !strlen($rowData[$attributeAlias])) {\n } elseif (in_array($attributeParams['type'], ['select', 'boolean'])) {\n $value = $this->getSelectAttrIdByValue($attributeParams, mb_strtolower($rowData[$attributeAlias]));\n } elseif ('datetime' == $attributeParams['type']) {\n $value = (new \\DateTime())->setTimestamp(strtotime($rowData[$attributeAlias]));\n $value = $value->format(\\Magento\\Framework\\Stdlib\\DateTime::DATETIME_PHP_FORMAT);\n } elseif ('multiselect' == $attributeParams['type']) {\n $ids = [];\n foreach (explode($multiSeparator, mb_strtolower($rowData[$attributeAlias])) as $subValue) {\n $ids[] = $this->getSelectAttrIdByValue($attributeParams, $subValue);\n }\n $value = implode(',', $ids);\n } else {\n $value = $rowData[$attributeAlias];\n }\n if ($attributeParams['is_static']) {\n $entityRow[$attributeAlias] = $value;\n } else {\n $attributes[$attributeParams['table']][$addressId][$attributeParams['id']]= $value;\n }\n }\n }\n foreach (self::getDefaultAddressAttributeMapping() as $columnName => $attributeCode) {\n if (!empty($rowData[$columnName])) {\n /** @var $attribute \\Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute */\n $table = $this->_getCustomerEntity()->getResource()->getTable('customer_entity');\n $defaults[$table][$customerId][$attributeCode] = $addressId;\n }\n }\n // let's try to find region ID\n $entityRow['region_id'] = null;\n if (!empty($rowData[self::COLUMN_REGION])) {\n $countryNormalized = strtolower($rowData[self::COLUMN_COUNTRY_ID]);\n $regionNormalized = strtolower($rowData[self::COLUMN_REGION]);\n\n if (isset($this->_countryRegions[$countryNormalized][$regionNormalized])) {\n $regionId = $this->_countryRegions[$countryNormalized][$regionNormalized];\n $entityRow[self::COLUMN_REGION] = $this->_regions[$regionId];\n $entityRow['region_id'] = $regionId;\n }\n }\n if ($newAddress) {\n $entityRowNew = $entityRow;\n $entityRowNew['created_at'] =\n (new \\DateTime())->format(\\Magento\\Framework\\Stdlib\\DateTime::DATETIME_PHP_FORMAT);\n } else {\n $entityRowUpdate = $entityRow;\n }\n\n return [\n 'entity_row_new' => $entityRowNew,\n 'entity_row_update' => $entityRowUpdate,\n 'attributes' => $attributes,\n 'defaults' => $defaults\n ];\n }", "public function updateData()\n {\n try {\n// echo \"<pre>\";\n// print_r($this->where);\n// print_r($this->insertUpdateArray);\n// exit;\n DB::table($this->dbTable)\n ->where($this->where)\n ->update($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n }", "public function testEdit() {\r\n\t\t$result = $this->ShopProductAttribute->edit('shopproductattribute-1', null);\r\n\r\n\t\t$expected = $this->ShopProductAttribute->read(null, 'shopproductattribute-1');\r\n\t\t$this->assertEqual($result['ShopProductAttribute'], $expected['ShopProductAttribute']);\r\n\r\n\t\t// put invalidated data here\r\n\t\t$data = $this->record;\r\n\t\t//$data['ShopProductAttribute']['title'] = null;\r\n\r\n\t\t$result = $this->ShopProductAttribute->edit('shopproductattribute-1', $data);\r\n\t\t$this->assertEqual($result, $data);\r\n\r\n\t\t$data = $this->record;\r\n\r\n\t\t$result = $this->ShopProductAttribute->edit('shopproductattribute-1', $data);\r\n\t\t$this->assertTrue($result);\r\n\r\n\t\t$result = $this->ShopProductAttribute->read(null, 'shopproductattribute-1');\r\n\r\n\t\t// put record specific asserts here for example\r\n\t\t// $this->assertEqual($result['ShopProductAttribute']['title'], $data['ShopProductAttribute']['title']);\r\n\r\n\t\ttry {\r\n\t\t\t$this->ShopProductAttribute->edit('wrong_id', $data);\r\n\t\t\t$this->fail('No exception');\r\n\t\t} catch (OutOfBoundsException $e) {\r\n\t\t\t$this->pass('Correct exception thrown');\r\n\t\t}\r\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function valid() {\n // TODO: Check numProcessed against itemlimit\n return !is_null($this->currentRow);\n }", "public function testUpdateValidProperty() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//edit the property and update it in MySQL\n\t\t$property->setPropertyValue($this->VALID_PROPERTYVALUE2);\n\t\t$property->update($this->getPDO());\n\n\t\t//grab dah data from mySQL and check that the fields match our expectations\n\t\t$pdoProperty = Property::getPropertyByPropertyId($this->getPDO(), $property->getPropertyId());\n\t\t$this->assertEquals($numRows +1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE2);\n\t}", "public function updateCreateColdStorage(Request $request,$row_id){\n \n $getLotInfoId = LotInfo::find($row_id);\n if(!empty($getLotInfoId)){\n $validator = validator::make($request->all(), [\n \n 'lot_number' => 'required|string',\n 'production_date' => 'required|date_format:Y-m-d',\n 'coldStorage' => 'required|array'\n ]);\n if($validator->fails()){\n return response()->json(['error'=>$validator->errors()], 401);\n }\n $validator2 = validator::make($request->all(), [\n\n 'coldStorage.*.reading_date' => 'required|date_format:Y-m-d',\n 'coldStorage.*.cold_room_number' => 'required|numeric|min:1|max:999999',\n 'coldStorage.*.fish_temp' => 'required|numeric|min:1|max:999999',\n 'coldStorage.*.cold_room_temp' => 'required|numeric|min:1|max:999999',\n 'coldStorage.*.comment' => 'required|string|max:255',\n 'coldStorage.*.cold_temp_image' => 'required|numeric|min:1|max:999999',\n 'coldStorage.*.cold_temp_images' => 'required|numeric|min:1|max:999999'\n ]);\n if(!empty($validator2->fails())){\n return response()->json(['error'=>$validator2->errors()], 401);\n }\n $update = array(\n\n 'reading_date' => $request->reading_date,\n 'cold_room_number' => $request->cold_room_number,\n 'fish_temp' => $request->fish_temp,\n 'cold_room_temp' => $request->cold_room_temp,\n 'comment' => $request->comment,\n 'cold_temp_image' => $request->cold_temp_image,\n 'cold_temp_images' => $request->cold_temp_images,\n );\n if(($getLotInfoId->lot_number != $request->lot_number) || ($getLotInfoId->production_date != $request->production_date)){\n return response()->json(['error'=>'Lot number And Production date does not exits!'], 401);\n }\n if(count($request->coldStorage)){\n foreach($request->coldStorage as $coldStorage){\n $coldStorage['lot_number'] = $request->lot_number;\n $coldStorage['production_date'] = $request->production_date;\n OnlineQcColdStorage::updateOrCreate(['id'=>isset($coldStorage['id'])?$coldStorage['id']:null],$coldStorage);\n }\n }\n return response()->json($request->all(), 200);\n } \n else{\n return response()->json(['error'=>'Lot number not found!'], 401);\n }\n}", "private function checkRowConsistency($row)\n {\n if ( $this->strict === false ) {\n return;\n }\n\n $current = count($row);\n\n if ( $this->rowConsistency === null ) {\n $this->rowConsistency = $current;\n }\n\n if ( $current !== $this->rowConsistency ) {\n throw new StrictViolationException();\n }\n\n $this->rowConsistency = $current;\n }", "public function updateRow($table, $col, $colVal, $data) {\n \t\t$this->db->where($col,$colVal);\n\t\t$this->db->update($table,$data);\n\t\treturn true;\n \t}", "public function updateRow($table, $data, $a_where)\n {\n // $this->db->where($col,$colVal);\n $this->db->update($table, $data, $a_where);\n\n if ($this->db->affected_rows() > 0) {\n return true;\n } else {\n return false;\n }\n\n }", "public function updateRow($table_id, $data, $rowId) {\n\t\t$sql = $this->sqlUpdate($table_id, $data, $rowId);\n//\t\tdie($sql);\n\t\t$response = $this->_query($sql);\n\t\tif ($response) {\n\t\t\treturn strtolower(trim($response->get_csv())) == 'ok';\n\t\t}else{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function isValid() {\n\n foreach ($this->entity as $nameColumn => $column) {\n\n $validate = null;\n // Se for chave primaria e tiver valor, valida inteiro somente sem nenhuma outra validacao.\n if ($column['contraint'] == 'pk' && $column['value']) {\n $validate = new Zend_Validate_Digits();\n } else {\n\n//______________________________________________________________________________ VALIDANDO POR TIPO DA COLUNA NO BANCO\n // Se tiver valor comeca validacoes de acordo com o tipo.\n // Se nao pergunta se é obrigatorio, se for obrigatorio valida.\n if ($column['value']) {\n // Se for inteiro\n if ($column['type'] == 'integer' || $column['type'] == 'smallint') {\n $validate = new Zend_Validate_Digits();\n // Se for data\n } else if ($column['type'] == 'numeric') {\n $column['value'] = str_replace('.', '', $column['value']);\n $column['value'] = (float) str_replace(',', '.', $column['value']);\n $validate = new Zend_Validate_Float();\n } else if ($column['type'] == 'date') {\n\n\t\t\t\t\t\t$posBarra = strpos($column['value'], '/');\n\t\t\t\t\t\t$pos = strpos($column['value'], '-');\n\t\t\t\t\t\tif ($posBarra !== false) {\n\t\t\t\t\t\t\t$date = explode('/', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[0], $date[2])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\t$date = explode('-', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[2], $date[0])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n // Se for texto\n } else if ($column['type'] == 'character' || $column['type'] == 'character varying') {\n\n // Se for Bollean\n } else if ($column['type'] == 'boolean') {\n\n // Se for texto\n } else if ($column['type'] == 'text') {\n \n } else if ($column['type'] == 'timestamp without time zone') {\n if (strpos($column['value'], '/')) {\n\n if (strpos($column['value'], ' ')) {\n $arrDate = explode(' ', $column['value']);\n\n // Validando a data\n $date = explode('/', $arrDate[0]);\n if (!checkdate($date[1], $arrDate[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[0] . self::MSG_DATA_INVALIDA));\n }\n\n // Validando a hora\n $validateTime = new Zend_Validate_Date('hh:mm');\n $validateTime->isValid($arrDate[1]);\n if ($validateTime->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[1] . self::MSG_DATA_HORA_INVALIDA));\n }\n } else {\n // Validando a data\n $date = explode('/', trim($column['value']));\n if (!checkdate($date[1], $date[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n }\n }\n }\n }\n\n//______________________________________________________________________________ VALIDANDO POR LIMITE DA COLUNA NO BANCO\n // Validando quantidade de caracteres.\n if ($column['maximum']) {\n $validateMax = new Zend_Validate_StringLength(array('max' => $column['maximum']));\n $validateMax->isValid($column['value']);\n if ($validateMax->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => (reset($validateMax->getMessages())));\n }\n $validateMax = null;\n }\n } else {\n//______________________________________________________________________________ VALIDANDO POR NAO VAZIO DA COLUNA NO BANCO\n // Validando se nao tiver valor e ele for obrigatorio.\n if ($column['is_null'] == 'NO' && $column['contraint'] != 'pk') {\n $validate = new Zend_Validate_NotEmpty();\n }\n }\n\n//______________________________________________________________________________ VALIDANDO A CLOUNA E COLOCANDO A MENSAGEM\n if ($validate) {\n $validate->isValid($column['value']);\n if ($validate->getErrors()) {\n\t\t\t\t\t\t$msg = $validate->getMessages();\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ( reset($msg) ));\n }\n\n $validate = null;\n }\n }\n }\n\t\t\n if ($this->error)\n return false;\n else\n return true;\n }", "private function validRow($arrayToCheck) {\n if (isset($arrayToCheck) && !empty($arrayToCheck)) {\n //check number values\n if (count($arrayToCheck) == COUNT_VALUES) {\n //check values needed to put in database\n \n //Check subscriber\n if (!intval($arrayToCheck[2])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Subscriber is not an integer'\n );\n return false;\n }\n\n //Check date\n list($day, $month, $year) = explode('/', $arrayToCheck[3]);\n if(!checkdate($month,$day,$year)) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Date is wrong'\n );\n return false;\n }\n\n //Check hour\n if (!preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[4])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Time is wrong'\n );\n return false;\n }\n\n //Check Consumption\n if (preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[5])) {\n $type = 'call';\n $parsed = date_parse($arrayToCheck[5]);\n $consumption = $parsed['hour'] * 3600 + $parsed['minute'] * 60 + $parsed['second'];\n }\n elseif ($arrayToCheck[6] == '0.0' || intval($arrayToCheck[6])) {\n $type = 'data';\n $consumption = intval($arrayToCheck[6]);\n }\n elseif ($arrayToCheck[5]=='' || $arrayToCheck[6]=='') {\n $type = 'sms';\n $consumption = '';\n }\n else {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Consumption values are not good'\n );\n return false;\n }\n\n //return array to insert in database \n //array(subscriber, datetime, consumption, $type)\n $date = date(\"Y-m-d H:i:s\", strtotime(str_replace('/', '-', $arrayToCheck[3]).' '.$arrayToCheck[4]));\n return array(\n 'subscriber' => $arrayToCheck[2],\n 'date' => $date,\n 'consumption' => $consumption,\n 'type' => $type);\n } \n else\n return false;\n }\n else {\n return false;\n }\n }", "public function checkData()\n\t{\n\t\t$result = parent::checkData();\n\t\t$query = (new \\App\\Db\\Query())->from($this->baseTable)->where(['server_id' => $this->get('server_id'), 'user_name' => $this->get('user_name')]);\n\t\tif ($this->getId()) {\n\t\t\t$query->andWhere(['<>', 'id', $this->getId()]);\n\t\t}\n\t\treturn !$result && $query->exists() ? 'LBL_DUPLICATE_LOGIN' : $result;\n\t}", "function update_data($update_data,$where_arr,$tbl_name)\n\t{\n\t\tif(!empty($update_data))\n\t\t{\n\t\t\t$this->db->where($where_arr);\n\t\t\t$this->db->update($tbl_name,$update_data);\n\t\t\t\n\t\t\tif($this->db->affected_rows()>0)\n\t\t\t{\n\t\t\t\treturn TRUE;\t\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "function edit_verify($data=array())\n {\n if ($data)\n {\n $sql = \"\n UPDATE {$this->_db}\n SET\n username = \" . $this->db->escape($data['username']) . \",\n \";\n\n $sql .= \"\n company = \" . $this->db->escape($data['company']) . \",\n country = \" . $this->db->escape($data['country']) . \",\n zip = \" . $this->db->escape($data['zip']) . \",\n city = \" . $this->db->escape($data['city']) . \",\n address_1 = \" . $this->db->escape($data['address_1']) . \",\n address_2 = \" . $this->db->escape($data['address_2']) . \"\n WHERE id = \" . $this->db->escape($data['id']) . \"\n \";\n\n $this->db->query($sql);\n\n if ($this->db->affected_rows())\n {\n return TRUE;\n }\n }\n\n return FALSE;\n }", "public function validate_update(): array{\n $errors = [];\n if (!Validation::str_longer_than($this->get_title(), 2)) {\n $errors[] = \"Title must be at least 3 characters long\";\n }\n if(!$this->title_is_unique_update()){\n $errors[] = \"Title already exists in this board\";\n }\n return $errors;\n }", "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "public function updateRow(Request $request)\n {\n $result=MyRow::where('id',$request->id)->update([$request->column_name=>$request->value]);\n if ($result) echo 'Data Updated';\n }", "public function applySchemaToData(array $row): array\n {\n // Iterating over each field of the row and checking in configuration metadata what are the rules\n foreach ($row as $fieldName => &$value) {\n // If no requirement was given for this field, we go next\n if (empty($this->configuration[$fieldName])) {\n continue;\n }\n\n // Retrieving requirements for this fieldName\n $requirements = $this->configuration[$fieldName];\n\n // If value is empty and it is NOT allowed by metadata\n if ($value === '' && empty($requirements['optional'])) {\n throw new ValidationException(sprintf(\n \"The field '%s' can not be empty ! Consider fixing your data or fixing schema with : '%s=?%s'\",\n $fieldName,\n $fieldName,\n $requirements['type']\n ));\n }\n\n // If value is empty but it is allowed by metadata\n if ($value === '' && $requirements['optional'] === true) {\n // Replacing the value by NULL and go next\n $value = null;\n continue;\n }\n\n // We don't know what validator should take responsibility for the $value\n $typeValidator = null;\n\n // Let's find out !\n foreach ($this->validators as $validator) {\n if ($validator->supports($requirements['type'])) {\n $typeValidator = $validator;\n break;\n }\n }\n\n // If we did not found any validator for the $value\n if (!$typeValidator) {\n throw new ValidationException(sprintf(\n \"No validator class was found for type '%s' ! You should create a '%s' class to support it or maybe it already exists but was not added to Validators ! 👍\",\n $requirements['type'],\n 'App\\\\Validation\\\\Validator\\\\' . ucfirst($requirements['type']) . 'Validator'\n ));\n }\n\n // We validate the value and if it does not match with rules .. 💣\n if (!$typeValidator->validate($value)) {\n throw new ValidationException(sprintf(\n \"The field '%s' with value '%s' does not match requirements type '%s' !\",\n $fieldName,\n $value,\n $requirements['type']\n ));\n }\n }\n\n // We return the row because after validation of its values, some of them could have change !\n return $row;\n }", "function validate() {\n\t\t// execute the column validation \n\t\tparent::validate();\n\t\t\n\t\t// connection\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM company WHERE name = '\".$this->getName().\"' AND id <> '\".$this->getID().\"'\";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage(\"result is \".$result);\n\t\tif(!isEmptyString($result)){ \n\t\t\t$this->getErrorStack()->add(\"unique.name\", \"The name \".$this->getName().\" already exists. Please specify another.\");\n\t\t}\n\t}", "private function Update()\n {\n $return = false;\n $action = $this->Action();\n $values = $this->Values();\n $table = $this->Table();\n $where = $this->Where();\n $errorInfo = $this->ERROR_INFO(__FUNCTION__);\n if(MySQLChecker::isAction($action, $errorInfo) && MySQLChecker::isTable($table, $errorInfo) &&\n Checker::isArray($values, false, $errorInfo) && Checker::isArray($where, false, $errorInfo) ) {\n if (isset($values[Where::VALUES]) && isset($values[self::COLUMNS]) && isset($where[Where::VALUES])) {\n $columns = $values[self::COLUMNS];\n $values = $values[Where::VALUES] + $where[Where::VALUES];\n if (Checker::isArray($columns, false, $errorInfo) && Checker::isArray($values, false, $errorInfo)) {\n $return[Where::QUERY] = \"$action $table SET \";\n foreach($columns as $column => $key)\n {\n $return[Where::QUERY] .= \"$column=$key, \";\n }\n $return[Where::QUERY] = trim($return[Where::QUERY],\", \");\n $return[Where::QUERY] .= $where[Where::QUERY];\n $return[Where::VALUES] = $values;\n }\n } else $this->addError(__FUNCTION__, \"Values and Query are not set!\", $values);\n }\n return $return;\n }", "function updateField($inserttable, $name, $optional, $type, $tablename, $minimum, $maximum, $dataID){\r\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n try{\r\n $sql = $this->db->prepare(\"UPDATE $inserttable SET displayname = :name, mandatory = :optional, inputtype=:type,\r\n tablename=:tablename, minimum = :minimum, maximum=:maximum WHERE DataID = :dataID\");\r\n\r\n $sql->bindParam(':name', $name, PDO::PARAM_STR);\r\n $sql->bindParam(':optional', $optional, PDO::PARAM_INT);\r\n $sql->bindParam(':type', $type, PDO::PARAM_STR);\r\n $sql->bindParam(':tablename', $tablename, PDO::PARAM_STR);\r\n $sql->bindParam(':minimum', $minimum, PDO::PARAM_INT);\r\n $sql->bindParam(':maximum', $maximum, PDO::PARAM_INT);\r\n $sql->bindParam(':dataID', $dataID, PDO::PARAM_INT);\r\n if($sql->execute())\r\n return true;\r\n else\r\n return false;\r\n\r\n\r\n } catch(PDOExecption $e) {\r\n echo $e->getMessage();\r\n }\r\n\r\n }", "function editRow($tabName, $id, $tabData) {\n\tglobal $mysqli;\n\t\n\t$update='';\n\tforeach ($tabData as $key => $value) {\n\t\t$update.= $key.\"='\".$value.\"', \";\n\t}\n\t$num=2;\n\t$update = substr($update, 0, -$num);\t\n\t$sql = \"UPDATE $tabName SET $update WHERE id='$id'\";\n\n\tif (!$mysqli->query($sql)) {\n\t\tshowErrors();\n\t}\n return true;\n}", "function dbRowUpdate($table_name, $form_data, $where_clause='')\n{\n // check for optional where clause\n $whereSQL = '';\n if(!empty($where_clause))\n {\n // check to see if the 'where' keyword exists\n if(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n {\n // not found, add key word\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // start the actual SQL statement\n $sql = \"UPDATE \".$table_name.\" SET \";\n\n // loop and build the column /\n $sets = array();\n foreach($form_data as $column => $value)\n {\n $sets[] = \"`\".$column.\"` = '\".$value.\"'\";\n }\n $sql .= implode(', ', $sets);\n\n // append the where statement\n $sql .= $whereSQL;\n\n // run and return the query result\n $q = $this->conn->prepare($sql);\n \n return $q->execute() or die(print_r($q->errorInfo()));\n}", "function updaterec($adata)\n\t{\n\t\t$this->db->where(\"noteman\", $adata[\"noteman\"]);\n\t\t$this->db->update(\"tblteman\", $adata);\n\n\t\treturn (($this->db->affected_rows() > 0)?TRUE:FALSE);\n\t}", "public function validate()\n\t{\n\t\t// Only validate changed data if it's an update\n\t\tif ($this->_loaded)\n\t\t{\n\t\t\t$data = $this->_changed;\n\t\t}\n\t\t// Validate all data on insert\n\t\telse\n\t\t{\n\t\t\t$data = $this->_changed + $this->_original;\n\t\t}\n\t\t\n\t\tif (empty($data))\n\t\t{\n\t\t\treturn $this;\n\t\t}\n\t\t\n\t\t// Create the validation object\n\t\t$data = Validate::factory($data);\n\t\t\n\t\t// Loop through all columns, adding rules where data exists\n\t\tforeach ($this->meta()->fields as $column => $field)\n\t\t{\n\t\t\t// Do not add any rules for this field\n\t\t\tif (!$data->offsetExists($column))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$data->label($column, $field->label);\n\n\t\t\tif ($field->filters)\n\t\t\t{\n\t\t\t\t$data->filters($column, $field->filters);\n\t\t\t}\n\n\t\t\tif ($field->rules)\n\t\t\t{\n\t\t\t\t$data->rules($column, $field->rules);\n\t\t\t}\n\n\t\t\tif ($field->callbacks)\n\t\t\t{\n\t\t\t\t$data->callbacks($column, $field->callbacks);\n\t\t\t}\t\t\t\n\t\t}\n\n\t\tif ($data->check())\n\t\t{\n\t\t\t// Insert filtered data back into the model\n\t\t\t$this->set($data->as_array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Validate_Exception($data);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "protected function performPreUpdateCallback()\n {\n // echo 'updating a record ...';\n $this->validate();\n \n return true;\n }", "public function fill_fields() {\n if (!parent::fill_fields()) {\n return false;\n }\n $stmt = $this->pdo->prepare('select valid from user where id = :id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n if (count($res) != 1) {\n return false;\n }\n $this->valid = $res[0][0];\n return true;\n }", "public function isValidInsert($data) {\n\t\t$options = array('presence' => 'required','missingMessage' => \"Please fill the required field '%field%'\");\n\t\treturn $this -> validate($data,$options);\n\t}" ]
[ "0.680777", "0.6710388", "0.6656974", "0.6619826", "0.65885067", "0.6550907", "0.65424544", "0.64885575", "0.6457344", "0.640763", "0.6295728", "0.6286032", "0.62814933", "0.62572455", "0.625689", "0.6240432", "0.62380177", "0.6216153", "0.62104696", "0.620893", "0.61786956", "0.6168255", "0.61545414", "0.6142602", "0.61345387", "0.6128989", "0.61275476", "0.61139864", "0.61136216", "0.60977244", "0.6078131", "0.6053417", "0.60412633", "0.60390604", "0.60344154", "0.60158896", "0.6015122", "0.6014949", "0.5993279", "0.5985293", "0.5972779", "0.59603643", "0.595373", "0.59407705", "0.59332293", "0.5927614", "0.5906168", "0.590478", "0.59014887", "0.5897977", "0.5896591", "0.5894345", "0.5893842", "0.5886885", "0.5885101", "0.58723307", "0.58652776", "0.5840947", "0.5840143", "0.5838716", "0.5837804", "0.5828377", "0.58166486", "0.58027947", "0.5796342", "0.57962865", "0.5794847", "0.5791256", "0.57860756", "0.5766636", "0.5765188", "0.57535475", "0.5748151", "0.5748151", "0.57456446", "0.57397234", "0.57396924", "0.5733072", "0.5722971", "0.5719666", "0.57174945", "0.57161427", "0.5712141", "0.571141", "0.57096714", "0.56973463", "0.5689928", "0.5683535", "0.567746", "0.56736463", "0.56726736", "0.5670118", "0.56696707", "0.5662583", "0.5661109", "0.56600565", "0.56527317", "0.56488895", "0.5645489", "0.56366765" ]
0.64663124
8
Prepare conditions attribute value
protected function prepareAttributeValue($conditions) { $condition = $this->conditionFactory->create($conditions['type']); $attributes = $condition->loadAttributeOptions()->getAttributeOption(); if (isset($attributes[$conditions['attribute']])) { $condition->setAttribute($conditions['attribute']); if (in_array($condition->getInputType(), ['select', 'multiselect'])) { // reload options flag $condition->unsetData('value_select_options'); $condition->unsetData('value_option'); $options = $condition->getValueOption(); if (is_array($conditions['value'])) { foreach ($conditions['value'] as $key => $value) { $optionId = array_search($value, $options); $conditions['value'][$key] = $optionId; } } else { $optionId = array_search($conditions['value'], $options); $conditions['value'] = $optionId; } } } return $conditions['value']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function prepareAttributeValue($conditions)\n {\n $condition = $this->conditionFactory->create($conditions['type']);\n $attributes = $condition->loadAttributeOptions()->getAttributeOption();\n\n if (isset($attributes[$conditions['attribute']])) {\n $condition->setAttribute($conditions['attribute']);\n if (in_array($condition->getInputType(), ['select', 'multiselect'])) {\n // reload options flag\n $condition->unsetData('value_select_options');\n $condition->unsetData('value_option');\n\n $options = $condition->getValueOption();\n if (is_array($conditions['value'])) {\n foreach ($conditions['value'] as $key => $value) {\n $conditions['value'][$key] = $options[$value];\n }\n } else {\n $conditions['value'] = $options[$conditions['value']];\n }\n }\n }\n return $conditions['value'];\n }", "protected function prepareAttributeValue($conditions)\n {\n $condition = $this->conditionFactory->create($conditions['type']);\n $attributes = $condition->loadAttributeOptions()->getAttributeOption();\n\n if (isset($attributes[$conditions['attribute']])) {\n $condition->setAttribute($conditions['attribute']);\n if (in_array($condition->getInputType(), ['select', 'multiselect'])) {\n // reload options flag\n $condition->unsetData('value_select_options');\n $condition->unsetData('value_option');\n\n $options = $condition->getValueOption();\n if (is_array($conditions['value'])) {\n foreach ($conditions['value'] as $key => $value) {\n $conditions['value'][$key] = $options[$value];\n }\n } else {\n $conditions['value'] = $options[$conditions['value']];\n }\n }\n }\n return $conditions['value'];\n }", "public function setConditionsAttribute($value)\n {\n $this->attributes['conditions'] = json_encode($value, JSON_UNESCAPED_UNICODE);\n }", "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "protected function _prepareCondition($attribute, $value)\n {\n return $this->_getResource()->prepareCondition($attribute, $value, $this->getProductCollection());\n }", "public function buildConditionQuery()\n\t\t\t{\n\t\t\t\t$this->sql_condition = ' user_id='.$this->CFG['user']['user_id'];\n\t\t\t}", "public function flexformConditionStringDataProvider() {}", "public function makeConditions($attributes, $values)\n {\n if (!$attributes) return '';\n $parts = preg_split('/(And|Or)/i', $attributes, NULL, PREG_SPLIT_DELIM_CAPTURE);\n $condition = '';\n\n $j = 0;\n foreach($parts as $part) {\n if ($part == 'And') {\n $condition .= ' AND ';\n } elseif ($part == 'Or') {\n $condition .= ' OR ';\n } else {\n $part = strtolower($part);\n if (($j < count($values)) && (!is_null($values[$j]))) {\n $bind = is_array($values[$j]) ? ' IN(?)' : '=?';\n } else {\n $bind = ' IS NULL';\n }\n $condition .= self::quote($part) . $bind;\n $j++;\n }\n }\n return $condition;\n }", "public function addFilters($values)\n {\n $attributes = $this->getAttributes();\n $allConditions = [];\n\n foreach ($attributes as $attribute) {\n /* @var $attribute Attribute */\n if (!isset($values[$attribute->getAttributeCode()])) {\n continue;\n }\n $value = $values[$attribute->getAttributeCode()];\n $preparedSearchValue = $this->getPreparedSearchCriteria($attribute, $value);\n if (false === $preparedSearchValue) {\n continue;\n }\n $this->addSearchCriteria($attribute, $preparedSearchValue);\n\n if ($attribute->getAttributeCode() == 'price') {\n $rate = 1;\n $store = $this->_storeManager->getStore();\n $currency = $store->getCurrentCurrencyCode();\n if ($currency != $store->getBaseCurrencyCode()) {\n $rate = $store->getBaseCurrency()->getRate($currency);\n }\n\n $value['from'] = (isset($value['from']) && is_numeric($value['from']))\n ? (float)$value['from'] / $rate\n : '';\n $value['to'] = (isset($value['to']) && is_numeric($value['to']))\n ? (float)$value['to'] / $rate\n : '';\n }\n\n if ($attribute->getBackendType() == 'datetime') {\n $value['from'] = (isset($value['from']) && !empty($value['from']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['from']))\n : '';\n $value['to'] = (isset($value['to']) && !empty($value['to']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['to']))\n : '';\n }\n $condition = $this->_getResource()->prepareCondition(\n $attribute,\n $value,\n $this->getProductCollection()\n );\n if ($condition === false) {\n continue;\n }\n\n $table = $attribute->getBackend()->getTable();\n if ($attribute->getBackendType() == 'static') {\n $attributeId = $attribute->getAttributeCode();\n } else {\n $attributeId = $attribute->getId();\n }\n $allConditions[$table][$attributeId] = $condition;\n }\n //if ($allConditions)\n if ($allConditions || (isset($values['cat']) && is_numeric($values['cat'])) ) {\n $this->_registry->register('advanced_search_conditions', $allConditions);\n $this->getProductCollection()->addFieldsToFilter($allConditions);\n } else {\n throw new LocalizedException(__('Please specify at least one search term.'));\n }\n\n return $this;\n }", "private function processConditions($conditions)\n\t{\n\t\tif (!is_array($conditions))\n\t\t\treturn $conditions;\n\t\telse\n\t\t throw new \\GO\\Base\\Exception\\Database('condition should be a string');\n\t}", "protected function _buildCondition(){\n \t$aryCondition = array();\n \t\n \tif(!empty($this->postData)){\n \t\t //search\n\t\t\t \t\t\t\n\t\t\tif($this->postData['title']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.title\"=>$this->postData['title']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['page']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.page\"=>$this->postData['page']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['code']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.code\"=>$this->postData['code']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['status']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.status\"=>$this->postData['status']);\n \t\t }\t\t\t\n\n \t}\n \treturn $aryCondition;\n }", "function get_filter_condition($conditional_symbol) {\n //explicitly prevent filters from beign automatically applied to the report query\n return '';\n }", "public function conditionStringDataProvider() {}", "public function conditionsProvider()\n {\n return [[[new \\Urbania\\AppleNews\\Format\\Condition()]]];\n }", "public function conditionsProvider()\n {\n return [[[new \\Urbania\\AppleNews\\Format\\Condition()]]];\n }", "protected function createCondition($values) {\n $definition = $this->typedDataManager->createDataDefinition('condition');\n $values = $values + ['operator' => '='];\n return $this->typedDataManager->create($definition, $values);\n }", "static function prepare_attr_value ($text) {\n\t\tif (is_array($text)) {\n\t\t\tforeach ($text as &$t) {\n\t\t\t\t$t = static::prepare_attr_value($t);\n\t\t\t}\n\t\t\treturn $text;\n\t\t}\n\t\treturn strtr(\n\t\t\t$text,\n\t\t\t[\n\t\t\t\t'&' => '&amp;',\n\t\t\t\t'\"' => '&quot;',\n\t\t\t\t'\\'' => '&apos;',\n\t\t\t\t'<' => '&lt;',\n\t\t\t\t'>' => '&gt;'\n\t\t\t]\n\t\t);\n\t}", "public function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\t\t\n\t\t$conditions['select'] = '`bid` AS id, `cid`, `type`, `name`, `alias`, `imptotal`, `impmade`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`clicks`, `imageurl`, `clickurl`, `date`, `showBanner` AS state, `checked_out`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`checked_out_time`, `editor`, `custombannercode`, `catid`, `description`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`sticky`, `ordering`, `publish_up`, `publish_down`, `tags`, `params`'\t;\n\t\t\n\t\t$conditions['where'] = array();\n\t\t\n\t\treturn $conditions;\n\t}", "function condition_values() {\n return array();\n }", "public function getCondition() {\n\n \t$condition = array();\n \t$this->getQueryString(\"keyword\", $condition);\n \t$this->getQueryString(\"activityId\", $condition);\n \t$this->getQueryString(\"activityIds\", $condition);\n \t$this->getQueryString(\"activityType\", $condition);\n $this->getQueryString(\"state\", $condition);\n $this->getQueryString(\"orderDateStart\", $condition);\n $this->getQueryString(\"orderDateEnd\", $condition);\n $this->getQueryString(\"deliveryDateStart\", $condition);\n $this->getQueryString(\"deliveryDateEnd\", $condition);\n $this->getQueryString(\"serial\", $condition);\n $this->getQueryString(\"consumerId\", $condition);\n $this->getQueryString(\"payDateTimeStart\", $condition);\n $this->getQueryString(\"payDateTimeEnd\", $condition);\n $this->getQueryString(\"productId\", $condition);\n $this->getQueryString(\"deliveryId\", $condition);\n $this->getQueryString(\"productArray\", $condition);\n \n \treturn $condition;\n }", "protected function getAttributeSetConditions($conditions) \n\t{\n\t\t$categories = explode(\",\",$conditions);\n\t\t$attributeSetConds = array();\n\t\t$i=1;\n\t\tforeach($categories as $category):\n\t\t\t$attributeSetId = $this->_getAttributeSetId(trim($category));//Get Attribute Set Id\n\t\t\t$attributeSetConds[\"1--1--\".$i] = array(\n\t\t\t\t\t\"type\" => \"Magento\\SalesRule\\Model\\Rule\\Condition\\Product\",\n\t\t\t\t\t\"attribute\" => \"attribute_set_id\",\n\t\t\t\t\t\"operator\" => \"==\",\n\t\t\t\t\t\"value\" => $attributeSetId\n\t\t\t\t);\n\t\t\t$i++;\n\t\tendforeach;\n\t\treturn $attributeSetConds;\n\t}", "private function _parseBFilterParam()\n\t{\n $map = array('a' => 'attribute', 'm' => 'manufacturer', 's' => 'stock_status', 'f' => 'filter', 'o' => 'option', 'r' => 'rating', 'c' => 'category');\n \n if (!isset($this->request->get['bfilter'])) {\n \n return;\n }\n\t\t$bfilter = $this->request->get['bfilter'];\n\n\t\t$params = explode(';', $bfilter);\n \n\t\tforeach ($params as $param) \n {\n if (!empty($param)) \n {\n $p = explode(':', $param);\n $pName = $p[0];\n $pValue = $p[1];\n if ($pName === 'price') \n {\n $p = explode('-', $pValue);\n if ((int)$p[0] > 0 || (int)$p[1] > 0) {\n $this->conditions->price = new stdClass();\n $this->conditions->price->min = null;\n $this->conditions->price->max = null;\n $this->conditions->price->inputMin = null;\n $this->conditions->price->inputMax = null;\n }\n if ((int)$p[0] > 0) {\n $this->conditions->price->min = $this->currency->convert($p[0], $this->currency->getCode(), $this->config->get('config_currency'));\n $this->conditions->price->inputMin = $p[0];\n }\n if ((int)$p[1] > 0) {\n $this->conditions->price->max = $this->currency->convert($p[1], $this->currency->getCode(), $this->config->get('config_currency'));\n $this->conditions->price->inputMax = $p[1];\n }\n } \n elseif ($pName === 'rating') \n {\n $this->conditions->rating = explode(',', $pValue);\n } \n elseif ($pName === 'search')\n {\n $this->conditions->search = $pValue;\n $this->searchNameString = $pValue;\n $this->searchTagString = $pValue;\n $this->searchDescriptionString = $pValue;\n }\n else \n {\n $type = $map[substr($pName, 0, 1)];\n $groupId = (int)substr($pName, 1);\n if ($type) {\n if (strpos($pValue, '-') !== false) {\n $p = explode('-', $pValue);\n if (isset($p[0]) && isset($p[1])) {\n $this->conditions->{$type}[$groupId] = array('min' => $p[0], 'max' => $p[1]);\n }\n } else {\n $this->conditions->{$type}[$groupId] = explode(',', $pValue);\n }\n\n if ($type !== 'rating') {\n $type = strtoupper($type);\n if (!isset($this->aggregate[$type])) {\n $this->aggregate[$type] = array();\n }\n if (strpos($pValue, '-') !== false) {\n $p = explode('-', $pValue);\n $range = $this->_getSliderIntermediateValues($type, $groupId, $p[0], $p[1]);\n if (!empty($range)) {\n $this->aggregate[$type][$groupId] = $range;\n }\n } else {\n $this->aggregate[$type][$groupId] = explode(',', $pValue);\n }\n }\n }\n }\n }\n\t\t}\n\t}", "function add_condition($item) {\n\t\treturn $this->conditions[$this->prefix.$item['id']] = $item['condition'];\n\t}", "protected function get_conditions( ) {\n// to decode all conditions. To learn more about weather condition codes, visit section\n// 12.6.8 - Present Weather Group of the Federal Meteorological Handbook No. 1 at\n// www.nws.noaa.gov/oso/oso1/oso12/fmh1/fmh1ch12.htm\n if (preg_match('#^(-|\\+|VC)?(NSW|TS|SH|FZ|BL|DR|MI|BC|PR|RA|DZ|SN|SG|GR|GS|PE|IC|UP|BR|FG|FU|VA|DU|SA|HZ|PY|PO|SQ|FC|SS|DS|WS//)+$#',$this->current_group_text,$pieces)) {\n $this->varConcatenate($this->wxInfo['ITEMS'][$this->tend],'CODE_CONDITIONS', $this->current_group_text);\n if (!isset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'])) {\n//$this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = '';\n $join = '';\n }\n else {\n $join = ', ';\n }\n if (substr($this->current_group_text,0,1) == '-') {\n $prefix = $this->get_i18nCondition('-');\n $this->current_group_text = substr($this->current_group_text,1);\n }\n elseif (substr($this->current_group_text,0,1) == '+') {\n $prefix = $this->get_i18nCondition('+');\n $this->current_group_text = substr($this->current_group_text,1);\n }\n else $prefix = ''; // moderate conditions have no descriptor\n while ($code = substr($this->current_group_text,0,2)) {\n if (!isset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'])) {\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = '';\n }\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] .= $join . $this->get_i18nCondition($code) . ' ';\n $this->current_group_text = substr($this->current_group_text,2);\n }\n if (strlen($prefix)>0) {\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] .= $prefix ;\n }\n $this->current_ptr++;\n }\n else {\n if (isset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'])) {\n//$this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = '';\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = trim($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS']);\n if ($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS']=='') unset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS']);\n }\n $this->current_group++;\n }\n }", "private function formatCondition(array $cond)\n {\n if (empty($cond)) {\n return false;\n }\n $ret = $this->formatWhere($cond);\n if ($ret === false) {\n return false;\n }\n $str_sql = isset($ret['bind_where_sql'][self::AND_OP]) ? implode(' ' . self::AND_OP . ' ', $ret['bind_where_sql'][self::AND_OP]) : '';\n if (isset($ret['bind_where_sql'][self::OR_OP])) {\n $or_sql = implode(\" \" . self::OR_OP . \" \", $ret['bind_where_sql'][self::OR_OP]);\n $str_sql .= $str_sql ? \" \" . self::AND_OP . \" ({$or_sql})\" : $or_sql;\n }\n return [\n 'where_sql' => $str_sql,\n 'where_values' => $ret['bind_where_values']\n ];\n }", "protected function getAttributeSetActions($conditions) \n\t{\n\t\t$categories = explode(\",\",$conditions);\n\t\t$attributeSetConds = array();\n\t\t$i=1;//increase this value if condition is getting replaced\n\t\tforeach($categories as $category):\n\t\t\t$attributeSetId = $this->_getAttributeSetId(trim($category));\n\t\t\t$attributeSetConds[\"1--1--\".$i] = array(\n\t\t\t\t\t\"type\" => \"Magento\\SalesRule\\Model\\Rule\\Condition\\Product\",\n\t\t\t\t\t\"attribute\" => \"attribute_set_id\",\n\t\t\t\t\t\"operator\" => \"==\",\n\t\t\t\t\t\"value\" => $attributeSetId\n\t\t\t\t);\n\t\t\t$i++;\n\t\tendforeach;\n\t\treturn $attributeSetConds;\n\t}", "public function addCondition($attribute, $values, $operator = ComparisonOperator::EQ);", "public function setConditions($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->conditions = $arr;\n\n return $this;\n }", "public function condition()\n {\n if (!$this->condition) {\n $this->condition = array();\n foreach (monsterToCondition::select('ctype', 'condition')->where('mid', '=', $this->id)->get() as $r) {\n $this->condition[] = $r->condition;\n };\n }\n return $this->condition;\n }", "public function buildConditionAction()\n {\n /** @var Form $form */\n $form = $this->formRepository->findByIdentifier($this->powermailArguments['mail']['form']);\n $this->setTextFields($form);\n\n /** @var ConditionContainer $conditionContainer */\n $conditionContainer = $this->containerRepository->findOneByForm($form);\n if ($conditionContainer !== null) {\n $arguments = $conditionContainer->applyConditions($form, $this->powermailArguments);\n SessionUtility::setSession($arguments);\n ArrayUtility::unsetByKeys($arguments, ['backup', 'field']);\n return json_encode($arguments);\n }\n return null;\n }", "public function getCondition() { \n \t\treturn $this->condition . tx_newspaper::enableFields(tx_newspaper::getTable($this)); \n \t}", "public function getConditionDataProvider()\n {\n return [\n [\n [\n 'type' => 'type',\n 'attribute' => 'attribute',\n 'operator' => 'operator',\n 'value' => 'value',\n 'value_type' => 'value_type',\n 'aggregator' => 'aggregator',\n 'conditions' => [\n [\n 'type' => 'child_type',\n 'attribute' => 'child_attribute',\n 'operator' => 'child_operator',\n 'value' => 'child_value',\n 'value_type' => null,\n 'aggregator' => 'aggregator'\n ]\n ]\n ]\n ]\n ];\n }", "public function conditions ($r)\r\n\t{\r\n\t\tif (! isset($this->_conditions[$r])) {\r\n\t\t\t$_data = $this->retrieve()\r\n\t\t\t\t->current()->{'yweather:condition'}\r\n\t\t\t\t->getDOM();\r\n\t\t\t$this->_conditions = array(\r\n\t\t\t\t'temp' => (int) $_data->getAttribute('temp') ,\r\n\t\t\t\t'description' => $_data->getAttribute('text') ,\r\n\t\t\t\t'code' => (int) $_data->getAttribute('code'));\r\n\t\t}\r\n\t\treturn $this->_conditions[$r];\r\n\t}", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "public function defineCriteriaAttributes()\n {\n return [\n 'userId' => [AttributeType::Number],\n 'chargeId' => [AttributeType::Number],\n 'membershipSubscriptionId' => [AttributeType::Number],\n 'status' => [AttributeType::String]\n ];\n }", "function build_sql_conditions( $args = array() ){\r\n\t\tglobal $wpdb;\r\n\t\t$events_table = $wpdb->prefix . EM_EVENTS_TABLE;\r\n\t\t$locations_table = $wpdb->prefix . EM_LOCATIONS_TABLE;\r\n\t\t\r\n\t\t$conditions = parent::build_sql_conditions($args);\r\n\t\t//eventful locations\r\n\t\tif( true == $args['eventful'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NOT NULL\";\r\n\t\t}elseif( true == $args['eventless'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NULL\";\r\n\t\t}\r\n\t\treturn $conditions;\r\n\t}", "protected function applyVars()\n\t{\n\t\tforeach ($this->data as $key => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t$this->parseToElement($key, $value);\n\t\t\t} else {\n\t\t\t\t$results = @$this->xpath->query(\"//*[@c.\" . $key . \"]\");\n\t\t\t\tif ($results->length > 0) {\n\t\t\t\t\t// Get HTML\n\t\t\t\t\t$node = $results->item(0);\n\t\t\t\t\tif ($node->hasAttribute('c.if')) {\n\t\t\t\t\t\t$expression = $node->getAttribute('c.if');\n\t\t\t\t\t\t$node->removeAttribute('c.if');\n\t\t\t\t\t\t$condition_control = new Condition($expression, $this->data, $value);\n\t\t\t\t\t\tif (!$condition_control->getResult()) {\n\t\t\t\t\t\t\t$node->parentNode->removeChild($node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$node->removeAttribute('c.' . $key);\n\t\t\t\t\t$this->setElementContent($node, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function __conditionsRemoveEmpty($type='post'){\r\n $strings = '';\r\n switch ($type) {\r\n case 'post':\r\n foreach($this->request->getPost() as $key => $value){\r\n $strings .= $key.' = :'.$key.': AND ';\r\n }\r\n return substr($strings,0,-4);\r\n break;\r\n \r\n case 'get':\r\n foreach($this->request->getQuery() as $key => $value){\r\n if($key !== '_url'){\r\n $strings .= $key.' = :'.$key.': AND ';\r\n }\r\n }\r\n return substr($strings,0,-4);\r\n break;\r\n }\r\n }", "private static function __typeAdjustCondition(array $typeRequest){\r\n $stringArray = '';\r\n foreach($typeRequest as $keys => $values){\r\n $stringArray .= $keys.\" = '\".$values.\"' AND \";\r\n }\r\n return substr($stringArray, 0, -4);\r\n }", "function custom_conds( $conds = array()) {\n\n\t}", "function _prepareConditions($conditions, $pExtendingModuleID = null)\n{\n $debug_prefix = debug_indent(\"Module-_prepareConditions() {$this->ModuleID}:\");\n print \"$debug_prefix\\n\";\n $parentRecordConditions = array();\n $whereConditions = array();\n $protectJoinAliases = array();\n $SQL = '';\n\n $use_parent = true;\n if(empty($parentModuleID)){\n if(empty($this->parentModuleID)){\n $use_parent = false;\n } else {\n $parentModuleID = $this->parentModuleID;\n }\n }\n\n if($use_parent){\n $parentModule =& GetModule($parentModuleID);\n $parentPK = end($parentModule->PKFields);\n }\n\n if(! empty($pExtendingModuleID )){\n print \"extending module conditions: $pExtendingModuleID, {$this->ModuleID}\\n\";\n $extendingModule = GetModule($pExtendingModuleID);\n if(!empty( $extendingModule->extendsModuleFilterField )){\n $conditions[$extendingModule->extendsModuleFilterField] = $extendingModule->extendsModuleFilterValue;\n print \"added extended condition:\\n\";\n print_r($conditions);\n }\n }\n\n if(count($conditions) > 0){\n foreach($conditions as $conditionField => $conditionValue){\n print \"$debug_prefix Condition $conditionField => $conditionValue\\n\";\n\n $conditionModuleField = $this->ModuleFields[$conditionField];\n if(empty($conditionModuleField)){\n die(\"field {$this->ModuleID}.$conditionModuleField is empty\\n\");\n }\n $qualConditionField = $conditionModuleField->getQualifiedName($this->ModuleID);\n $conditionJoins = $conditionModuleField->makeJoinDef($this->ModuleID);\n if(count($conditionJoins) > 0){\n foreach(array_keys($conditionJoins) as $conditionJoinAlias){\n $protectJoinAliases[] = $conditionJoinAlias;\n }\n }\n\n if($use_parent){\n if(preg_match('/\\[\\*([\\w]+)\\*\\]/', $conditionValue, $match[1])){\n if($match[1][1] == $parentPK){\n $whereConditions[$qualConditionField] = '/**RecordID**/';\n } else {\n print \"SM found match $match[1][0]\\n\";\n $parentRecordConditions[$qualConditionField] = $match[1][1];\n }\n } else {\n $whereConditions[$qualConditionField] = $conditionValue;\n }\n } else {\n $whereConditions[$qualConditionField] = $conditionValue;\n }\n }\n }\n\n if($use_parent){\n $needParentSubselect = false;\n if(count($parentRecordConditions) > 0){\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n if(empty($parentModuleField)){\n die(\"field {$this->parentModuleID}.$parentConditionField is empty\\n\");\n }\n if(strtolower(get_class($parentModuleField)) != 'tablefield'){\n $needParentSubselect = true;\n }\n }\n if($needParentSubselect){\n $parentJoins = array();\n $parentSelects = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n $parentSelects[] = $parentModuleField->makeSelectDef('iparent');\n $parentJoins = array_merge($parentJoins, $parentModuleField->makeJoinDef('iparent'));\n }\n\n $subSQL = 'SELECT ';\n $subSQL .= implode(\",\\n\", $parentSelects);\n $subSQL .= \"\\nFROM `{$this->parentModuleID}` AS `iparent`\\n\";\n $parentJoins = SortJoins($parentJoins);\n $subSQL .= implode(\"\\n \", $parentJoins);\n $subSQL .= \"\\nWHERE `iparent`.$parentPK = '/**RecordID**/' \\n\";\n\n $SQL = \"\\n INNER JOIN ($subSQL) AS `parent` ON (\\n\";\n $parentConditionStrings = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentConditionStrings[] = \"`parent`.$parentConditionField = $localConditionField\";\n }\n $SQL .= implode(\"\\n AND \", $parentConditionStrings);\n $SQL .= \")\\n\";\n } else {\n $SQL = \"\\n INNER JOIN `{$this->parentModuleID}` AS `parent` ON (\\n\";\n $parentConditionStrings = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n $qualParentConditionField = $parentModuleField->getQualifiedName('parent');\n $parentConditionStrings[] = \"$localConditionField = $qualParentConditionField\";;\n }\n $SQL .= implode(\"\\n AND \", $parentConditionStrings);\n $SQL .= \")\\n\";\n\n $whereConditions[\"`parent`.$parentPK\"] = '/**RecordID**/';\n }\n\n }\n }\n\n debug_unindent();\n return array(\n 'parentJoinSQL' => $SQL,\n 'whereConditions' => $whereConditions,\n 'protectJoinAliases' => $protectJoinAliases\n );\n}", "public function setCondition($args = null){\r\n $this->_conditions = $args;\r\n return $this;\r\n }", "public function setConditions($val)\n {\n $this->_propDict[\"conditions\"] = $val;\n return $this;\n }", "public function setConditions($val)\n {\n $this->_propDict[\"conditions\"] = $val;\n return $this;\n }", "public function setConditions($val)\n {\n $this->_propDict[\"conditions\"] = $val;\n return $this;\n }", "public function build()\n {\n return empty($this->conditions) ? '' : ' WHERE '.implode(' AND ', $this->conditions);\n }", "function paginationConditions() {\n // Only retrieve attributes in the current data filter scrubber\n\n $ret = array();\n\n $ret['conditions']['DataScrubberFilterAttribute.data_scrubber_filter_id'] = $this->request->params['named']['datascrubberfilter'];\n\n return $ret;\n }", "public function getConditions();", "public function getConditions();", "public function getConditions();", "protected function getCondition(array $data) : string {\n\n\t\t\treturn implode(' AND ', array_filter($this->config->castArray($data, true)));\n\t\t}", "public function\n\tTranslateRouteCondition(String $Cond):\n\tString {\n\n\t\t$Old = NULL;\n\t\t$New = NULL;\n\n\t\tforeach(Nether\\Option::Get('nether-avenue-condition-shortcuts') as $Old => $New)\n\t\t$Cond = str_replace($Old,$New,$Cond);\n\n\t\treturn $Cond;\n\t}", "public function condition_field(course_format_flexpage_model_condition_field $condition = null) {\n global $DB;\n\n // Static so we only build it once...\n static $operators = null;\n static $useroptions = null;\n\n if (is_null($condition)) {\n $field = 0;\n $operator = '';\n $value = '';\n } else {\n $field = $condition->get_field();\n $operator = $condition->get_operator();\n $value = $condition->get_value();\n }\n if (is_null($operators) || is_null($useroptions)) {\n $operators = array(\n OP_CONTAINS => get_string('contains', 'format_flexpage'),\n OP_DOES_NOT_CONTAIN => get_string('doesnotcontain', 'format_flexpage'),\n OP_IS_EQUAL_TO => get_string('isequalto', 'format_flexpage'),\n OP_STARTS_WITH => get_string('startswith', 'format_flexpage'),\n OP_ENDS_WITH => get_string('endswith', 'format_flexpage'),\n OP_IS_EMPTY => get_string('isempty', 'format_flexpage'),\n OP_IS_NOT_EMPTY => get_string('isnotempty', 'format_flexpage'),\n );\n $useroptions = array(\n 'firstname' => get_user_field_name('firstname'),\n 'lastname' => get_user_field_name('lastname'),\n 'email' => get_user_field_name('email'),\n 'city' => get_user_field_name('city'),\n 'country' => get_user_field_name('country'),\n 'url' => get_user_field_name('url'),\n 'icq' => get_user_field_name('icq'),\n 'skype' => get_user_field_name('skype'),\n 'aim' => get_user_field_name('aim'),\n 'yahoo' => get_user_field_name('yahoo'),\n 'msn' => get_user_field_name('msn'),\n 'idnumber' => get_user_field_name('idnumber'),\n 'institution' => get_user_field_name('institution'),\n 'department' => get_user_field_name('department'),\n 'phone1' => get_user_field_name('phone1'),\n 'phone2' => get_user_field_name('phone2'),\n 'address' => get_user_field_name('address')\n );\n\n // Go through the custom profile fields now\n if ($user_info_fields = $DB->get_records('user_info_field')) {\n foreach ($user_info_fields as $userfield) {\n $useroptions[$userfield->id] = format_string(\n $userfield->name, true, array('context' => $this->page->context)\n );\n }\n }\n asort($useroptions);\n $useroptions = array(0 => get_string('none', 'format_flexpage')) + $useroptions;\n }\n $fieldid = html_writer::random_id('field');\n $operatorid = html_writer::random_id('field');\n $valueid = html_writer::random_id('field');\n\n $elements = html_writer::label(get_string('userfield', 'format_flexpage'), $fieldid, false, array('class' => 'accesshide')).\n html_writer::select($useroptions, 'fields[]', $field, false, array('id' => $fieldid)).\n html_writer::label(get_string('operator', 'format_flexpage'), $operatorid, false, array('class' => 'accesshide')).\n html_writer::select($operators, 'operators[]', $operator, false, array('id' => $operatorid)).\n html_writer::label(get_string('fieldvalue', 'format_flexpage'), $valueid, false, array('class' => 'accesshide')).\n html_writer::empty_tag('input', array('type' => 'text', 'name' => 'values[]', 'value' => $value, 'id' => $valueid));\n\n return html_writer::tag('div', $elements, array('class' => 'format_flexpage_condition_field'));\n }", "public static function setCondition($args = null){\r\n return self::$PDO->setCondition($args);\r\n }", "protected function prepareActionAttributeValue($actions)\n {\n $condition = $this->actionFactory->create($actions['type']);\n $attributes = $condition->loadAttributeOptions()->getAttributeOption();\n\n if (isset($attributes[$actions['attribute']])) {\n $condition->setAttribute($actions['attribute']);\n if (in_array($condition->getInputType(), ['select', 'multiselect'])) {\n // reload options flag\n $condition->unsetData('value_select_options');\n $condition->unsetData('value_option');\n\n $options = $condition->getValueOption();\n if (is_array($actions['value'])) {\n foreach ($actions['value'] as $key => $value) {\n $optionId = array_search($value, $options);\n $actions['value'][$key] = $optionId;\n }\n } else {\n $optionId = array_search($actions['value'], $options);\n $actions['value'] = $optionId;\n }\n }\n }\n return $actions['value'];\n }", "function pnq_prepare_attrs( $attrs ) {\t\n\t$prepared_attrs = '';\n\tif( isset( $attrs ) ) {\t\t\n\t\tforeach( $attrs as $attr_name => $attr_val ) {\n\t\t\t$prepared_attrs = $prepared_attrs . $attr_name . '=\"' . esc_attr( $attr_val ) . '\"';\n\t\t}\n\t}\t\n\treturn $prepared_attrs;\n}", "public function getCondition();", "public function getCondition();", "public function getCondition();", "function fn_product_condition_get_product_data($product_id, &$field_list, $join, $auth, $lang_code, $condition) {\r\n $field_list .= 'condition';\r\n}", "private static function buildCondition($params)\n {\n if (isset($params['where'])) {\n $conditions = [];\n foreach ($params['where'] as $field => $value) {\n $conditions[] = \"{$field}='{$value}'\";\n }\n\n return ' where ' . implode(' and ', $conditions);\n }\n\n return '';\n }", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "public function constructKeyCondString()\n {\n $tablesUsedBlackHole = array();\n return $this->constructCondStringStatic($tablesUsedBlackHole, $this->constructKeyConds());\n }", "private function processAndCombinationCondition($collection, $cond, $value, $attribute)\n {\n $condition = [];\n\n if ($cond == 'null') {\n if ($value == '1') {\n $condition = ['notnull' => true];\n } elseif ($value == '0') {\n $condition = [$cond => true];\n }\n } else {\n if ($cond == 'like' || $cond == 'nlike') {\n $value = '%' . $value . '%';\n }\n //condition with null values can't be filtered using string, include to filter null values\n $conditionMap = [$this->conditionMap[$cond] => $value];\n if ($cond == 'eq' || $cond == 'neq') {\n $conditionMap[] = ['null' => true];\n }\n\n $condition = $conditionMap;\n }\n\n //filter by quote attribute\n if ($attribute == 'items_qty' && $this->ruleType == self::REVIEW) {\n $collection = $this->filterCollectionByQuoteAttribute($collection, $attribute, $condition);\n } else {\n $collection->addFieldToFilter($attribute, $condition);\n }\n\n return $collection;\n }", "protected function prepareActionAttributeValue($actions)\n {\n $condition = $this->actionFactory->create($actions['type']);\n $attributes = $condition->loadAttributeOptions()->getAttributeOption();\n\n if (isset($attributes[$actions['attribute']])) {\n $condition->setAttribute($actions['attribute']);\n if (in_array($condition->getInputType(), ['select', 'multiselect'])) {\n // reload options flag\n $condition->unsetData('value_select_options');\n $condition->unsetData('value_option');\n\n $options = $condition->getValueOption();\n if (is_array($actions['value'])) {\n foreach ($actions['value'] as $key => $value) {\n $actions['value'][$key] = $options[$value];\n }\n } else {\n $actions['value'] = $options[$actions['value']];\n }\n }\n }\n return $actions['value'];\n }", "public function __construct($conditions) {\n $this->sql = trim($this->proccessSQL($conditions));\n }", "public function processOrCombination($collection, $conditions)\n {\n $fieldsConditions = [];\n $multiFieldsConditions = [];\n foreach ($conditions as $condition) {\n $attribute = $condition['attribute'];\n $cond = $condition['conditions'];\n $value = $condition['cvalue'];\n\n //ignore condition if value is null or empty\n if ($value == '' || $value == null) {\n continue;\n }\n\n if ($this->ruleType == self::REVIEW && isset($this->attributeMapForQuote[$attribute])) {\n $attribute = $this->attributeMapForOrder[$attribute];\n } elseif ($this->ruleType == self::ABANDONED && isset($this->attributeMapForOrder[$attribute])) {\n $attribute = $this->attributeMapForQuote[$attribute];\n } else {\n $this->productAttribute[] = $condition;\n continue;\n }\n\n if ($cond == 'null') {\n if ($value == '1') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = ['notnull' => true];\n continue;\n }\n $fieldsConditions[$attribute] = ['notnull' => true];\n } elseif ($value == '0') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$cond => true];\n continue;\n }\n $fieldsConditions[$attribute] = [$cond => true];\n }\n } else {\n if ($cond == 'like' || $cond == 'nlike') {\n $value = '%' . $value . '%';\n }\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$this->conditionMap[$cond] => $value];\n continue;\n }\n $fieldsConditions[$attribute]\n = [$this->conditionMap[$cond] => $value];\n }\n }\n /**\n * All rule conditions are combined into an array to yield an OR when passed\n * to `addFieldToFilter`. The exception is any 'like' or 'nlike' conditions,\n * which must be added as separate filters in order to have the AND logic.\n */\n if (!empty($fieldsConditions)) {\n $column = $cond = [];\n foreach ($fieldsConditions as $key => $fieldsCondition) {\n $type = key($fieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $fieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $fieldsCondition;\n }\n if (!empty($multiFieldsConditions[$key])) {\n foreach ($multiFieldsConditions[$key] as $multiFieldsCondition) {\n $type = key($multiFieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $multiFieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $multiFieldsCondition;\n }\n }\n }\n }\n if (!empty($column) && !empty($cond)) {\n $collection->addFieldToFilter(\n $column,\n $cond\n );\n }\n }\n return $this->processProductAttributes($collection);\n }", "private function conditions(DBConnection $conn, Peer $peer) {\n $cond= '';\n foreach ($this->conditions as $condition) $cond.= $condition->asSql($conn, $peer).' and ';\n return substr($cond, 0, -5);\n }", "public function get_additional_conditions()\n {\n $l_type = (int) $_GET[C__GET__ID];\n\n if ($l_type > 0)\n {\n return ' AND cat_rel.isys_catg_its_type_list__isys_its_type__id = ' . $this->convert_sql_id($l_type) . ' ';\n } // if\n\n return '';\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function __toString()\n\t{\n\t\t$string = '';\n\n\t\tforeach ($this->_conditions as $i => $condition)\n\t\t{\n\t\t\tif ($i > 0) {\n\t\t\t\t$string .= ' '.$condition['g'].' ';\n\t\t\t}\n\n\t\t\tif (is_string($condition['c'])) {\n\t\t\t\t$string .= $condition['c'];\n\t\t\t}\n\t\t\telseif (is_array($condition['c'])) {\n\t\t\t\t$string .= '('.implode(' '.$condition['g'].' ', $condition['c']).')';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$string .= '('.$condition['c'].')';\n\t\t\t}\n\t\t}\n\n\t\treturn $string;\n\t}", "protected function _filters_to_conditions($request_data = null){\n \n $conditions = array();\n //user has to have an active account\n $conditions['User.active'] = 1;\n \n if(empty($request_data)){\n return $conditions;\n }\n \n if(!empty($request_data['motive_id'])){\n $conditions['Experience.motive_id'] = $request_data['motive_id'];\n }\n if(!empty($request_data['department_id'])){\n $conditions['User.department_id'] = $request_data['department_id'];\n }\n if(!empty($request_data['school_id'])){\n $conditions['User.school_id'] = $request_data['school_id'];\n }\n if(!empty($request_data['key_word'])){\n $conditions['Experience.description LIKE'] = '%'.$request_data['key_word'].'%';\n }\n //now\n if(!empty($request_data['date_min']) && !empty($request_data['date_max']) && ($request_data['date_min'] === $request_data['date_max'])){\n $conditions['AND'] = array('Experience.dateEnd >=' => $request_data['date_min'],\n 'Experience.dateStart <=' => $request_data['date_max']);\n }\n else{\n //futur\n if(!empty($request_data['date_min'])){\n $conditions['Experience.dateStart >='] = $request_data['date_min'];\n }\n //past\n if(!empty($request_data['date_max'])){\n $conditions['Experience.dateStart <='] = $request_data['date_max'];\n }\n }\n if(!empty($request_data['city_id'])){\n $conditions['Experience.city_id'] = $request_data['city_id'];\n }\n if(!empty($request_data['city_name'])){\n $conditions['City.name'] = $request_data['city_name'];\n }\n if(!empty($request_data['country_id'])){\n $conditions['City.country_id'] = $request_data['country_id'];\n }\n if(!empty($request_data['user_name'])){\n //extracts first and last names\n $names = explode(' ',$request_data['user_name']);\n if(count($names) > 1){\n $conditions['AND']['User.firstname LIKE'] = '%'.$names[0].'%';\n $conditions['AND']['User.lastname LIKE'] = '%'.$names[1].'%';\n }\n //if only last or first name was entered\n else{\n $conditions['OR'] = array('User.firstname LIKE' => '%'.$request_data['user_name'].'%',\n 'User.lastname LIKE' => '%'.$request_data['user_name'].'%');\n }\n }\n return $conditions;\n }", "public function setCondition($condition);", "function get_condition()\r\n {\r\n $owner = $this->owner;\r\n\r\n $conds = array();\r\n $parent = $this->parent;\r\n $category = $parent->get_parameter(WeblcmsManager :: PARAM_CATEGORY);\r\n $category = $category ? $category : 0;\r\n $conds[] = new EqualityCondition(ContentObjectPublication :: PROPERTY_CATEGORY_ID, $category, ContentObjectPublication :: get_table_name());\r\n\r\n $type_cond = array();\r\n $types = array(Assessment :: get_type_name(), Survey :: get_type_name(), Hotpotatoes :: get_type_name());\r\n foreach ($types as $type)\r\n {\r\n $type_cond[] = new EqualityCondition(ContentObject :: PROPERTY_TYPE, $type);\r\n }\r\n $conds[] = new OrCondition($type_cond);\r\n $c = Utilities :: query_to_condition($this->query);\r\n if (! is_null($c))\r\n {\r\n $conds[] = $c;\r\n }\r\n return new AndCondition($conds);\r\n }", "public function getCondition($conditions) {\n $where = array();\n foreach($conditions as $condition => $value) {\n if(is_numeric($condition)) {\n $where[] = $value;\n } else if(is_string($condition)) {\n $list = explode(' ', $condition);\n $field = $list[0];\n unset($list[0]);\n $operator = implode(' ',$list);\n if(empty($operator)) {\n $operator = '=';\n }\n if(is_null($value)) {\n $where[] = $field . ' ' . $operator . ' NULL';\n } else {\n if(is_numeric($value)) {\n $where[] = $field . ' ' . $operator . ' \\'' . $value . '\\'';\n } else if(is_string($value)) {\n $where[] = $field . ' ' . $operator . ' \\'' . $value . '\\'';\n } else if(is_array($value)) {\n $where[] = $field . ' ' . ' (\\'' . implode(\"','\",$value) . '\\')';\n }\n }\n }\n }\n if(!empty($where)) {\n return static::baseQuery() . ' WHERE ' . implode(' AND ',$where);\n } else {\n return static::baseQuery();\n }\n }", "public function setConditions(array $conditions);", "protected function getCondition($condition)\n {\n }", "protected function _formatConditions($conditions = array(), $condition = 'OR') {\n\t\t\t$operators = array('>', '>=', '<', '<=', '=', '!=', 'LIKE');\n\n\t\t\tforeach ($conditions as $key => $value) {\n\t\t\t\t$condition = !empty($key) && (in_array($key, array('AND', 'OR'))) ? $key : $condition;\n\n\t\t\t\tif (\n\t\t\t\t\tis_array($value) &&\n\t\t\t\t\tcount($value) != count($value, COUNT_RECURSIVE)\n\t\t\t\t) {\n\t\t\t\t\t$conditions[$key] = implode(' ' . $condition . ' ', $this->_formatConditions($value, $condition)) ;\n\t\t\t\t} else {\n\t\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t\tarray_walk($value, function(&$fieldValue, $fieldKey) use ($key, $operators) {\n\t\t\t\t\t\t\t$key = (strlen($fieldKey) > 1 && is_string($fieldKey) ? $fieldKey : $key);\n\t\t\t\t\t\t\t$fieldValue = (is_null($fieldValue) ? $key . ' IS NULL' : trim(in_array($operator = trim(substr($key, strpos($key, ' '))), $operators) ? $key : $key . ' =') . ' ' . $this->_prepareValue($fieldValue));\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = array((is_null($value) ? $key . ' IS NULL' : trim(in_array($operator = trim(substr($key, strpos($key, ' '))), $operators) ? $key : $key . ' =') . ' ' . $this->_prepareValue($value)));\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions[$key] = implode(' ' . (strpos($key, '!=') !== false ? 'AND' : $condition) . ' ', $value);\n\t\t\t\t}\n\n\t\t\t\t$conditions[$key] = ($key === 'NOT' ? 'NOT' : null) . ($conditions[$key] ? '(' . $conditions[$key] . ')' : $conditions[$key]);\n\t\t\t}\n\n\t\t\t$response = $conditions;\n\t\t\treturn $response;\n\t\t}", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\n }", "private function parseMetaboxConditions()\n\t\t{\n\t\t\tforeach( $this->_conditions as $condition ) {\n\t\t\t\tif( !$condition ) {\n\t\t\t\t\treturn '<style>#' . $this->_id . ' { display: none !important; }</style>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn '';\n\t\t}", "protected function cleanValue()\n {\n return str_replace([\n '%',\n '-',\n '+',\n ], '', $this->condition->value);\n }", "public function getCondition() \n {\n return $this->_fields['Condition']['FieldValue'];\n }", "protected function _prepareConditionBlock(Collection $collection)\n\t{\n\t\t$array = array();\n\t\t\n\t\t/* @var $condition t41_Condition */\n\t\tforeach ($collection->getConditions() as $condition) {\n\t\t\t\n\t\t\t/* get property id in backend */\n\t\t\t$key = $this->_mapper->propertyToDatastoreName($collection->getClass(), $condition[0]->getProperty()->getId());\n\n\t\t\t$array[$key] = array();\n\t\t\t\n\t\t\t$clauses = $condition[0]->getClauses();\n\t\t\t$value = array();\n\n\t\t\tforeach ($clauses as $clause) {\n\t\t\t\n\t\t\t\tif (! isset($mode)) $mode = isset($clause['mode']) ? $clause['mode'] : Backend\\Condition::MODE_AND;\n\t\t\t\t$ops = $this->_matchOperator($clause['operator']);\n\n\t\t\t\t$prefix = $suffix = null;\n\t\t\t\t\n\t\t\t\tforeach ($ops as $op) {\n\n\t\t\t\t\tswitch ($op) {\n\t\t\t\t\n\t\t\t\t\t\tcase Backend\\Condition::OPERATOR_BEGINSWITH:\n\t\t\t\t\t\t\t$prefix = '^'; \n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase Backend\\Condition::OPERATOR_ENDSWITH:\n\t\t\t\t\t\t\t$suffix = '$';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (is_array($clause['value'])) {\n\t\t\t\t\t\t\n\t\t\t\t\t$value[] = $prefix . '[' . implode(\",\", $clause['value']) . ']' . $suffix;\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t$value[] = $prefix . $clause['value'] . $suffix;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$array[$key][$mode] = $value;\n\t\t\t$mode = null;\n\t\t}\n\n\t\t$this->_conditionsBlock = $array;\n\t}", "protected function _prepareAlbumCommentConditionsCustomized(array &$sqlConditions, array $conditions, array $fetchOptions)\n {\n }", "abstract public function getConditionsInstance();", "protected function parseConditions($conditions) {\n\t\t$conditions = preg_replace(\"/([\\w\\.]+)\\s+between\\s+([^\\s]+)\\s+and\\s+([^\\s\\(\\)]+)/i\", \"$1 >= $2 and $1 <= $3\", $conditions);\n\t\t$conditions = str_replace(\n\t\t\tarray('{', '}', '[', ']', '`', ';'),\n\t\t\tarray('&#123', '&#125', '&#91', '&#93', '&#96', '&#59'),\n\t\t\t$conditions\n\t\t);\n\t\t$this->checkSafety($conditions);\n\t\treturn $conditions;\n\t}", "private static function _getRequiredOptionsAttributes()\n {\n return \"array(''required'' => ''required'')\";\n }", "function custom_conds( $conds = array())\n\t{\n\t\t// rating_id condition\n\t\tif ( isset( $conds['id'] )) {\n\t\t\t$this->db->where( 'id', $conds['id'] );\n\t\t}\n\n\t\t// user_id condition\n\t\tif ( isset( $conds['user_id'] )) {\n\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\n\t\t}\n\n\t\t// shop_id condition\n\t\tif ( isset( $conds['shop_id'] )) {\n\t\t\t$this->db->where( 'shop_id', $conds['shop_id'] );\n\t\t}\n\n\t\t// rating condition\n\t\tif ( isset( $conds['rating'] )) {\n\t\t\t$this->db->where( 'rating', $conds['rating'] );\n\t\t}\n\n\t\t// title condition\n\t\tif ( isset( $conds['title'] )) {\n\t\t\t$this->db->where( 'title', $conds['title'] );\n\t\t}\n\n\t\t// description condition\n\t\tif ( isset( $conds['description'] )) {\n\t\t\t$this->db->where( 'description', $conds['description'] );\n\t\t}\n\n\t\t$this->db->order_by( 'added_date', 'desc' );\n\t}", "protected function prepare($conditions) {\n\t\tif(is_array($conditions) && !empty($conditions)) {\n\t\t\t$result = array(0 => \"\");\n\t\t\tforeach($conditions as $key=>$value) {\n\t\t\t\t$join = \"\";\n\t\t\t\tif(!empty($result[0])) { $join = \" AND \"; }\n\t\t\t\tif(!empty($result[0])) { $result[0] .= $join; }\n\n\t\t\t\t//Change from IN to single if only one element\n\t\t\t\tif(is_array($value) && sizeof($value) == 1) { $value = array_values($value); $value = $value[0]; } \n\t\t\t\t//Handle empty arrays\n\t\t\t\tif(is_array($value) && empty($value)) { continue; } \t\t\t\t\t\n\n\t\t\t\t//Handle special cases\n\t\t\t\tif(!is_array($value) && preg_match('!IS (NOT )?NULL!sim',$value)) {\n\t\t\t\t\t$result[0] .= \"$key $value\";\n\t\t\t\t}\n\t\t\t\t//Handle array of values\n\t\t\t\telse if(is_array($value)) {\n\t\t\t\t\t$instr = str_repeat('?,', count($value) - 1) . '?';\n\t\t\t\t\t$result[0] .= \"$key IN ($instr)\";\n\t\t\t\t\tforeach($value as $v) { $result[] = $v; }\n\t\t\t\t//Handle single value\n\t\t\t\t} else {\n\t\t\t\t\t$result[0] .= \"$key = ?\";\n\t\t\t\t\t$result[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($result[0])) { return array(); }\n\t\t\treturn $result;\n\t\t}\n\t\treturn $conditions;\n\t}", "public static function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\n\t\t$conditions['select'] = '`id`, `id` AS sid, `title`, \\'\\' AS `alias`, 1 AS parent_id, `section` AS extension, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `section`';\n\n\t\t$where_or = array();\n\t\t$where_or[] = \"section REGEXP '^[\\\\-\\\\+]?[[:digit:]]*\\\\.?[[:digit:]]*$'\";\n\t\t$where_or[] = \"section IN ('com_banner', 'com_contact', 'com_contact_details', 'com_content', 'com_newsfeeds', 'com_sections', 'com_weblinks' )\";\n\t\t$conditions['where_or'] = $where_or;\n\n\t\t$conditions['order'] = \"id ASC, section ASC, ordering ASC\";\t\n\n\t\treturn $conditions;\n\t}", "public function getConditionOperator();", "private function createWhereByValue($value){\n $filterDbOfValue = $value->getFilterDB();\n if(is_null($filterDbOfValue)){\n $filterDbOfValue = $this->id .\"='\".$value->getId().\"'\";\n }\n return $filterDbOfValue;\n }", "protected function applyFieldConditions()\n {\n if ($this->field !== null) {\n $this->andWhere(Db::parseParam('fieldId', $this->parseFieldValue($this->field)));\n }\n }", "function defineCriterias($criterio,$PreparedStatement){\n\t\t\tif(isset ($criterio[\"consumo_id\"]) && trim($criterio[\"consumo_id\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_id = \".Connection::inject($criterio[\"consumo_id\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"socio_id\"]) && trim($criterio[\"socio_id\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND socio_id = \".Connection::inject($criterio[\"socio_id\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"nro_medidor\"]) && trim($criterio[\"nro_medidor\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND nro_medidor LIKE '%\".Connection::inject($criterio[\"nro_medidor\"]).\"%'\";\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_lectura\"]) && trim($criterio[\"fecha_lectura\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_lectura = \".Connection::inject($criterio[\"fecha_lectura\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_emision\"]) && trim($criterio[\"fecha_emision\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_emision = \".Connection::inject($criterio[\"fecha_emision\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"periodo_mes\"]) && trim($criterio[\"periodo_mes\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND periodo_mes = \".Connection::inject($criterio[\"periodo_mes\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"periodo_anio\"]) && trim($criterio[\"periodo_anio\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND periodo_anio = \".Connection::inject($criterio[\"periodo_anio\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"consumo_total_lectura\"]) && trim($criterio[\"consumo_total_lectura\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_total_lectura = \".Connection::inject($criterio[\"consumo_total_lectura\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"consumo_por_pagar\"]) && trim($criterio[\"consumo_por_pagar\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_por_pagar = \".Connection::inject($criterio[\"consumo_por_pagar\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"costo_consumo_por_pagar\"]) && trim($criterio[\"costo_consumo_por_pagar\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND costo_consumo_por_pagar = \".Connection::inject($criterio[\"costo_consumo_por_pagar\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"estado\"]) && trim($criterio[\"estado\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND estado = '\".Connection::inject($criterio[\"estado\"]).\"'\";\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_hora_pago\"]) && trim($criterio[\"fecha_hora_pago\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_hora_pago = \".Connection::inject($criterio[\"fecha_hora_pago\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"usuario_pago\"]) && trim($criterio[\"usuario_pago\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND usuario_pago = \".Connection::inject($criterio[\"usuario_pago\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"monto_pagado\"]) && trim($criterio[\"monto_pagado\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND monto_pagado = \".Connection::inject($criterio[\"monto_pagado\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"pagado_por\"]) && trim($criterio[\"pagado_por\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND pagado_por = \".Connection::inject($criterio[\"pagado_por\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"ci_pagado_por\"]) && trim($criterio[\"ci_pagado_por\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND ci_pagado_por = \".Connection::inject($criterio[\"ci_pagado_por\"]);\n\t\t\t}\n\t\t\treturn $PreparedStatement;\n\t\t}", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "private function formatWheres()\n\t{\n\t\t$value = '';\n\t\tforeach ($this->wheres as $val)\n\t\t{\n\t\t\tif ($value != '')\n\t\t\t\t$value .= ' AND ';\n\t\t\t$value .= $val;\n\t\t}\n\t\treturn $value;\n\t}", "protected function _compile_conditions(array $conditions)\n {\n $last_condition = NULL;\n\n $sql = '';\n foreach ($conditions as $group)\n {\n // Process groups of conditions\n foreach ($group as $logic => $condition)\n {\n if ($condition === '(')\n {\n if ( ! empty($sql) AND $last_condition !== '(')\n {\n // Include logic operator\n $sql .= ' '.$logic.' ';\n }\n\n $sql .= '(';\n }\n elseif ($condition === ')')\n {\n $sql .= ')';\n }\n else\n {\n if ( ! empty($sql) AND $last_condition !== '(')\n {\n // Add the logic operator\n $sql .= ' '.$logic.' ';\n }\n\n // Split the condition\n list($column, $op, $value) = $condition;\n // Support db::expr() as where clause\n if ($column instanceOf db_expression and $op === null and $value === null)\n {\n $sql .= (string) $column;\n }\n else\n {\n if ($value === NULL)\n {\n if ($op === '=')\n {\n // Convert \"val = NULL\" to \"val IS NULL\"\n $op = 'IS';\n }\n elseif ($op === '!=')\n {\n // Convert \"val != NULL\" to \"valu IS NOT NULL\"\n $op = 'IS NOT';\n }\n }\n\n // Database operators are always uppercase\n $op = strtoupper($op);\n if (($op === 'BETWEEN' OR $op === 'NOT BETWEEN') AND is_array($value))\n {\n // BETWEEN always has exactly two arguments\n list($min, $max) = $value;\n\n if (is_string($min) AND array_key_exists($min, $this->_parameters))\n {\n // Set the parameter as the minimum\n $min = $this->_parameters[$min];\n }\n\n if (is_string($max) AND array_key_exists($max, $this->_parameters))\n {\n // Set the parameter as the maximum\n $max = $this->_parameters[$max];\n }\n\n // Quote the min and max value\n $value = $this->quote($min).' AND '.$this->quote($max);\n }\n elseif ($op === 'FIND_IN_SET' || strstr($column, '->') )\n {\n }\n else\n {\n if (is_string($value) AND array_key_exists($value, $this->_parameters))\n {\n // Set the parameter as the value\n $value = $this->_parameters[$value];\n }\n\n // Quote the entire value normally\n $value = $this->quote($value);\n \n }\n\n //json字段查询\n if ( strstr($column, '->') ) \n {\n $value = is_string($value) ? $this->quote($value) : $value;\n list($column, $json_field) = explode('->', $column, 2);\n\n $column = $this->quote_field($column, false);\n $sql .= $column.'->\\'$.' . $json_field . '\\' '.$op.' '.$value;\n }\n else\n {\n // Append the statement to the query\n $column = $this->quote_field($column, false);\n if ($op === 'FIND_IN_SET') \n {\n $sql .= $op.\"( '{$value}', {$column} )\";\n }\n else \n {\n $sql .= $column.' '.$op.' '.$value;\n }\n }\n }\n }\n\n $last_condition = $condition;\n }\n }\n\n return $sql;\n }", "public function startCondition()\n {\n $conditionBuilder = new ConditionBuilder($this);\n $this->conditionBuilders[] = $conditionBuilder;\n return $conditionBuilder;\n }", "function _buildAttributeQuery($glue, $criteria, $join = false)\n {\n /* Initialize the clause that we're building. */\n $clause = '';\n\n /* Get the table alias to use for this set of criteria. */\n if ($join) {\n $alias = $this->_getAlias(true);\n } else {\n $alias = $this->_getAlias();\n }\n\n foreach ($criteria as $key => $vals) {\n if (!empty($vals['OR']) || !empty($vals['AND'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= '(' . $this->_buildAttributeQuery($glue, $vals) . ')';\n } elseif (!empty($vals['JOIN'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= $this->_buildAttributeQuery($glue, $vals['JOIN'], true);\n } else {\n if (isset($vals['field'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= Horde_Sql::buildClause($this->_db, $alias . '.attribute_' . $vals['field'], $vals['op'], $vals['test']);\n } else {\n foreach ($vals as $test) {\n if (!empty($clause)) {\n $clause .= ' ' . $key . ' ';\n }\n $clause .= Horde_Sql::buildClause($this->_db, $alias . '.attribute_' . $test['field'], $test['op'], $test['test']);\n }\n }\n }\n }\n\n return $clause;\n }", "private function _retrieveFormattedDataAttributes()\n {\n $dataAttribs = '';\n $filter = new Zend_Filter_Word_CamelCaseToDash();\n foreach ($this->_dataAttribs as $key => $value) {\n $key = strtolower($filter->filter($key));\n if ($value === true) {\n $value = 'true';\n } else if($value === false) {\n $value = 'false';\n }\n $dataAttribs .= \"data-$key=\\\"$value\\\" \";\n }\n return $dataAttribs;\n }" ]
[ "0.65336376", "0.65336376", "0.63051194", "0.59452623", "0.58800155", "0.58586246", "0.5798726", "0.5718138", "0.5715725", "0.5703869", "0.56777", "0.5596623", "0.5591259", "0.5584627", "0.5584627", "0.554995", "0.554842", "0.55405974", "0.553837", "0.5503895", "0.5485584", "0.54835397", "0.54502106", "0.54397184", "0.54393727", "0.5391314", "0.5380555", "0.5368163", "0.5360645", "0.53593326", "0.5347049", "0.5335461", "0.5319804", "0.53101146", "0.52967316", "0.52961564", "0.52875304", "0.5285238", "0.5279705", "0.5273429", "0.52695125", "0.5252675", "0.5229348", "0.5229348", "0.5229348", "0.52246636", "0.5219135", "0.52141416", "0.52141416", "0.52141416", "0.5210206", "0.52085465", "0.52081525", "0.5190822", "0.5188445", "0.518296", "0.51826364", "0.51826364", "0.51826364", "0.5182202", "0.517496", "0.51746714", "0.51632684", "0.5156504", "0.51537216", "0.51449597", "0.5139602", "0.51385975", "0.5136764", "0.5132556", "0.51222646", "0.5118178", "0.51126343", "0.5104115", "0.50933075", "0.5089767", "0.5075106", "0.50713617", "0.5070527", "0.5064371", "0.5062157", "0.50618833", "0.505939", "0.5057065", "0.50509244", "0.50363964", "0.502221", "0.50196886", "0.50184673", "0.5018079", "0.5012792", "0.49811006", "0.4976295", "0.49758637", "0.4968919", "0.4967486", "0.4967108", "0.49575454", "0.49510676", "0.49384585" ]
0.6552558
0
Prepare actions attribute value
protected function prepareActionAttributeValue($actions) { $condition = $this->actionFactory->create($actions['type']); $attributes = $condition->loadAttributeOptions()->getAttributeOption(); if (isset($attributes[$actions['attribute']])) { $condition->setAttribute($actions['attribute']); if (in_array($condition->getInputType(), ['select', 'multiselect'])) { // reload options flag $condition->unsetData('value_select_options'); $condition->unsetData('value_option'); $options = $condition->getValueOption(); if (is_array($actions['value'])) { foreach ($actions['value'] as $key => $value) { $optionId = array_search($value, $options); $actions['value'][$key] = $optionId; } } else { $optionId = array_search($actions['value'], $options); $actions['value'] = $optionId; } } } return $actions['value']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function prepareActionAttributeValue($actions)\n {\n $condition = $this->actionFactory->create($actions['type']);\n $attributes = $condition->loadAttributeOptions()->getAttributeOption();\n\n if (isset($attributes[$actions['attribute']])) {\n $condition->setAttribute($actions['attribute']);\n if (in_array($condition->getInputType(), ['select', 'multiselect'])) {\n // reload options flag\n $condition->unsetData('value_select_options');\n $condition->unsetData('value_option');\n\n $options = $condition->getValueOption();\n if (is_array($actions['value'])) {\n foreach ($actions['value'] as $key => $value) {\n $actions['value'][$key] = $options[$value];\n }\n } else {\n $actions['value'] = $options[$actions['value']];\n }\n }\n }\n return $actions['value'];\n }", "private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}", "static function get_action_parameter()\r\n {\r\n return self :: PARAM_ACTION;\r\n }", "protected function prepareAssignCatActionData()\n {\n foreach ($this->_data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->_urlPath = $value;\n break;\n case 'paramName':\n $this->_paramName = $value;\n break;\n default:\n $this->_additionalData[$key] = $value;\n break;\n }\n }\n }", "protected function setActionName() {\n return NULL;\n }", "protected function getCommandControllerActionField() {}", "public function prepare()\n {\n parent::prepare();\n\n $this->_data['config']['actions'] = [\n [\n 'actionName' => 'reset',\n 'targetName' => '${ $.name }',\n 'params' => [\n json_encode($this->getRobotsDefaultCustomInstructions())\n ]\n ]\n ];\n }", "static function get_action_parameter()\r\n {\r\n return self :: PARAM_USER_RIGHT_ACTION;\r\n }", "function set_actions_data( $raw_actions_data ) {\n\t\t$actions_data = array_map( [ $this, 'sanitize_action_fields' ], $raw_actions_data );\n\t\t// remove empty values from actions array\n\t\t$actions_data = array_filter( $actions_data );\n\t\t$this->update_meta( 'actions', $actions_data );\n\t\tunset( $this->actions );\n\t}", "public function getActionParameter(){\n return $this->actionParameter;\n }", "private function normalizeAction($raw)\n {\n $action = array();\n $action['id'] = strval($raw->Name);\n $action['appId'] = $this->config->application->appId;\n foreach($raw->Attribute as $item)\n {\n $name = (string)$item->Name;\n $value = (string)$item->Value;\n $action[$name] = $value;\n }\n return $action;\n }", "public function getMassActionValues() {\n return '';\n }", "static function get_action_parameter()\r\n {\r\n return ComplexDisplay :: PARAM_DISPLAY_ACTION;\r\n }", "public function setAction($str);", "function get_bulk_actions() {\n\t\t//bulk action combo box parameter\n\t\t//if you want to add some more value to bulk action parameter then push key value set in below array\n\t\t$actions = array();\n\t\treturn $actions;\n }", "function map_action($action) {\n return $action . '_action';\n }", "public function setup_actions() {}", "protected function prepareItemActions()\n {\n if (!empty($this->_actions)) {\n return;\n }\n \n $currentType = FormUtil::getPassedValue('type', 'user', 'GETPOST', FILTER_SANITIZE_STRING);\n $currentFunc = FormUtil::getPassedValue('func', 'main', 'GETPOST', FILTER_SANITIZE_STRING);\n $dom = ZLanguage::getModuleDomain('MUTicket');\n if ($currentType == 'admin') {\n if (in_array($currentFunc, array('main', 'view'))) {\n /* $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'preview',\n 'linkTitle' => __('Open preview page', $dom),\n 'linkText' => __('Preview', $dom)\n );*/\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this['title']),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'MUTicket:CurrentState:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n /* $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );*/\n }\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_DELETE)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'delete', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'delete',\n 'linkTitle' => __('Delete', $dom),\n 'linkText' => __('Delete', $dom)\n );\n }\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'view', 'arguments' => array('ot' => 'currentState')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n if ($currentType == 'user') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this['title']),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'MUTicket:CurrentState:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n /* $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );*/\n }\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_DELETE)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'delete', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'delete',\n 'linkTitle' => __('Delete', $dom),\n 'linkText' => __('Delete', $dom)\n );\n }\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'view', 'arguments' => array('ot' => 'currentState')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n }", "protected function getCommandControllerActionDescriptionField() {}", "function capture_customize_post_value_set_actions() {\n\t\t$action = current_action();\n\t\t$args = func_get_args();\n\t\t$this->captured_customize_post_value_set_actions[] = compact( 'action', 'args' );\n\t}", "function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}", "public function get_actions() {\n $actions = parent::get_actions();\n $assignaction = new deepsight_action_usersetuser_assign($this->DB, 'usersetuserassign');\n $assignaction->endpoint = (strpos($this->endpoint, '?') !== false)\n ? $this->endpoint.'&m=action' : $this->endpoint.'?m=action';\n array_unshift($actions, $assignaction);\n return $actions;\n }", "function setVars($action){\n $id = trim(filter_input($action, 'id'));\n $text = trim(filter_input($action, 'text'));\n $author = trim(filter_input($action, 'author'));\n $authorId = trim(filter_input($action, 'authorId'));\n $category = trim(filter_input($action, 'category'));\n $categoryId = trim(filter_input($action, 'categoryId'));\n $limit = trim(filter_input($action, 'limit'));\n $random = trim(filter_input($action, 'random'));\n $data = array(\"id\"=>$id, \"text\"=>$text,\n \"author\"=>$author, \"authorId\"=>$authorId,\n \"category\"=>$category, \"categoryId\"=>$categoryId,\n \"limit\"=>$limit, \"random\"=>$random);\n return $data;\n }", "protected function beforeValidate()\n {\n $this->actions = !empty($this->actions) ? implode(',', $this->actions) : '';\n return parent::beforeValidate();\n }", "public function getActionName(){\n return $this->actionName;\n }", "protected function _prepareColumns()\n {\n $result = parent::_prepareColumns();\n $column = $this->getColumn('action');\n if (!$column) {\n return $result;\n }\n $data = $column->getData();\n $data['actions'][0]['url'] = array('base' => 'adminhtml/sales_order/view');\n $column->setData($data);\n return $result;\n }", "public function getActionsAttribute()\n {\n return [\n 'id' => $this->id,\n 'cancel' => $this->concept == 'PENDIENTE',\n 'approved' => $this->concept == 'APROBADO',\n 'next' => __('app.selects.project.concept_next.' . $this->concept),\n ];\n }", "public function setActionIdAttribute($input)\n {\n $this->attributes['action_id'] = $input ? $input : null;\n }", "function setAction($action) {\r\r\n\t\t$this->action = strtolower($action);\r\r\n\t}", "protected function getAction() {}", "function erp_process_actions() {\n if ( isset( $_REQUEST['erp-action'] ) ) {\n $action = sanitize_text_field( wp_unslash( $_REQUEST['erp-action'] ) );\n\n do_action( 'erp_action_' .$action, $_REQUEST );\n }\n}", "function setAllAction($action){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('UPDATE bot_action SET action = :action');\n\t\t$statement->execute(array(':action'=>$action));\n\t}", "protected function initializeActionMethodArguments() {}", "protected function getActions() {}", "function setAction($action);", "protected function _getActionUrl()\n {\n return Mage::helper('adminhtml')->\n getUrl(\n Smile_DatabaseCleanup_Block_Button_Abstract::ACTION_URL,\n array('entity_type'=>'attribute', 'action'=>'analyze')\n );\n }", "private function add_actions()\n {\n }", "protected function init_model_actions() {\n\t\treturn Arr::merge(parent::init_model_actions(), array(\n\t\t\t'popover_add',\n\t\t));\n\t}", "public function getActionsAttribute()\n {\n return [\n 'id' => $this->id,\n 'beneficiary_id' => $this->beneficiary->id,\n 'cancel' => $this->state == 'PENDIENTE',\n 'approved' => $this->state == 'APROBADO',\n 'next' => __('app.selects.loan.state_next.' . $this->state),\n ];\n }", "protected function _generateAttributeOnToken()\n\t{\n\t\tif (!isset($this->_tempToken[\"args\"][\"attributes\"])) {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"] = array();\n\t\t}\n\t\tif (isset($this->_tempToken[\"args\"][\"attributes\"][$this->_attribute])) {\n\t\t\t$this->_attribute = null;\n\t\t} else {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"][$this->_attribute] = array(\n\t\t\t\t\"value\" => \"\"\n\t\t\t);\n\t\t}\n\t}", "protected function actionParamsSets() {\n\t\treturn array();\n\t}", "abstract protected function setMainActionName();", "protected function getActionInput(): string\n\t{\n\t\treturn trim($this->option('action'));\n\t}", "public function setAction($action);", "public function setExpectedAction($action);", "public function action(){\n return $this->action;\n }", "protected function initializeActionEntries() {}", "public function buildTemplateAction()\n {\n $action = [\n 'type' => ActionType::RICH_MENU_SWITCH,\n 'richMenuAliasId' => $this->richMenuAliasId,\n 'data' => $this->data,\n ];\n if (isset($this->label)) {\n $action['label'] = $this->label;\n }\n\n return $action;\n }", "function get_actions_data() {\n\t\t$actions_data = $this->get_meta( 'actions' );\n\t\treturn is_array( $actions_data ) ? array_map( [ $this, 'format_action_fields' ], $actions_data ) : [];\n\t}", "function assignProperties() {\n\t\t$hash = $this->__action;\n\t\tforeach ($hash as $key => $value) {\n\t\t\tif (!isset($value)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (preg_match('/^_.*/i', $key)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->assignProperty($key, $value);\n\t\t}\n\t}", "function set_action($action)\r\n {\r\n return $this->set_parameter(self :: PARAM_ACTION, $action);\r\n }", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAction(){\r\n return $this->sAction;\r\n }", "function sanitize($value, $action)\n\t{\n\t\tif(is_array($action))\n\t\t{\n\t\t\t$options = $action;\n\t\t\t$action = $action['action'];\n\t\t}\n\t\t\n\t\tswitch($action)\n\t\t{\n\t\t\tcase 'trim': \t\t\t\treturn trim($value);\n\t\t\tcase 'escape': \t\t\t\treturn Sanitize::escape($value);\n\t\t\tcase 'striphtml': \t\t\treturn Sanitize::html($value, true);\n\t\t\tcase 'escapehtml': \t\t\treturn Sanitize::html($value);\n\t\t\tcase 'stripall': \t\t\treturn Sanitize::stripAll($value);\n\t\t\tcase 'stripimages': \t\treturn Sanitize::stripImages($value);\n\t\t\tcase 'stripscripts':\t\treturn Sanitize::stripScripts($value);\n\t\t\tcase 'stripextraws':\t\treturn Sanitize::stripWhitespace($value);\n\t\t\tcase 'stripdefaultvalue':\treturn $this->stripDefaultValue($value, $options);\n\t\t}\n\t\t\n\t\treturn $action;\n\t}", "public function actionAttributes(array $attributes): string\n {\n $newAttributes = array_merge(\n $this->actionAttributes,\n $attributes\n );\n\n return Attribute::toString($newAttributes);\n }", "private function setParameter( $action ) {\r\n\t\t$aufrufParameter = Array();\r\n\t\t$refParameter = $action->getParameters();\r\n\r\n\t\tforeach( $refParameter as $p => $param ) {\r\n\t\t\t$parameterName = $param->getName();\r\n\t\t\tif ( $parameterName == '_db' ) {\r\n\t\t\t\t// we have a db request\r\n\t\t\t\t$wert = $this->_db;\r\n\t\t\t} else if ( $parameterName == '_uid' ) {\r\n\t\t\t\t// we have a uid in our request, validate them\r\n\t\t\t\tif ( $_SESSION && array_key_exists( 'uid', $_SESSION ) ) {\r\n\t\t\t\t\t//\t\t\t\t\t\t$wert = decrypt( $_SESSION['uid'] );\r\n\t\t\t\t\t$wert = $_SESSION['uid'];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$wert = NULL;\r\n\t\t\t\t}\r\n\t\t\t} else if ( $parameterName[0] != '_' && $_SERVER['REQUEST_METHOD'] == 'POST' && array_key_exists($parameterName, $_POST) ) {\r\n\t\t\t\t$wert = $_POST[$parameterName];\r\n\t\t\t} else if ( $parameterName[0] != '_' && array_key_exists( $parameterName, $_GET ) ) {\r\n\t\t\t\t$wert = $_GET[$parameterName];\r\n\t\t\t} else if ( $param->isDefaultValueAvailable() ) {\r\n\t\t\t\t$wert = $param->getDefaultValue();\r\n\t\t\t} else {\r\n\t\t\t\t$wert = null;\r\n\t\t\t}\r\n\t\t\t$aufrufParameter[$p] = $wert;\r\n\t\t} // end foreach\r\n\r\n\t\treturn $aufrufParameter;\r\n\t}", "function bulk_actions() {\n\t\t$screen = get_current_screen();\n\n\t\tif ( is_null( $this->_actions ) ) {\n\t\t\t$no_new_actions = $this->_actions = $this->get_bulk_actions();\n\t\t\t// This filter can currently only be used to remove actions.\n\t\t} else {\n\t\t\t$two = '2';\n\t\t}\n\n\t\tif ( empty( $this->_actions ) )\n\t\t\treturn;\n\n\t\techo \"<select name='ep-reg-bulk[action$two]'>\\n\";\n\t\techo \"<option value='-1' selected='selected'>\" . __( 'Bulk Actions' ) . \"</option>\\n\";\n\t\tforeach ( $this->_actions as $name => $title )\n\t\t\techo \"\\t<option value='$name'>$title</option>\\n\";\n\t\techo \"</select>\\n\";\n\n\t\tsubmit_button( __( 'Apply' ), 'button-secondary action', false, false, array( 'id' => \"ep-bulk-reg-doaction$two\" ) );\n\t\techo \"\\n\";\n\t}", "public function setFormAction($value) { $this->_formAction = $value; }", "public function getActionName(){ }", "private function generateAction($action_name, $entity, $entityManager)\n {\n $action['name'] = $action_name;\n $metadata = $entityManager->getClassMetadata(get_class($entity));\n $action['serviceticket_class'] = $metadata->getName();\n //$action['serviceticket_id'] = $metadata->getIdentifierValues($entity);\n //$action['serviceticket_id'] = $entity->getName();\n $action['serviceticket_name'] = $entity->getName();\n return $action;\n }", "protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}", "public function setAction(string $action) {\n $trimmed = trim($action);\n\n if (strlen($trimmed) != 0) {\n $this->action = $trimmed;\n }\n }", "protected function init_model_actions() {\n\t\treturn Arr::merge(parent::init_model_actions(), array(\n\t\t\t'photo',\n\t\t));\n\t}", "public function add_action($actions){\r\n\t\t\t$actions[$this->id] = $this->name;\r\n\t\t\treturn $actions;\r\n\t\t}", "function _action($action)\n\t{\n\t // Lay input\n\t $ids = $this->uri->rsegment(3);\n\t $ids = (!$ids) ? $this->input->post('id') : $ids;\n\t $ids = (!is_array($ids)) ? array($ids) : $ids;\n\t\n\t // Thuc hien action\n\t foreach ($ids as $id)\n\t {\n\t // Xu ly id\n\t $id = (!is_numeric($id)) ? 0 : $id;\n\t \t\n\t // Kiem tra id\n\t $info = model('user_bank')->get_info($id);\n\t if (!$info) continue;\n\t \n\t // Chuyen den ham duoc yeu cau\n\t $this->{'_'.$action}($info);\n\t }\n\t}", "public function get_actions() {\n $actions = parent::get_actions();\n $unassignaction = new deepsight_action_usersetuser_unassign($this->DB, 'usersetuserunassign');\n $unassignaction->endpoint = (strpos($this->endpoint, '?') !== false)\n ? $this->endpoint.'&m=action' : $this->endpoint.'?m=action';\n $unassignaction->condition = 'function(rowdata) { return (rowdata.canunassign == \\'0\\') ? false : true; }';\n array_unshift($actions, $unassignaction);\n return $actions;\n }", "function applyDefaults()\n {\n list($page, $action) = $this->controller->getActionName();\n $fe =& PEAR_PackageFileManager_Frontend::singleton();\n $fe->log('debug',\n str_pad($this->getAttribute('id') .'('. __LINE__ .')', 20, '.') .\n \" applyDefaults ActionName=($page,$action)\"\n );\n }", "public function setActionName($actionName);", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "public function setUserAction($user_action){\r\n\t\t$this->userAction = $user_action;\r\n\t}", "public static function get_action_options() {\n return array(\n 'c' => get_string('create', 'logstore_database'),\n 'r' => get_string('read', 'logstore_database'),\n 'u' => get_string('update', 'logstore_database'),\n 'd' => get_string('delete')\n );\n }", "public function getActionDictionary() {}", "public function setActions($val)\n {\n $this->_propDict[\"actions\"] = $val;\n return $this;\n }", "protected function resolveActionMethodName() {}", "public function obfuscateMethodNames($action)\n\t{\n\treturn $action;\t\n\t}", "function wp_user_request_action_description($action_name)\n {\n }", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "public function __toString()\n {\n return (string) $this->_action;\n }", "public function setAction($value)\n {\n $this->action = $value;\n }", "public function ImageManipulationAction($file_action){\r\n $this->manipulation_action=$file_action;\r\n }", "protected function prepareItemActions()\n {\n if (!empty($this->_actions)) {\n return;\n }\n \n $currentType = FormUtil::getPassedValue('type', 'user', 'GETPOST', FILTER_SANITIZE_STRING);\n $currentFunc = FormUtil::getPassedValue('func', 'main', 'GETPOST', FILTER_SANITIZE_STRING);\n $dom = ZLanguage::getModuleDomain('SurveyManager');\n if ($currentType == 'admin') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'survey', 'id' => $this['id'], 'slug' => $this->slug)),\n 'icon' => 'preview',\n 'linkTitle' => __('Open preview page', $dom),\n 'linkText' => __('Preview', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'SurveyManager:Survey:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'survey', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'survey', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );\n }\n }\n \n // more actions for adding new related items\n $authAdmin = SecurityUtil::checkPermission($component, $instance, ACCESS_ADMIN);\n \n $uid = UserUtil::getVar('uid');\n if ($authAdmin || (isset($uid) && isset($this->createdUserId) && $this->createdUserId == $uid)) {\n \n $urlArgs = array('ot' => 'page',\n 'survey' => $this->id);\n if ($currentFunc == 'view') {\n $urlArgs['returnTo'] = 'adminViewSurvey';\n } elseif ($currentFunc == 'display') {\n $urlArgs['returnTo'] = 'adminDisplaySurvey';\n }\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => $urlArgs),\n 'icon' => 'add',\n 'linkTitle' => __('Create page', $dom),\n 'linkText' => __('Create page', $dom)\n );\n \n $urlArgs = array('ot' => 'response',\n 'survey' => $this->id);\n if ($currentFunc == 'view') {\n $urlArgs['returnTo'] = 'adminViewSurvey';\n } elseif ($currentFunc == 'display') {\n $urlArgs['returnTo'] = 'adminDisplaySurvey';\n }\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => $urlArgs),\n 'icon' => 'add',\n 'linkTitle' => __('Create response', $dom),\n 'linkText' => __('Create response', $dom)\n );\n }\n }\n if ($currentType == 'user') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'survey', 'id' => $this['id'], 'slug' => $this->slug)),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this->getTitleFromDisplayPattern()),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'view', 'arguments' => array('ot' => 'survey')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n }", "public function getActionName(){\n\t\tif ( !isset($_GET['action'])){\n\t\t\treturn 'defaultAction';\n\t\t}\n\t\telse{\n\t\t\treturn $_GET['action'];\n\t\t}\n\t}", "public function toActionExt()\n {\n\n if ($this->actionExt)\n return $this->actionExt;\n\n if ($this->aclRoot)\n $this->actionExt .= '&a_root='.$this->aclRoot;\n\n if ($this->aclRootId)\n $this->actionExt .= '&a_root_id='.$this->aclRootId;\n\n if ($this->aclKey)\n $this->actionExt .= '&a_key='.$this->aclKey;\n\n if ($this->aclNode)\n $this->actionExt .= '&a_node='.$this->aclNode;\n\n if ($this->aclLevel)\n $this->actionExt .= '&a_level='.$this->aclLevel;\n\n if ($this->refId)\n $this->actionExt .= '&refid='.$this->refId;\n\n if ($this->requestedBy)\n $this->actionExt .= '&rqtby='.$this->requestedBy;\n\n if ($this->parentMask)\n $this->actionExt .= '&pmsk='.$this->parentMask;\n\n if ($this->ltype)\n $this->actionExt .= '&ltype='.$this->ltype;\n\n if ($this->contextKey)\n $this->actionExt .= '&cntk='.$this->contextKey;\n\n if ($this->maskRoot)\n $this->actionExt .= '&m_root='.$this->maskRoot;\n\n if ($this->publish)\n $this->actionExt .= '&publish='.$this->publish;\n\n if ($this->targetId)\n $this->actionExt .= '&target_id='.$this->targetId;\n\n if ($this->target)\n $this->actionExt .= '&target='.$this->target;\n\n if ($this->targetMask)\n $this->actionExt .= '&target_mask='.$this->targetMask;\n\n if ($this->viewId)\n $this->actionExt .= '&view_id='.$this->viewId;\n\n if ($this->contextMaskSwt)\n $this->actionExt .= '&cntms='.$this->contextMaskSwt;\n\n return $this->actionExt;\n\n }", "public function set_action($action) {\n $this->_action = (string)$action;\n }", "private function setAction($action) {\n if (is_int($action) || is_string($action)) {\n $this->action = $action;\n }\n }", "protected function get_available_actions()\n {\n }", "protected function get_available_actions()\n {\n }", "public function set_action( $action ) {\n\t\t$this->action = $action;\n\n\t\treturn $this->get_action();\n\t}", "function getAction () {return $this->getFieldValue ('action');}", "protected function createAction()\n {\n }" ]
[ "0.69672364", "0.6375995", "0.6265252", "0.60958993", "0.599421", "0.59652597", "0.59637576", "0.59184337", "0.58816284", "0.58715135", "0.5850302", "0.5815708", "0.578759", "0.57814676", "0.57397443", "0.5704639", "0.5695379", "0.5673382", "0.5672905", "0.5671205", "0.5649011", "0.56444395", "0.56444395", "0.56444395", "0.56172043", "0.56082004", "0.56023246", "0.55956", "0.5559099", "0.55560064", "0.55533606", "0.5541312", "0.5541273", "0.5540686", "0.55284417", "0.55032086", "0.54989016", "0.54986036", "0.54730284", "0.54699355", "0.54632723", "0.5438805", "0.54358894", "0.54185104", "0.5415277", "0.5408368", "0.5406217", "0.53982484", "0.538576", "0.53834814", "0.5380335", "0.5379709", "0.5352533", "0.53405815", "0.5339145", "0.5339145", "0.5339145", "0.5339145", "0.5339145", "0.5339145", "0.533256", "0.53276217", "0.53161466", "0.530737", "0.53016865", "0.5301551", "0.52990204", "0.5289157", "0.5287486", "0.52850384", "0.5284307", "0.5282911", "0.5272617", "0.5260499", "0.5252397", "0.5238643", "0.5235924", "0.52335155", "0.52289784", "0.5227045", "0.5214455", "0.52126056", "0.5206012", "0.52042294", "0.51994747", "0.5198743", "0.5198743", "0.5188595", "0.5185396", "0.51613456", "0.516047", "0.5157883", "0.5155967", "0.51550406", "0.5152812", "0.5151651", "0.5151651", "0.5145978", "0.5144558", "0.5135757" ]
0.7000416
0
Inner source object getter
protected function _getSource() { if (!$this->_source) { throw new LocalizedException(__('Please specify a source.')); } return $this->_source; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getSource();", "public function getObj();", "public function getIndirectObject() {}", "public function getIndirectObject() {}", "public function get_source()\n {\n }", "public function getSourceEntity();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get() ;", "abstract function get();", "public function getSource() : ISource;", "public function getSource(){\n\t\treturn $this->_source;\n\t}", "public function getObject() {}", "public function getObject() {}", "public function __invoke() {\n return (object) $this->data;\n }", "public function getSource();", "public function getSource();", "public function getSource();", "public function getSource();", "public function getSource();", "function getSource()\n {\n return $this->source;\n }", "public function getObj() {\n return $this->obj;\n }", "public function getSourceData();", "public function getObject();", "public function getObject();", "abstract public function getResultObjectProperty();", "public function getSource() {}", "public function getSource() {}", "public function getObject(): object;", "abstract protected function getDirectGetters();", "public function get_source() {\n\t\treturn $this->source;\n\t}", "public function getSource() {\n return $this->source;\n }", "public function getSource() {\n return $this->source;\n }", "public function getSource()\r\n {\r\n return $this->source;\r\n }", "public function source()\n\t{\n\t\treturn $this->_source;\n\t}", "public function getSource()\n {\n return $this->source;\n }", "public function getSource(): ReadableInterface;", "public function getSource()\n {\n return $this->_source;\n }", "private function getObject() {\n return $this->object;\n }", "public function get_object()\n {\n return $this->object;\n }", "function get_value() {return $this->get();}", "public function getEnhanced();", "public function getSource(){\n return $this->source();\n }", "public function get_object()\n {\n return $this->_object;\n }", "function getObject();", "function getObject();", "protected function getObject()\n {\n return $this->parentContext->getObject();\n }", "public function getObject() {\n return $this->object;\n }", "function getObjectIt()\r\n \t{\r\n \t\treturn $this->object_it;\r\n \t}", "public function source()\n\t{\n\t\treturn $this->source;\n\t}", "function getImageSource() {return $this->_imagesource;}", "public static function getters();", "public function raw() {\n return $this->obj;\n }", "public function getSource()\n\t{\n\t\treturn $this->source;\n\t}", "public function source() {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getA() {}", "public function getSourceInstance() {\n\t\t$instance = $this->bean->fetchAs('instance')->source;\n\t\tif ($instance instanceof RedBean_OODBBean && ($instance->id !== 0 || $instance->getMeta('tainted') || !$instance->isEmpty())) {\n\t\t\treturn $instance->box();\n\t\t} elseif ($instance instanceof RedBean_SimpleModel && ($instance->unbox()->id !== 0 || $instance->unbox()->getMeta('tainted') || !$instance->unbox()->isEmpty())) {\n\t\t\treturn $instance;\n\t\t}\n\t\treturn null;\n\t}", "public function getSource() {\n return $this->source;\n }", "public function getSource() {\n return $this->source;\n }", "public function getSource() {\n return $this->source;\n }", "public function getSource()\n {\n }", "public function source();", "public function source();", "public function source();", "public function getSource():array;", "public function getObject()\n {\n return $this;\n }", "function getSource() ;", "public function getB() {}", "public function object()\n {\n return $this->object;\n }", "public function GetSourceProperty()\n {\n return $this->_sourceProperty;\n }", "public function get() {}", "public function get() {}", "public function get() {}", "public function get() {}", "public function get() {}", "public function source()\n {\n return $this->source;\n }", "function &get_entity()\n {\n return $this->object->_stdObject;\n }", "public function getObject()\n {\n return $this->_object;\n }", "abstract public function getData(): object;", "public function getFieldObject() {}", "public function test2()\n\t\t{\n\t\t\treturn get_object_vars($this);\n\t\t}", "public function inner()\n {\n return $this->inner;\n }", "public function inner()\n {\n return $this->inner;\n }", "public function get()\n {\n // TODO: Implement get() method.\n }" ]
[ "0.6439414", "0.640487", "0.6382997", "0.6382997", "0.6302256", "0.62665695", "0.62505823", "0.62505823", "0.62505823", "0.62505823", "0.62505823", "0.62505823", "0.62216425", "0.6195499", "0.61875075", "0.6157564", "0.6156527", "0.6156527", "0.61428696", "0.6094362", "0.6094362", "0.6094362", "0.6094362", "0.6094362", "0.6007776", "0.6007193", "0.5991611", "0.5989078", "0.5989078", "0.5982606", "0.59803", "0.59803", "0.59778786", "0.59506047", "0.59478605", "0.5930759", "0.5930759", "0.58995533", "0.58986187", "0.5898485", "0.58852243", "0.5876131", "0.58663404", "0.5851729", "0.58511704", "0.5844276", "0.58388203", "0.5821107", "0.5813241", "0.5813241", "0.579737", "0.5772345", "0.5770326", "0.57479185", "0.57403815", "0.5737105", "0.57343227", "0.57286584", "0.57139176", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.57106686", "0.5706124", "0.57020736", "0.57006204", "0.57006204", "0.57006204", "0.5697856", "0.56802845", "0.56802845", "0.56802845", "0.56661165", "0.5656482", "0.5653298", "0.56528074", "0.5640234", "0.5630476", "0.56081873", "0.5603909", "0.5603909", "0.5603909", "0.5603909", "0.56032145", "0.5596583", "0.55920154", "0.5574781", "0.55745894", "0.55727077", "0.55724525", "0.55724525", "0.55591416" ]
0.0
-1
for just one row
public function getrow($query , $param = []) { try { $stmt = $this->db->prepare($query); $stmt->execute($param); return $stmt->fetch(); } catch(PDOException $error) { throw new Exception($error->getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function exec_SELECTgetSingleRow() {}", "public function firstRow() {\n\t}", "public function get_row();", "public function getRow() {}", "function _dummy($row) {\n\t\treturn $row;\n\t}", "abstract public function getSpecificRow();", "public function singleRow(){\n $this->execute();\n return $this->statement->fetch(PDO::FETCH_OBJ);\n }", "public function getRow();", "public function fetchRow();", "abstract public function getRow();", "abstract public function getRow();", "function currentRow();", "protected function row($row)\n { \n return DB::table($this->table)\n ->where('personal_access_client', 0)\n ->first()\n ->$row;\n }", "abstract protected function getRow($row);", "function FetchRow() {}", "function firstrow() {\r\n\t\t$result=@mysql_data_seek($this->result,0);\r\n\t\tif ($result) {\r\n\t\t\t$result=$this->getrow();\r\n\t\t}\r\n\t\treturn $this->row;\r\n\t}", "protected function processRow($row)\n {\n return $row;\n }", "public function getRow(){\n return $this->_row;\n }", "abstract public function FetchRow();", "function GetRow()\n {\n return $this->row;\n }", "public abstract function FetchRow();", "protected function loadRow() {}", "public function single_row($item)\n {\n }", "public function single_row($item)\n {\n }", "public function single_row($item)\n {\n }", "public function selectRow($row);", "abstract public function hasRow();", "public function getSingleRow()\r\n {\r\n echo 'hello';\r\n die();\r\n /* $this->db->select('*');\r\n $this->db->from($table);\r\n $this->db->where($condition);\r\n $query = $this->db->get();\r\n return $query->row(); */\r\n }", "public function first_row() {\n if ($this->first_row_memo === null) {\n $this->next();\n $this->first_row_memo = $this->current();\n }\n return $this->first_row_memo;\n }", "abstract function res_row($res);", "protected function filter_row(&$row) {}", "function rows($res){\t\n\t\treturn(0);\n\t}", "private function _prepareRow($array){\n return array_merge($this->_blankRow, $array);\n }", "function fetchSingleRow($query) \t{\n\t\tif($query != '') \t\t{\n\t $res = $this->execute($query);\n\t $data = $this->fetchAll($res);\n\t if($data) return $data[0]; \n\t\t}\n\t}", "public function row() {\n\t\tif ($this->returned) return false;\n\t\t$this->returned = true;\n\t\treturn $this->query;\n\t}", "abstract public function transform(Row $row);", "function fetchRow ()\n {\n return pg_fetch_array($this->_result);\n }", "public function get_record($row) {\n return null;\n }", "public function firstCol() {\n\t}", "abstract protected function _getRowNumeric($rs);", "public function getFirstRow()\n {\n if (count($this->rows) == 0) {\n if (!is_null($this->summaryRow)) {\n return $this->summaryRow;\n }\n return false;\n }\n $row = array_slice($this->rows, 0, 1);\n return $row[0];\n }", "public function getRow()\n {\n return $this->row;\n }", "function FetchRow() {\n\t\t\treturn pg_fetch_row($this->result);\n\t\t}", "private function getSiteData($row) {\n return $row;\n }", "function ValidRow($row) {\n\t$ValidRow = TRUE;\n\treturn $ValidRow;\n}", "function isFirstRowCell() {\n $ret = $this->cellnumber % $this->colnum_int == 1;\n $ret = $ret || ($this->colnum_int == 1);\n# error_log('Step2: ' . $ret);\n return $ret;\n }", "abstract protected function mapRow(array $row);", "abstract protected function mapRow(array $row);", "public function getRows()\n {\n return 1;\n }", "protected function clearRow()\n {\n return $this->clearRowData($this->row, true);\n }", "public function nextRow() {\n $row = parent::nextRow();\n\n // If any decimal columns, ensure we map them back to the correct PHP type\n // GETS ROUND A HOPEFULLY TEMPORARY WEIRDNESS WITH PDO/MYSQL\n if ($this->decimalColumns && $row) {\n foreach ($this->decimalColumns as $decimalColumn) {\n $row[$decimalColumn] = doubleval($row[$decimalColumn]);\n }\n }\n\n return $row;\n }", "function getNextRow()\n {\n $this->current_row_index++;\n if ( $this->current_row_index > ( $this->offset + $this->limit - 1 ) )\n {\n $this->current_row = false;\n $this->current_row_hash = false;\n $this->mapping = false;\n return $this->current_row;\n }\n\n $result = $this->mysqli->query( 'SELECT * FROM ' . $this->table .\n ' LIMIT 1 OFFSET ' . $this->current_row_index );\n if ( $result->num_rows == 1 )\n {\n $this->current_row = $result->fetch_row();\n $this->current_row_hash = array();\n $this->mapping = array();\n foreach ( $result->fetch_fields() as $key => $field )\n {\n $this->current_row_hash[$field->name] = $this->current_row[$key];\n $this->mapping[$key] = $field->name;\n }\n $this->current_field = current( $this->mapping );\n }\n else\n {\n $this->current_row = false;\n $this->current_row_hash = false;\n $this->mapping = false;\n }\n $result->free();\n\n return $this->current_row;\n }", "public function f_one()\n {\n $fetch_all_data = $this->query->fetch(PDO::FETCH_OBJ);\n if($fetch_all_data)\n {\n return $fetch_all_data;\n }else{\n return false;\n }\n \n }", "function readOne() {\n\t\t\t$query = \"SELECT * FROM `\".$this->table_name.\"` WHERE id ='\".$this->id.\"'\";\n\t\t \n\t\t\t// prepare query statement\n\t\t\t$hasil = mysqli_query($this->conn, $query);\n\t\t\t \n\t\t\t$row = mysqli_fetch_array($hasil);\n\t\t\t\n\t\t\treturn $row;\n\t\t}", "public function readFromRow( $row );", "public function queryRow()\n\t{\n\t\treturn $this->queryInternal('fetch',$this->_fetchMode);\n\t}", "public function getData_row()\n {\n return $this->data_row;\n }", "function formatRow(){\n $this->hook('formatRow');\n }", "function testRow ($row, $rowSchema = null) {}", "abstract public function get_rows();", "function rowType($type, $row) {\r\n switch ($row ? $type : false) {\r\n case false: return false;\r\n case PDO::FETCH_NUM: return array_values($row);\r\n case PDO::FETCH_BOTH: return array_merge($row, array_values($row));\r\n case PDO::FETCH_ASSOC: return $row;\r\n case PDO::FETCH_OBJECT: return (object)$row;\r\n }\r\n }", "public function formatRow($row){\r\n \tif(!empty($row))\r\n \t$row['_rev'] = \"\";\r\n return $row;\r\n }", "public function GetSingleRow() : ARRAY\r\n {\r\n return($this->preparedStatement->fetch(\\PDO::FETCH_ASSOC));\r\n }", "private function _selSingleRowCustom($sql)\n\t{\n\t\tglobal $con;\n\t\t$query=mysqli_query($con,$sql);\n\n $result=mysqli_fetch_object($query);\n mysqli_free_result($query);\n if(mysqli_more_results($con))\n {\n mysqli_next_result($con);\n }\n\t\tif(!empty($result))\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}", "public function getFromCache_queryRow() {}", "public function get_row() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->get_rows();\n\t\t}\n\t\t$value = current($this->rows);\n\t\tnext($this->rows);\n\t\treturn $value;\n\t}", "function AggregateListRow() {\n\t}", "abstract protected function getRows();", "private function generateSingleRow(& $data)\n {\n $id=$data['id'];\n\t\t$format=$data['format'];\n\t\tforeach($data['data'] as $key=>$value)\n\t\t{\n\t\t\t$search=\"{\".$id.\":\".$key.\"}\";\n\t\t\t$this->_search[]=$search;\n\n\t\t\t//if it needs formating\n\t\t\tif(isset($format[$key]))\n\t\t\t{\n\t\t\t\tforeach($format[$key] as $ftype=>$f)\n\t\t\t\t{\n\t\t\t\t\t$value=$this->formatValue($value,$ftype,$f);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_replace[]=$value;\n\t\t}\n }", "public function first_row($type = 'object')\n\t{\n\t\treturn $this->row(0, $type);\n\t}", "function Next()\n {\n $this->row = mysqli_fetch_array($this->rs);\n return !!$this->row;\n }", "public function getRow() {\n\n if ($this->setRow($this->rs)) {\n $this->setId($this->row['id']);\n $this->setReg($this->row['reg']);\n $this->setCampo($this->row['campo']);\n $this->setCodigo($this->row['codigo']);\n $this->setDescricao($this->row['descricao']);\n return 1;\n } else {\n //$this->setError(mysql_error());\n return 0;\n }\n }", "public function get_key($row) {\n return null;\n }", "public function getRow()\n {\n return $this->row;\n }", "abstract public function nextRow($result = false);", "protected function _getRate($row)\n {\n return 1;\n }", "abstract protected function _getRowBoth($rs);", "public function rowCount() {}", "function fetchRow() {\n $result = $this->_conn->fetchRow();\n if ($result == false) {\n return false;\n }\n $dm = $this->_formatTag($result);\n return $dm;\n }", "function getNextRow()\r\n\t{\r\n\t\t$this->node_priority = false;\r\n\t\t\r\n\t\t// set mapping array\r\n\t\t$this->first_field = true;\r\n\t\treset( $this->mapping );\r\n\r\n\t\tif( $this->ignore_first_row )\r\n\t\t{\r\n\t\t\t$this->ignore_first_row = false;\r\n\t\t\tfgetcsv( $this->m_aData , 100000, $this->delimiter, $this->enclosure ); // nirvana\r\n\t\t}\r\n\r\n\t\t$this->row = fgetcsv( $this->m_aData , 100000, $this->delimiter, $this->enclosure);\r\n\r\n\t\treturn $this->row;\r\n\t}", "function FetchOneRowDataByOneField($tableName,$fieldName,$fieldValue)\n{\n $query = $this->db->query(\"Select * from $tableName where $fieldName='\".$fieldValue.\"'\");\n $totalRowsUnique = $query->num_rows();\n if($totalRowsUnique > 0)\n {\n return $query->row();\n }\n \n}", "public function extractRow()\n\t{\n \n // extract the row data into a field array\n \n // validate each field\n \n // return field array\n \n }", "function AffectedRows ();", "protected static function afterGetFromDB(&$row){}", "public function value($row) {\n\t\t$value = $row[$this->field];\n\t\tif (is_array($value)) {\n\t\t\t$value = $this->Table->Text->toList($value, __d('ui', 'and', true));\n\t\t}\n\t\tif (!empty($this->options['truncate'])) {\n\t\t\t$value = Sanitize::stripTags($value, 'img', 'object', 'embed', 'div', 'span');\n\t\t\t$value = $this->Table->Text->truncate($value, $this->options['truncate'], array('html' => true));\n\t\t}\n\t\treturn $value;\n\t}", "public function hasRowContents(){\n return $this->_has(1);\n }", "public function getRow(): int\n {\n return $this->row;\n }", "public function single_row_columns($item)\n {\n }", "public function fetchSingleRow($result){\r\n\t\t\r\n\t\t$row = mysqli_fetch_assoc($result);\r\n\t\treturn $row;\r\n\t}", "public function getCellValue($row);", "public function fetch_row()\n {\n return $this->fetch_assoc();\n }", "function setRowDatas(&$row) {\r\n\t\t/* for optimization reason, do not save row. save just needed parameters */\r\n\r\n\t\t//$this->_specific_data\t= isset($row->specific) ? $row->specific : '';\r\n\t}", "public function readone(){\r\t\t\t$query=\"select * from `\".$this->tablename.\"` where `id`='\".$this->id.\"'\";\r\t\t\t$result=mysqli_query($this->conn,$query);\r\t\t\t$value=mysqli_fetch_row($result);\r\t\t\treturn $value;\r\t\t}", "public function getRow()\n {\n return isset($this->row) ? $this->row : null;\n }", "function single() {\n $this->Record = mysqli_fetch_array($this->result, MYSQLI_ASSOC);\n $this->rs = $this->Record;\n $stat = is_array($this->Record);\n return $stat;\n }", "function db_getone($sql, $index){\n\t\t$row = $this->db->query($sql)->row_array();\n\t\tif(!empty($row[$index])){\n\t\t\treturn $row[$index];\n\t\t}\n\t}", "public function nextRowset()\n {\n }", "private\tfunction\t_fetch($row)\n\t\t{\n\t\t\t$record\t=\t$this->_database->getTable($this->_name);\n\t\t\t$record->fill(array_combine(\n\t\t\t\tarray_keys($this->_values),\n\t\t\t\tarray_splice($row, 0, sizeof($this->_values))\n\t\t\t));\n\t\t\tforeach($this->_relations as $relation) {\n\t\t\t\t$relation['record']->fill(array_combine(\n\t\t\t\t\tarray_keys($relation['record']->_values),\n\t\t\t\t\tarray_splice($row, 0, sizeof($relation['record']->_values))\n\t\t\t\t));\n\t\t\t}\n\t\t\treturn\t$record;\n\t\t}", "private\tfunction\t_fetch($row)\n\t\t{\n\t\t\t$record\t=\t$this->_database->getTable($this->_name);\n\t\t\t$record->fill(array_combine(\n\t\t\t\tarray_keys($this->_values),\n\t\t\t\tarray_splice($row, 0, sizeof($this->_values))\n\t\t\t));\n\t\t\tforeach($this->_relations as $relation) {\n\t\t\t\t$relation['record']->fill(array_combine(\n\t\t\t\t\tarray_keys($relation['record']->_values),\n\t\t\t\t\tarray_splice($row, 0, sizeof($relation['record']->_values))\n\t\t\t\t));\n\t\t\t}\n\t\t\treturn\t$record;\n\t\t}", "public function lastRow() {\n\t}", "public function startRow(): int \n {\n return 2;\n }" ]
[ "0.71008414", "0.70596224", "0.6890322", "0.6871844", "0.6864976", "0.68287516", "0.6794041", "0.6657927", "0.6637314", "0.6544214", "0.6544214", "0.64690065", "0.6467964", "0.6442221", "0.638338", "0.6354601", "0.63239145", "0.6264248", "0.6212573", "0.6116043", "0.61150587", "0.6097786", "0.60747194", "0.60747194", "0.6072744", "0.6069148", "0.6066779", "0.6065048", "0.60510224", "0.6032592", "0.60169214", "0.60124576", "0.6001163", "0.5991636", "0.59811985", "0.59698594", "0.59565943", "0.59450805", "0.5934841", "0.59290594", "0.59246737", "0.59150773", "0.59033906", "0.59025896", "0.5900862", "0.5893185", "0.58893585", "0.58893585", "0.58763033", "0.5867117", "0.5866341", "0.58560747", "0.5849757", "0.58459896", "0.58408594", "0.58393687", "0.5828902", "0.58251756", "0.5822564", "0.582195", "0.5811104", "0.5802934", "0.57928944", "0.5789499", "0.57842696", "0.574851", "0.5747408", "0.5746897", "0.57458884", "0.5739465", "0.5731985", "0.57282513", "0.5725967", "0.5718498", "0.5714456", "0.57063794", "0.5699811", "0.56898737", "0.56882054", "0.5679793", "0.5674743", "0.5669287", "0.56614923", "0.5627544", "0.56270325", "0.562489", "0.56240416", "0.56215906", "0.56159395", "0.56156325", "0.56148046", "0.56119096", "0.5610307", "0.56098425", "0.5608875", "0.56080943", "0.5605591", "0.5604166", "0.5604166", "0.5601185", "0.5596263" ]
0.0
-1
Get QuestString value with default value if querystring is not set
function GetQueryString($name, $default="") { return ValidRequiredQueryString($name) ? $_GET[$name] : $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_query_var($query_var, $default_value = '')\n {\n }", "public function get($query_var, $default_value = '')\n {\n }", "function get_query_str_value($name) {\n\n return (array_key_exists($name, $_GET) ? $_GET[$name] : null);\n}", "public function query_string($default = '', $xss_clean = null)\n\t{\n\t\t$query_string = $this->server('QUERY_STRING', $xss_clean);\n\t\treturn ($query_string) ? $query_string : $default;\n\t}", "function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}", "private function parseQueryString()\n {\n $queryString = isset($_GET['q']) ? $_GET['q'] : false;\n return $queryString;\n }", "public function get_query_arg( $name ) {\n\t\tglobal $taxnow, $typenow;\n\t\t$value = '';\n\t\t$url_args = wp_parse_args( wp_parse_url( wp_get_referer(), PHP_URL_QUERY ) );\n\t\t// Get the value of an arbitrary post argument.\n\t\t// @todo We are suppressing the need for a nonce check, which means this whole thing likely needs a rewrite.\n\t\t$post_arg_val = ! empty( $_POST[ $name ] ) ? sanitize_text_field( wp_unslash( $_POST[ $name ] ) ) : null; // @codingStandardsIgnoreLine\n\n\t\tswitch ( true ) {\n\t\t\tcase ( ! empty( get_query_var( $name ) ) ):\n\t\t\t\t$value = get_query_var( $name );\n\t\t\t\tbreak;\n\t\t\t// If the query arg isn't set. Check POST and GET requests.\n\t\t\tcase ( ! empty( $post_arg_val ) ):\n\t\t\t\t// Verify nonce here.\n\t\t\t\t$value = $post_arg_val;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $_GET[ $name ] ) ):\n\t\t\t\t$value = sanitize_text_field( wp_unslash( $_GET[ $name ] ) );\n\t\t\t\tbreak;\n\t\t\tcase ( 'post_type' === $name && ! empty( $typenow ) ):\n\t\t\t\t$value = $typenow;\n\t\t\t\tbreak;\n\t\t\tcase ( 'taxonomy' === $name && ! empty( $taxnow ) ):\n\t\t\t\t$value = $taxnow;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $url_args[ $name ] ) ):\n\t\t\t\t$value = $url_args[ $name ];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$value = '';\n\t\t}\n\t\treturn $value;\n\t}", "function getVal( $name, $default = '' ) {\r\n\t\t\r\n\t\tif( isset( $_REQUEST[$name] ) ) return $this->unquote( $_REQUEST[$name] );\r\n\t\telse return $this->unquote( $default );\r\n\t}", "public function getQueryParam($key, $default = null) {\r\n\t\tif (isset($_GET[$key])) {\r\n\t\t\treturn $_GET[$key];\r\n\t\t}\r\n\t\treturn $default;\r\n\t}", "function getUrlStringValue($urlStringName, $returnIfNotSet) {\n if(isset($_GET[$urlStringName]) && $_GET[$urlStringName] != \"\")\n return $_GET[$urlStringName];\n else\n return $returnIfNotSet;\n}", "public function getQuery($name = null, $default = null)\n {\n return !$name ? $_GET : (isset($_GET[$name]) ? $_GET[$name] : $default);\n }", "function GetVar($name, $default_value = false) {\r\n if (!isset($_GET)) {\r\n return false;\r\n }\r\n if (isset($_GET[$name])) {\r\n if (!get_magic_quotes_gpc()) {\r\n return InjectSlashes($_GET[$name]);\r\n }\r\n return $_GET[$name];\r\n }\r\n return $default_value;\r\n}", "protected function getValue($name, $default='')\r\n {\r\n if (isset($_GET[$name])) {\r\n return $_GET[$name];\r\n } else {\r\n return $default;\r\n }\r\n }", "public function loadDefaultQueryString()\n\t{\n\t\tif (!$this->isDefaultQueryStringEnabled())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($this->queryString))\n\t\t{\n\t\t\tparse_str($_SERVER['QUERY_STRING'], $this->queryString);\n\t\t\tunset($this->queryString['start']);\n\n\t\t\t$this->queryString = http_build_query($this->queryString);\n\n\t\t\tif ($this->queryString)\n\t\t\t{\n\t\t\t\t$this->queryString = '?' . $this->queryString;\t\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function queryparam_GET($key, $default_value = null) {\n\treturn common_param_GET($_GET, $key, $default_value);\n}", "public function getStringForDefault($string);", "public function getQueryString()\n {\n $queryString = static::normaliseQueryString($_SERVER['QUERY_STRING']);\n\n return '' === $queryString ? null : $queryString;\n }", "function _get($str)\n{\n $val = !empty($_GET[$str]) ? $_GET[$str] : null;\n return $val;\n}", "function sa_dev_qstring($arg=null,$value=null,$qstring=null){\n // null value removes arg from querystring\n $query_string = array();\n if($qstring==null) $qstring = $_SERVER['QUERY_STRING'];\n parse_str($qstring, $query_string); \n if(!empty($arg)) $query_string[$arg] = $value;\n $new_str = http_build_query($query_string,'','&amp;');\n return $new_str;\n}", "public function get_param($str, $default = null){\n\t\tif(isset($_GET[$str]))\n\t\t{\n\t\t\treturn $_GET[$str];\n\t\t}else if(isset($_POST[$str]))\n\t\t{\n\t\t\treturn $_POST[$str];\n\t\t}{\n\t\t\treturn $default;\n\t\t}\n\t}", "public function getQueryString():string;", "public function getQuery($key = null, $default = null)\n {\n if (null === $key) {\n return $_GET;\n }\n\n return (isset($_GET[$key])) ? $_GET[$key] : $default;\n }", "function RequestVar($name, $default_value = true) {\r\n if (!isset($_REQUEST))\r\n return false;\r\n if (isset($_REQUEST[$name])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_REQUEST[$name]);\r\n return $_REQUEST[$name];\r\n }\r\n return $default_value;\r\n}", "protected function getQuery($name, $default = null)\n {\n return Yii::app()->getRequest()->getQuery($name, $default);\n }", "function queryparam_fetch($key, $default_value = null) {\n\t// check GET first\n\t$val = common_param_GET($_GET, $key, $default_value);\n\tif ($val != $default_value) {\n\t\tif ( is_string($val) )\n\t\t\t$val = urldecode($val);\n\t\treturn $val;\n\t}\n\n\t// next, try POST (with form encode)\n\t$val = common_param_GET($_POST, $key, $default_value);\n\tif ($val != $default_value)\n\t\treturn $val;\n\n\t// next, try to understand rawinput as a json string\n\n\t// check pre-parsed object\n\tif ( !isset($GLOBALS['phpinput_parsed']) ) {\n\t\t$GLOBALS['phpinput'] = file_get_contents(\"php://input\");\n\t\tif ( $GLOBALS['phpinput'] ) {\n\t\t\t$GLOBALS['phpinput_parsed'] = json_decode($GLOBALS['phpinput'], true);\n\t\t\tif ( $GLOBALS['phpinput_parsed'] ) {\n\t\t\t\telog(\"param is available as: \" . $GLOBALS['phpinput']);\n\t\t\t}\n\t\t}\n\t}\n\n\t// check key in parsed object\n\tif ( isset($GLOBALS['phpinput_parsed']) ) {\n\t\tif ( isset($GLOBALS['phpinput_parsed'][$key]) ) {\n\t\t\t$val = $GLOBALS['phpinput_parsed'][$key];\n\t\t\tif ($val != $default_value)\n\t\t\t\treturn $val;\n\t\t}\n\t}\n\n\treturn $default_value;\n}", "public static function setQueryString(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$queryString = substr(static::$fullUrl, strpos(static::$fullUrl, '?') + 1, strlen(static::$fullUrl));\n\t\t} else {\n\t\t\tstatic::$queryString = '';\n\t\t}\n\n\t}", "public function getQuery() {\n $query = $this->getArgument(self::QUERY_NAME, '');\n if ($query) {\n// $query = str_replace(Url::getBaseUrl(), '', $query);\n $query = str_replace('?' . self::QUERY_NAME . '=', '', $query);\n $query = ltrim($query, Request::QUERY_SEPARATOR);\n $query = rtrim($query, Request::QUERY_SEPARATOR);\n }\n\n return $query;\n }", "public function getQueryString() {\n\t\t\n\t}", "private static function getUrlQueryString() {\n // The variable $_SERVER['QUERY_STRING'] is set by the server and can differ, e.g. it might hold additional\n // parameters or it might be empty (nginx).\n\n if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING'])) {\n $query = $_SERVER['QUERY_STRING'];\n }\n else {\n $query = strRightFrom($_SERVER['REQUEST_URI'], '?');\n }\n return $query;\n }", "public function getQueryString()\n {\n return isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';\n }", "abstract protected function queryString(): string;", "public static function queryString(): string\n\t{\n\t\treturn static::$queryString;\n\t}", "function either_param_string($name, $default = false)\n{\n $ret = __param(array_merge($_POST, $_GET), $name, $default);\n if ($ret === null) {\n return null;\n }\n\n if ($ret === $default) {\n if ($default === null) {\n return null;\n }\n\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret, true);\n\n return $ret;\n}", "function getOrDefault($var, $default) {\n return (isset($_GET[$var])) ? $_GET[$var] : $default;\n}", "private function get_query_string()\n {\n $query_string = '';\n foreach (explode('&', $_SERVER['QUERY_STRING']) as $key)\n {\n if( !preg_match('/org_openpsa_qbpager/', $key)\n && $key != '')\n {\n $query_string .= '&amp;'.$key;\n }\n }\n return $query_string;\n }", "protected function get_url_query(): string {\n if ($this->has_params()) {\n return $this->get_params_as_query();\n }\n return '';\n }", "public function getQueryString()\n {\n return $this->query_string;\n }", "function getPostVal ($stringName, $autoDefault) {\r\n\t\treturn ((isset($_POST[$stringName])) ? $_POST[$stringName] : $autoDefault);\r\n\t}", "public function param($queryParam, $default = null) {\n return $this->getRequest()->get($queryParam,$default);\n }", "function get_form_field_value($field, $default_value = null) {\n if (!empty($_REQUEST[$field])) {\n return $_REQUEST[$field];\n } else {\n return $default_value;\n }\n}", "public static function getParameter($name,$default=null) {\n\t if(isset($_REQUEST[$name])) {\n\t $value = $_REQUEST[$name];\n\t return Str::trimAll($value);\n\t }\n\t return $default;\n\t}", "public function getQueryString()\n {\n return parse_str($this->partials['query']);\n }", "public function queryString($str=null)\n {\n if (!is_null($str)) {\n $this->_array[\"query_string\"] = $str;\n }\n\n return $this->_array[\"query_string\"];\n }", "function _get_param($key, $default_value = '')\n\t\t{\n\t\t\t$val = $this->EE->TMPL->fetch_param($key);\n\n\t\t\tif($val == '') {\n\t\t\t\treturn $default_value;\n\t\t\t}\n\t\t\treturn $val;\n\t\t}", "function get_param($key, $default_value = '')\n\t{\n\t\t$val = ee()->TMPL->fetch_param($key);\n\t\t\n\t\tif($val == '') \n\t\t\treturn $default_value;\n\t\telse\n\t\t\treturn $val;\n\t}", "function _getn($v) {\r\n $r = isset($_GET[$v]) ? bwm_clean($_GET[$v]) : '';\r\n return $r == '' ? NULL : $r;\r\n}", "public function get_param(string $key,?string $default=null):?string{\n\t return $this->get_params[$key] ?? $default;\n\t}", "public function getQueryText()\n\t{\n\t\tif (empty($this->queryText)) {\n\t\t\t$this->queryText = $this->getParam('q');\n\t\t}\n\t\t$queryText = str_replace(':', '', $this->queryText);\n\t\treturn $queryText;\n\t}", "public function get_corrected_query_string() {\n\t\treturn '';\n\t}", "public static function get($key, $default = \"\") {\n return(isset($_GET[$key]) ? $_GET[$key] : $default);\n }", "public static function g($value = '', $default = '')\n {\n return isset($_GET[$value]) ? $_GET[$value] : $default;\n }", "function kalium_vc_loop_param_set_default_value( &$query, $field, $value = '' ) {\n\tif ( ! preg_match( '/(\\|?)' . preg_quote( $field ) . ':/', $query ) ) {\n\t\t$query .= \"|{$field}:{$value}\";\n\t}\n\n\treturn ltrim( '|', $query );\n}", "public static function GET($key, $default = '') {\n if (isset($_GET[$key])) {\n return $_GET[$key];\n }\n return $default;\n }", "private function setQueryString ($string) {\n\t\tif (empty (trim ($string))) {\n\t\t\treturn ('Command requires argument in the form of a query. E.G. /anime black lagoon');\n\t\t}\n\t\t\n\t\t$this->api_url = 'http://api.jikan.me/search/anime/'.urlencode ($string).'/1';\n\t}", "function _getParameter( $name, $default='' ) {\n\t\t$return = \"\";\n\t\t$return = $this->params->get( $name, $default );\n\t\treturn $return;\n\t}", "public function get_query_var(string $name)\n {\n }", "public function queryParam(string $name, $default = null)\n {\n return $this->request->getQueryParams()[$name] ?? $default;\n }", "private function retrieve_searchphrase() {\n\t\t$replacement = null;\n\n\t\tif ( ! isset( $replacement ) ) {\n\t\t\t$search = get_query_var( 's' );\n\t\t\tif ( $search !== '' ) {\n\t\t\t\t$replacement = esc_html( $search );\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public static function get_input_value($id, $default = NULL) {\n global $TFUSE;\n return ( $TFUSE->request->isset_GET($id) ? $TFUSE->request->GET($id) : $default );\n }", "function get_form_val($key, $default='', $getfirst=TRUE)\r\n{\r\n if ($getfirst)\r\n {\r\n return (empty($_GET[$key]) ? (empty($_POST[$key]) ? $default : $_POST[$key]) : $_GET[$key]);\r\n }\r\n else\r\n {\r\n return (empty($_POST[$key]) ? (empty($_GET[$key]) ? $default : $_GET[$key]) : $_POST[$key]);\r\n }\r\n}", "function r($param, $default = null) {\n if (!empty($_REQUEST[$param]))\n return is_array($_REQUEST[$param]) ? $_REQUEST[$param] : trim($_REQUEST[$param]);\n return $default;\n}", "function getUserFromForm()\n {\n $string= \"default\";\n\n if (isset($_POST['Parametro']))\n $string=$_POST['Parametro'];\n\n return $string;\n }", "public function queryString() : string;", "private function getMainQueryString() {\n\t\treturn $this->getQueryStringUsingGenreString(self::genresToQString($this->genres));\n\t}", "function inputGet($key, $default = \"\")\n{\n\tif(inputHas($key)) {\n\t\treturn $_REQUEST[$key];\n\t} else {\n\t\treturn $default;\n\t}\n}", "public function initURLQueryStringName($value) \n {\n $this->urlQueryStringName = $value;\n return;\n }", "function getQueryParm($parm) { // not working too good!\n $return = \"\";\n $uri = parse_url(rawurldecode($_SERVER['REQUEST_URI']));\n if (isset($uri['query'])) {\n $query = $uri['query'];\n if ($parm) {\n $pos = $this->stripos($query, $parm . \"=\");\n if ($pos)\n $return = substr($query, $pos + strlen($parm) + 1);\n }\n }\n return $return;\n }", "function getCorrectedQueryString() {\n\t\tif (io::strpos($this->_correctedQueryString, ' language:'.$this->_language) !== false) {\n\t\t\treturn io::htmlspecialchars(str_replace(' language:'.$this->_language, '', $this->_correctedQueryString)); \n\t\t}\n\t\treturn io::htmlspecialchars($this->_correctedQueryString);\n\t}", "function get_param_string($name, $default = false, $no_security = false)\n{\n $ret = __param($_GET, $name, $default);\n if (($ret === '') && (isset($_GET['require__' . $name])) && ($default !== $ret) && ($_GET['require__' . $name] !== '0')) {\n // We didn't give some required input\n set_http_status_code('400');\n warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN'));\n }\n\n if ($ret === $default) {\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret);\n\n if ($ret === false) { // Should not happen, but have seen in the wild via malicious bots sending corrupt URLs\n $ret = $default;\n }\n\n return $ret;\n}", "function existingQueryForm () { return \"\"; }", "public function getSearchParam() {\n\t\treturn Arr::get($this->params, 'q', '');\n\t}", "public static function get($name, $default = null)\r\n {\r\n // checking if the $_REQUEST is set\r\n if(isset($_REQUEST[$name]))\r\n {\r\n return $_REQUEST[$name]; // return the value from $_GET\r\n }\r\n else\r\n {\r\n return $default; // return the default value\r\n }\r\n }", "public function queryString() {\n return $_SERVER['QUERY_STRING'];\n }", "function getGetParam($name,$def=null) {\n\treturn htmlentities(isset($_GET[$name]) ? $_GET[$name] : $def,ENT_QUOTES);\n\t\t\n}", "private function processQueryString()\n {\n // store the query string local, so we don't alter it.\n $queryString = trim($this->request->getPathInfo(), '/');\n\n // split into chunks\n $chunks = (array) explode('/', $queryString);\n\n $hasMultiLanguages = $this->getContainer()->getParameter('site.multilanguage');\n\n // single language\n if (!$hasMultiLanguages) {\n // set language id\n $language = $this->get('fork.settings')->get('Core', 'default_language', SITE_DEFAULT_LANGUAGE);\n } else {\n // multiple languages\n // default value\n $mustRedirect = false;\n\n // get possible languages\n $possibleLanguages = (array) Language::getActiveLanguages();\n $redirectLanguages = (array) Language::getRedirectLanguages();\n\n // the language is present in the URL\n if (isset($chunks[0]) && in_array($chunks[0], $possibleLanguages)) {\n // define language\n $language = (string) $chunks[0];\n\n // try to set a cookie with the language\n try {\n // set cookie\n CommonCookie::set('frontend_language', $language);\n } catch (\\SpoonCookieException $e) {\n // settings cookies isn't allowed, because this isn't a real problem we ignore the exception\n }\n\n // set sessions\n \\SpoonSession::set('frontend_language', $language);\n\n // remove the language part\n array_shift($chunks);\n } elseif (CommonCookie::exists('frontend_language') &&\n in_array(CommonCookie::get('frontend_language'), $redirectLanguages)\n ) {\n // set languageId\n $language = (string) CommonCookie::get('frontend_language');\n\n // redirect is needed\n $mustRedirect = true;\n } else {\n // default browser language\n // set languageId & abbreviation\n $language = Language::getBrowserLanguage();\n\n // try to set a cookie with the language\n try {\n // set cookie\n CommonCookie::set('frontend_language', $language);\n } catch (\\SpoonCookieException $e) {\n // settings cookies isn't allowed, because this isn't a real problem we ignore the exception\n }\n\n // redirect is needed\n $mustRedirect = true;\n }\n\n // redirect is required\n if ($mustRedirect) {\n // build URL\n // trim the first / from the query string to prevent double slashes\n $url = rtrim('/' . $language . '/' . trim($this->getQueryString(), '/'), '/');\n // when we are just adding the language to the domain, it's a temporary redirect because\n // Safari keeps the 301 in cache, so the cookie to switch language doesn't work any more\n $redirectCode = ($url == '/' . $language ? 302 : 301);\n\n // set header & redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse($url, $redirectCode)\n );\n }\n }\n\n // define the language\n defined('FRONTEND_LANGUAGE') || define('FRONTEND_LANGUAGE', $language);\n defined('LANGUAGE') || define('LANGUAGE', $language);\n\n // sets the locale file\n Language::setLocale($language);\n\n // list of pageIds & their full URL\n $keys = Navigation::getKeys();\n\n // rebuild our URL, but without the language parameter. (it's tripped earlier)\n $url = implode('/', $chunks);\n $startURL = $url;\n\n // loop until we find the URL in the list of pages\n while (!in_array($url, $keys)) {\n // remove the last chunk\n array_pop($chunks);\n\n // redefine the URL\n $url = implode('/', $chunks);\n }\n\n // remove language from query string\n if ($hasMultiLanguages) {\n $queryString = trim(mb_substr($queryString, mb_strlen($language)), '/');\n }\n\n // if it's the homepage AND parameters were given (not allowed!)\n if ($url == '' && $queryString != '') {\n // get 404 URL\n $url = Navigation::getURL(404);\n\n // remove language\n if ($hasMultiLanguages) {\n $url = str_replace('/' . $language, '', $url);\n }\n }\n\n // set pages\n $url = trim($url, '/');\n\n // currently not in the homepage\n if ($url != '') {\n // explode in pages\n $pages = explode('/', $url);\n\n // reset pages\n $this->setPages($pages);\n\n // reset parameters\n $this->setParameters(array());\n }\n\n // set parameters\n $parameters = trim(mb_substr($startURL, mb_strlen($url)), '/');\n\n // has at least one parameter\n if ($parameters != '') {\n // parameters will be separated by /\n $parameters = explode('/', $parameters);\n\n // set parameters\n $this->setParameters($parameters);\n }\n\n // pageId, parentId & depth\n $pageId = Navigation::getPageId(implode('/', $this->getPages()));\n $pageInfo = Navigation::getPageInfo($pageId);\n\n // invalid page, or parameters but no extra\n if ($pageInfo === false || (!empty($parameters) && !$pageInfo['has_extra'])) {\n // get 404 URL\n $url = Navigation::getURL(404);\n\n // remove language\n if ($hasMultiLanguages) {\n $url = str_replace('/' . $language, '', $url);\n }\n\n // remove the first slash\n $url = trim($url, '/');\n\n // currently not in the homepage\n if ($url != '') {\n // explode in pages\n $pages = explode('/', $url);\n\n // reset pages\n $this->setPages($pages);\n\n // reset parameters\n $this->setParameters(array());\n }\n }\n\n // is this an internal redirect?\n if (isset($pageInfo['redirect_page_id']) && $pageInfo['redirect_page_id'] != '') {\n // get url for item\n $newPageURL = Navigation::getURL((int) $pageInfo['redirect_page_id']);\n $errorURL = Navigation::getURL(404);\n\n // not an error?\n if ($newPageURL != $errorURL) {\n // redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse(\n $newPageURL,\n $pageInfo['redirect_code']\n )\n );\n }\n }\n\n // is this an external redirect?\n if (isset($pageInfo['redirect_url']) && $pageInfo['redirect_url'] != '') {\n // redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse(\n $pageInfo['redirect_url'],\n $pageInfo['redirect_code']\n )\n );\n }\n }", "private function _getQueryStringPath()\n\t{\n\t\t$pathParam = craft()->urlManager->pathParam;\n\t\treturn trim($this->getQuery($pathParam, ''), '/');\n\t}", "public function query($name = null, $default = null) {\n return $this->request->query($name, $default);\n }", "function GetRequest (&$r, $var, $default = null) {\n\tif (isset($r[$var])) {\n\t\t$val = $r[$var];\n\n\t\t// Deal with special chars in parameters\n\t\t// magic_quotes_gpc is deprecated from php 5.4.0\n\t\tif (version_compare(PHP_VERSION, '5.4.0', '>=')\n\t\t\t|| !get_magic_quotes_gpc())\n\t\t\t$val = AddslashesRecursive($val);\n\t}\n\telse\n\t\t$val = $default;\n\treturn $val;\n}", "public function getQueryAsString();", "public function getValue(): ?string;", "function get($name = null, $default = null)\n {\n if ($name === null) {\n return Request::query();\n }\n\n /*\n * Array field name, eg: field[key][key2][key3]\n */\n if (class_exists('October\\Rain\\Html\\Helper')) {\n $name = implode('.', October\\Rain\\Html\\Helper::nameToArray($name));\n }\n\n return array_get(Request::query(), $name, $default);\n }", "protected function get_search_value() {\n\t\t\tif ( 'off' === WPDA::get_option( WPDA::OPTION_BE_REMEMBER_SEARCH ) ) {\n\t\t\t\tif ( isset( $_REQUEST[ $this->search_item_name ] ) ) {\n\t\t\t\t\treturn sanitize_text_field( wp_unslash( $_REQUEST[ $this->search_item_name ] ) ); // input var okay.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$cookie_name = $this->page . '_search_' . str_replace( '.', '_', $this->table_name );\n\t\t\tif ( isset( $_REQUEST[ $this->search_item_name ] ) && '' !== $_REQUEST[ $this->search_item_name ] ) { // input var okay.\n\t\t\t\treturn sanitize_text_field( wp_unslash( $_REQUEST[ $this->search_item_name ] ) ); // input var okay.\n\t\t\t} elseif ( isset( $_COOKIE[ $cookie_name ] ) ) {\n\t\t\t\treturn $_COOKIE[ $cookie_name ];\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "public function\n\tGetQueryVar($Key):\n\t?String {\n\n\t\t// if we have that data give it.\n\t\tif(array_key_exists($Key,$this->Query))\n\t\treturn (String)$this->Query[$Key];\n\n\t\t// else nope.\n\t\treturn NULL;\n\t}", "function get_url_param( $variable, $default='' )\n {\n return !empty( $_GET[ $variable ] )?$_GET[ $variable ]:$default;\n }", "public function getQueryString()\n {\n return $this->getRequest()->getQueryString();\n }", "private function getQueryString() : string\n {\n return http_build_query($this->parameters);\n }", "public function getQueryString()\n\t{\n\t\treturn $this->queryString;\n\t}", "private function getQueryString()\n {\n return \\apply_filters('swiftype_search_query_string', stripslashes(\\get_search_query(false)));;\n }", "function safe_retrieve_gp($varname, $default='', $null_is_default=false) {\n if ( is_array($_REQUEST) && \n array_key_exists($varname, $_REQUEST) &&\n ( ($_REQUEST[$varname] != null) || (!$null_is_default) ) ) \n return $_REQUEST[$varname];\n return $default;\n}", "public function getSwitchParamValue(): ?string\n {\n if (!$this->request) {\n return null;\n }\n\n return $this->request->query->get($this->switchParam, self::VIEW_FULL);\n }", "function qa_get($field)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn isset($_GET[$field]) ? qa_gpc_to_string($_GET[$field]) : null;\n}", "public function getQuery(string $key = null, $filters = null, $defaultValue = null, bool $allowEmpty = true) {}", "public static function getUrlQ()\n {\n if (!isset($_GET['urlq']))\n {\n return BaseConfig::HOME_URL;\n }\n $url = $_GET['urlq'];\n $curl = rtrim(ltrim($url, \"/\"), \"/\");\n return (isset($curl) && valid($curl)) ? $curl : BaseConfig::HOME_URL;\n }", "function _fetch_uri_string()\n\t{\n\t\tif (strtoupper($this->config->item('uri_protocol')) == 'AUTO')\n\t\t{\n\t\t\t// If the URL has a question mark then it's simplest to just\n\t\t\t// build the URI string from the zero index of the $_GET array.\n\t\t\t// This avoids having to deal with $_SERVER variables, which\n\t\t\t// can be unreliable in some environments\n\t\t\tif (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '')\n\t\t\t{\n\t\t\t\t$this->uri_string = key($_GET);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Is there a PATH_INFO variable?\n\t\t\t// Note: some servers seem to have trouble with getenv() so we'll test it two ways\n\t\t\t$path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');\n\t\t\tif (trim($path, '/') != '' && $path != \"/\".SELF)\n\t\t\t{\n\t\t\t\t$this->uri_string = $path;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// No PATH_INFO?... What about QUERY_STRING?\n\t\t\t$path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING');\n\t\t\tif (trim($path, '/') != '')\n\t\t\t{\n\t\t\t\t$this->uri_string = $path;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists?\n\t\t\t$path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO');\n\t\t\tif (trim($path, '/') != '' && $path != \"/\".SELF)\n\t\t\t{\n\t\t\t\t// remove path and script information so we have good URI data\n\t\t\t\t$this->uri_string = str_replace($_SERVER['SCRIPT_NAME'], '', $path);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We've exhausted all our options...\n\t\t\t$this->uri_string = '';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$uri = strtoupper($this->config->item('uri_protocol'));\n\n\t\t\tif ($uri == 'REQUEST_URI')\n\t\t\t{\n\t\t\t\t$this->uri_string = $this->_parse_request_uri();\n\t\t\t\treturn;\n\t\t\t}\n\n elseif($uri == 'PATH_INFO'){\n if(@getenv($uri)){\n $this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri);\n }else{\n $this->uri_string = $this->_parse_pathinfo_uri();\n }\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri);\n\t\t}\n\n\t\t// If the URI contains only a slash we'll kill it\n\t\tif ($this->uri_string == '/')\n\t\t{\n\t\t\t$this->uri_string = '';\n\t\t}\n\t}", "public function getQueryStrParams ()\n {\n return $this->getParams(\"string\");\n }", "public function getDefault(): ?string;", "function safeGetVar($varName, $default=null)\n{\n if (isset($_GET[$varName]))\n return $_GET[$varName];\n else\n return $default;\n}", "private function buildQueryString(){\n if(count($this->querystrings) == 0){\n return \"\";\n }\n else{\n $querystring = \"?\";\n\n foreach($this->querystrings as $index => $value){\n if($index > 0){\n $querystring .= \"&\";\n }\n $querystring .= $value;\n }\n\n return $querystring;\n }\n }", "function getGetParam($name,$def=null) {\n if (isset($_GET[$name]))\n return html_entity_decode(htmlentities($_GET[$name],ENT_QUOTES),ENT_NOQUOTES);\n return $def;\n\n }", "function setQueryParameter($value)\r\n {\r\n if(preg_match('[\\S]', $_POST[$value]) || $_POST[$value] != \"\")\r\n return filter_var($_POST[$value], FILTER_SANITIZE_STRING);\r\n else\r\n return \"%\";\r\n }" ]
[ "0.7102541", "0.6804903", "0.67102396", "0.65627486", "0.6550244", "0.6384389", "0.635669", "0.6310451", "0.62901837", "0.62821704", "0.62745273", "0.62443584", "0.6207515", "0.61467254", "0.61238575", "0.6121417", "0.61206925", "0.6101068", "0.6099851", "0.60926443", "0.6090629", "0.6074754", "0.6039589", "0.60286164", "0.60134023", "0.6004056", "0.5999925", "0.5996667", "0.59916615", "0.5991589", "0.59745574", "0.5970182", "0.5966497", "0.59341973", "0.5929651", "0.5927046", "0.59208286", "0.5898945", "0.5896694", "0.58902836", "0.58880204", "0.5869684", "0.5863114", "0.58491516", "0.5843478", "0.5818967", "0.581721", "0.5815704", "0.57909447", "0.57801867", "0.57622445", "0.5751629", "0.5747442", "0.57365805", "0.5733331", "0.5725136", "0.57139623", "0.56995845", "0.56868184", "0.568607", "0.567624", "0.5674675", "0.56745386", "0.56704193", "0.56494766", "0.564698", "0.56365156", "0.5628576", "0.562266", "0.56215465", "0.5621122", "0.56172967", "0.5608445", "0.5607478", "0.5583763", "0.55772424", "0.5576852", "0.55639374", "0.5559131", "0.5559055", "0.55572367", "0.5557033", "0.5550814", "0.5549271", "0.55489206", "0.5545321", "0.5541079", "0.55370235", "0.55235714", "0.55169415", "0.55137706", "0.5512578", "0.5496489", "0.5493698", "0.5487539", "0.5479724", "0.5477017", "0.54668796", "0.54576063", "0.54535335" ]
0.74760604
0
Check that query string param is not empty
function ValidRequiredQueryString($name) { return isset($_GET[$name]) && $_GET[$name] != ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isEmpty()\n {\n return (!is_array($this->params) || count($this->params) == 0);\n }", "Public static function parametersEmpty(){\n\n throw new \\yii\\web\\HttpException(206, 'Query parameters Should not empty', 405);\n\n\n }", "private function verify_parameters(){\n if( empty( $_GET['email'] ) || empty( $_GET['pms_key'] ) || empty( $_GET['subscription_id'] ) )\n return false;\n\n return true;\n }", "protected function __getPostRemoveEmpty(){\r\n if($this->request->isPost()){\r\n foreach($this->request->getPost() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_POST[$key]);\r\n }\r\n }\r\n }\r\n else{\r\n foreach($this->request->getQuery() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_GET[$key]);\r\n }\r\n }\r\n }\r\n }", "function cpay_CheckGet($params) {\r\n $result = true;\r\n if (!empty($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty($_GET[$eachparam])) {\r\n $result = false;\r\n }\r\n } else {\r\n $result = false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n}", "function required_params()\n {\n $params = func_get_args();\n foreach ($params as $value) {\n if (is_array($value)) {\n if (empty($value)) {\n return false;\n }\n } else {\n if ($value === null || strlen(trim($value)) == 0) {\n return false;\n }\n }\n }\n\n return true;\n }", "public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}", "function check_required_param($param = array(),$method){\n //set up method\n if (strtolower($method) == \"post\"){\n $r = $_POST;\n }else if (strtolower($method) == \"get\"){\n $r = $_GET;\n }\n //check of required param\n foreach ($param as $par){\n if (!isset($r[$par]) || empty($r[$par])){\n return false;\n break;\n }\n }\n return true;\n}", "function check_collection_landing() {\n $keys = array('medium', 'time', 'tag', 'source');\n foreach ($keys as $key) {\n if ('' != get_query_var( $key ) ) {\n return False;\n }\n }\n return True;\n }", "function nvp_CheckGet($params) {\r\n $result=true;\r\n if (!empty ($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty ($_GET[$eachparam])) {\r\n $result=false; \r\n }\r\n } else {\r\n $result=false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n }", "public function req($value)\n {\n return '' != $value || empty($value);\n }", "function cleanQueryString(&$request){\n\tdelParam($request, 'pag');\n\tdelParam($request, 'first');\n\tdelParam($request, 'previous');\n\tdelParam($request, 'next');\n\tdelParam($request, 'last');\n\tdelParam($request, 'reload');\n\tdelParam($request, 'numpags');\n\tdelParam($request, 'regspag');\n}", "function haveEmptyParameters($required_params, $request, $response){\n //initialization false\n $error = false; \n //to get the empty params\n $error_params = '';\n //get all the request params with the current request\n // $request_params = $_REQUEST;\n $request_params = $request->getParsedBody();\n\n // loop through params\n foreach($required_params as $param){\n // check the parameter is empty or parameter length is zero\n // !isset checks whether the parameter is empty\n if (!isset($request_params[$param]) || strlen($request_params[$param]) <= 0){\n # code...\n $error = true;\n // concatenate the parameter in error_params\n $error_params .= $param . ', ';\n }\n }\n\n if ($error) {\n # code...\n $error_detail = array();\n $error_detail['error'] = true;\n $error_detail['message'] = 'Required parameters ' . substr($error_params, 0, -2) . ' are missing or empty';\n // use the $response object to return the response\n // encode the error_detail in json format\n $response->write(json_encode($error_detail));\n }\n return $error;\n}", "public function requireNotNullOrEmpty($key)\n {\n\n $value = $this->getParam($key);\n if(is_null($value) || (is_string($value) && trim($value) == '')){\n throw new InvalidParameterException($key, $value, __FUNCTION__);\n }\n\n return $value;\n }", "public static function isGet()\n {\n return !empty($_GET);\n }", "function _remove_qs_args_if_not_in_url($query_string, array $args_to_check, $url)\n {\n }", "function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}", "function blankCheck() {\n\tfor($i = 0; $i < func_num_args(); $i++) {\n\t\tif (($_POST[func_get_arg($i)] == '') OR ($_POST[func_get_arg($i)] === 0)) {\n\t\t\tresponse(1, '必填项中含有空值');\n\t\t\texit(0);\n\t\t}\n\t}\n}", "public function has_query_params( $url ) {\n\t\t$qpos = strpos( $url, '?' );\n\n\t\tif ( $qpos === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function search(Request $request)\n {\n // if($request->get(\"\"))\n }", "private function hasParams($request)\n {\n preg_match_all($this->regex, $this->uri, $uri_);\n\n if (count($uri_[0]) !== 0) {\n return $this->setParams($request);\n }\n return false;\n }", "public function globalStringConditionMatchesOnEmptyExpressionWithValueSetToEmptyString() {}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}", "public function globalStringConditionMatchesOnEmptyExpressionWithValueSetToEmptyString() {}", "public function get_corrected_query_string() {\n\t\treturn '';\n\t}", "function checkEmpty(){\n\t\tif(!empty($_POST)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function has_url_get_parameters() {\r\n\t\treturn (strlen($this->url_get_parameters) > 3);\r\n\t}", "public function validate_request() {\r\n\t\tif ($this->request != null && sizeof($this->request) != 1)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "function CheckSearchParms() {\r\n\r\n\t\t// Check basic search\r\n\t\tif ($this->BasicSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\treturn FALSE;\r\n\t}", "function condition() {\n\t\treturn ! empty( $_GET['page'] ) && $this->page_slug === $_GET['page']; // Input var okay.\n\t}", "function get_exists($parameter){\n return key_exists($parameter, $_GET) && strlen(trim($_GET[$parameter])) > 0;\n}", "function IsNullOrEmptyString($question){\n return (!isset($question) || trim($question)==='');\n}", "public function checkParams()\n {\n if (!isset($_GET['params'])) {\n die($this->error('404'));\n } else {\n $id = $_GET['params'];\n }\n }", "public function is_empty()\r\n {\r\n if( $this->is_submit() && ($this->taintedInputs->length()=== 0))\r\n return true; \r\n else\r\n return false;\r\n }", "private function parseQueryString()\n {\n $queryString = isset($_GET['q']) ? $_GET['q'] : false;\n return $queryString;\n }", "public function hasParameters()\n {\n return !empty($this->params);\n }", "public function anyRedirect()\n {\n return !empty($_GET['redirect']);\n }", "function hasParam($name)\n {\n return isset($_REQUEST[$name]);\n }", "function checkEmptyField($field) {\n\t return isset($field) && $field !== \"\" && $field !== '';\n }", "function IsNullOrEmptyString($question){\n return (!isset($question) || trim($question)==='');\n }", "function check_for_querystrings() {\r\n\t\t\tif ( isset( $_REQUEST['message'] ) ) {\r\n\t\t\t\tUM()->shortcodes()->message_mode = true;\r\n\t\t\t}\r\n\t\t}", "public function testWithQueryNull()\n {\n $uri = $this->getUriForTest();\n $uri->withQuery(null);\n }", "function condition() {\n\t\treturn ! empty( $_GET['page'] ) && $this->args['page_slug'] === $_GET['page']; // Input var okay.\n\t}", "function not_empty($tableau) {\n\tforeach ($tableau as $champ) {\n\t\tif(empty($_POST[$champ]) || trim($_POST[$champ])==\"\" ){\n\t\t\treturn false;\n\t\t# code.\n\t\t}\n\n\t}\n\treturn true;\n}", "public function testIsEmptyInput()\n {\n $this->assertTrue((new IndexController($this->request, $this->database))->isEmpty(['title', 'goal', 'image', 'summary'], []));\n \n /**\n * Test if input is missing\n */\n $this->assertTrue((new IndexController($this->request, $this->database))->isEmpty(['title', 'goal', 'image', 'summary'], ['title' => 'Petition1', 'goal' => 150, 'summary' => 'Petition Summary']));\n \n /**\n * Test if input is correct\n */\n $this->assertFalse((new IndexController($this->request, $this->database))->isEmpty(['title', 'goal', 'image', 'summary'], ['title' => 'Petition1', 'goal' => 150, 'image' => 'petition.jpg', 'summary' => 'Petition Summary']));\n }", "private static function check_query_uri(&$request_uri, &$route_uri) : bool\n\t{\n\t\t$request = explode('&', $request_uri);\n\t\t$route = self::$RouteURI['VARS']['QUERY'];\n\n\t\tforeach($request as $key => $value)\n\t\t{\n\t\t\t$request[$key] = preg_replace('/=.*$/', '', $value);\n\t\t}\n\n\t\t$_count = 0;\n\t\tforeach($request as $key => $value)\n\t\t{\n\t\t\tforeach($route['REQUIRED'] as $v)\n\t\t\t{\n\t\t\t\tif($value === $v)\n\t\t\t\t{\n\t\t\t\t\tunset($request[$key]);\n\t\t\t\t\t$_count++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($_count !== count($route['REQUIRED']))\n\t\t\treturn false;\n\n\t\tforeach($request as $key => $value)\n\t\t{\n\t\t\tif(array_search($value, $route['OPTIONAL']) === false)\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function GetQueryString($name, $default=\"\") {\n return ValidRequiredQueryString($name) ? $_GET[$name] : $default;\n}", "public static function isGet($var=''){\n\t\tif(empty($var)){\n\t\t\tif(!empty($_GET)){return TRUE;}\n\t\t}\n\t\telse {\n\t\t\t//check if post variable exist and return value otherwise return empty\n\t\t\tif(!empty($_GET[$var])){\n\t\t\t\treturn trim($_GET[$var]);\n\t\t\t}\n\t\t\telseif(isset($_GET[$var])){return '';}\n\t\t}\n\t\treturn FALSE;\n\t}", "function isEmpty($value) {\n return !isset($value) || strlen($value) < 1;\n}", "public function hasSwitchParam(): bool\n {\n return $this->request && $this->request->query->has($this->switchParam);\n }", "private function verifyParams( Array $params ) {\r\n $slot_count = substr_count( $this -> query_string, '?' );\r\n $param_count = count( $params );\r\n return ($slot_count == $param_count) ? true : false;\r\n }", "function search_request_filter($query_vars) {\n if (isset($_GET['s']) && empty($_GET['s'])) {\n $query_vars['s'] = ' ';\n }\n\n return $query_vars;\n}", "protected static function guardIsEmptyQuery($query = null)\n {\n if (empty($query)) {\n throw new \\InvalidArgumentException('Missing or empty parameter : $query');\n }\n }", "private static function isNullOrEmptyString($question){\n return (!isset($question) || trim($question)==='');\n }", "public static function hasData()\n {\n if (Request::METHOD_GET === static::getMethod()) {\n return !empty($_GET);\n }\n\n return 0 < intval(static::getHeader('Content-Length'));\n }", "function has_keep_parameters()\n{\n static $answer = null;\n if ($answer !== null) {\n return $answer;\n }\n\n foreach (array_keys($_GET) as $key) {\n if (\n isset($key[0]) &&\n $key[0] == 'k' &&\n substr($key, 0, 5) == 'keep_'\n //&& $key != 'keep_devtest' && $key != 'keep_show_loading'/*If testing memory use we don't want this to trigger it as it breaks the test*/\n ) {\n $answer = true;\n return $answer;\n }\n }\n $answer = false;\n return $answer;\n}", "private function get_query_string()\n {\n $query_string = '';\n foreach (explode('&', $_SERVER['QUERY_STRING']) as $key)\n {\n if( !preg_match('/org_openpsa_qbpager/', $key)\n && $key != '')\n {\n $query_string .= '&amp;'.$key;\n }\n }\n return $query_string;\n }", "private function validate_query_key()\n {\n if (!isset($this->arrSearch['query'])) {\n throw new DocumentSearchMissingSearch('Missing request \"query\" key!');\n }\n }", "function emr_maybe_remove_query_string( $url ) {\n\t$parts = explode( '?', $url );\n\n\treturn reset( $parts );\n}", "public function hasQuery()\n {\n if (func_num_args() == 0) {\n return !empty($this->query);\n }\n\n foreach (func_get_args() as $key) {\n if (!$this->hasParam($this->query, $key)) {\n return false;\n }\n }\n\n return true;\n }", "private function requestIsValid() : bool\n {\n $queryParams = $this->request->getQueryParams();\n\n return array_has($queryParams,self::OPENID_ASSOC_HANDLE)\n && array_has($queryParams,self::OPENID_SIGNED)\n && array_has($queryParams,self::OPENID_SIG);\n }", "function validateRequest(){\n // if ($_GET['key'] != getenv(\"LAB_NODE_KEY\")){\n // exit;\n // }\n if ($_GET['key'] != ''){\n exit;\n }\n }", "public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}", "public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}", "function fabric_request_filter($query_vars) {\n if (isset($_GET['s']) && empty($_GET['s'])) {\n $query_vars['s'] = ' ';\n }\n\n return $query_vars;\n}", "function isEmpty($str = null){\n if ($str) {\n $cleanstr = trim($str);\n if (strlen($cleanstr)<=0) {\n echo \"input is Empty<br>\";\n return true;\n }else\n return false;\n}}", "function isempty($value){\n if(empty($value)){\n header(\"Location: ..\\Graduate_form.html?error=\");\n }else{\n return $value;\n }\n}", "function exist_param($fieldname){\n return array_key_exists($fieldname, $_REQUEST);\n }", "function checkMandatoryArguments()\n \t{\n \t\tif($this->mStrAdGUID == \"\" || $this->mStrAdGUID == null)\n \t\t\treturn false;\n \t\telse if($this->mStrQuantity == \"\" || $this->mStrQuantity == null)\n \t\t\treturn false;\n \t\telse\n \t\t\treturn true;\n \t}", "private static function exist_required_vars() : bool\n\t{\n\t\tif(count(self::$RouteURI['VARS']['QUERY']['REQUIRED']) > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function hasError()\n {\n return !empty($_GET['error']);\n }", "public function parse_query_vars()\n {\n }", "public function globalStringConditionMatchesEmptyRegularExpression() {}", "public function globalStringConditionMatchesEmptyRegularExpression() {}", "function ValidRequiredPost($name) {\n return isset($_POST[$name]) && $_POST[$name] != \"\";\n}", "function remove_query_arg($key, $query = \\false)\n {\n }", "function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}", "function is_empty()\n {\n }", "public function notempty(&$input, $args)\n {\n $args = $this->getArgs($args);\n if ((strlen($input) > 0) && isset($args['value'])) {\n $input = $args['value'];\n }\n }", "public static function IsQueryString (& $queryStr);", "function required_param($parname, $type=PARAM_CLEAN, $errMsg=\"err_param_requis\") {\n\n // detect_unchecked_vars addition\n global $CFG;\n if (!empty($CFG->detect_unchecked_vars)) {\n global $UNCHECKED_VARS;\n unset ($UNCHECKED_VARS->vars[$parname]);\n }\n\n if (isset($_POST[$parname])) { // POST has precedence\n $param = $_POST[$parname];\n } else if (isset($_GET[$parname])) {\n $param = $_GET[$parname];\n } else {\n erreur_fatale($errMsg,$parname);\n }\n // ne peut pas �tre vide !!! (required)\n $tmpStr= clean_param($param, $type); //PP test final\n // attention \"0\" est empty !!!\n\n if (!empty($tmpStr) || $tmpStr==0) return $tmpStr;\n else erreur_fatale(\"err_param_suspect\",$parname.' '.$param. \" \".__FILE__ );\n\n\n}", "function is_empty ($subject) {\n\t\n\t\treturn !(isset($subject) && !is_null($subject) && ($subject!==''));\n\t\n\t}", "function is_blank( $value ) {\n return !isset( $value ) || trim( $value ) === '';\n}", "public static function searchQueriesExist(){\n \n if (empty($_GET['lookfor']))\n return false;\n \n if ($_GET['lookfor'] === 'qa')\n $arr = ['query', 'fromuser', 'touser', 'timeanswered'];\n else $arr = ['username', 'realname'];\n \n foreach($arr as $curr)\n if (isset($_GET[$curr]) and trim($_GET[$curr]))\n return true;\n \n return false;\n }", "function checkStateSQL($getPara) {\r\n if ($getPara == '') {\r\n return false;\r\n } else\r\n if ($getPara == null) {\r\n return false;\r\n } else\r\n if ($getPara == '0') {\r\n return false;\r\n }\r\n if (EMPTY($getPara)) {\r\n return false;\r\n }\r\n return true;\r\n}", "public function has_query()\n\t{\n\t\treturn ! empty( $this->get_query() );\n\t}", "function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}", "function is_empty($str, $incl_zero = true)\n{\n if (strlen(trim($str)) === 0 || !isset($str)) { // if the string length is 0 or it isn't set\n return true;\n } elseif ($incl_zero === true && empty($str) && $str != '0') { // if the string is empty and not 0, it's empty\n return true;\n } elseif (empty($str)) {\n return true;\n } else {\n return false;\n }\n}", "private function required ($param)\n {\n $v = trim($this->value);\n if ($v === '')\n {\n $this->SetError('required', 'The '.$this->SpacedKey.' field is required');\n return false;\n }\n return true;\n }", "public function reconstruiQueryString($valoresQueryString) {\n\tif (!empty($_SERVER['QUERY_STRING'])) {\n\t $partes = explode(\"&\", $_SERVER['QUERY_STRING']);\n\t #print_r($partes);\n\t $novasPartes = array();\n\t foreach ($partes as $val) {\n\t if (stristr($val, $valoresQueryString) == false) {\n array_push($novasPartes, $val);\n\t\t}\n\t }\n\t if (count($novasPartes) != 0) {\n\t\t $queryString = \"&\".implode(\"&\", $novasPartes);\n\t } else {\n\t\treturn false;\n\t }\n\t return $queryString; // nova string criada\n\t} else {\n return false;\n\t}\n }", "function filled_out($form_vars) {\n foreach ($form_vars as $key => $value) {\n if ((!isset($key)) || ($value == '')) {\n return false;\n }\n }\n return true;\n}", "function is_empty($str, $incl_zero = true)\n{\n if (strlen(trim($str)) === 0 || !isset($str)) { // if the string length is 0 or it isn't set\n return true;\n } elseif ($incl_zero && empty($str) && $str != '0') { // if the string is empty and not 0, it's empty\n return true;\n } elseif (!$incl_zero && empty($str)) {\n return true;\n } else {\n return false;\n }\n}", "public function testMissingParametersEnsureParametersEmptyValues() {\n $parameters = array(\n 'bool' => FALSE,\n 'int' => 0,\n 'float' => 0.0,\n 'string' => '',\n 'array' => array(),\n );\n try {\n $error = FALSE;\n $this->pingdom->ensureParameters($parameters, __method__);\n }\n catch (MissingParameterException $e) {\n $error = TRUE;\n }\n $this->assertFalse($error);\n }", "function hasParam($name) {\n\t\tif (isset($this->getvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (isset($this->postvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "function get_query_str_value($name) {\n\n return (array_key_exists($name, $_GET) ? $_GET[$name] : null);\n}", "public function testIsInvalidEmptyPost() {\n\t\t$this->assertFalse($this->match->validate(array()));\n\t}", "function IsNullOrEmptyString($inputString) {\n return (!isset($inputString) || trim($inputString) == '');\n}", "public function isEmpty()\n {\n return $this->_value === '' || $this->_value === null;\n }" ]
[ "0.67162734", "0.6675367", "0.6554458", "0.6476091", "0.643055", "0.6389102", "0.6387113", "0.6334984", "0.63314694", "0.6294919", "0.6288418", "0.62765974", "0.62431735", "0.6224884", "0.62146294", "0.61709404", "0.61601925", "0.61416894", "0.6111461", "0.6107865", "0.6032028", "0.6031425", "0.6030289", "0.6030289", "0.6030289", "0.60298866", "0.60273135", "0.6019939", "0.6017545", "0.5988705", "0.5987718", "0.5979172", "0.5973636", "0.5972522", "0.5964627", "0.5963662", "0.5955878", "0.59554565", "0.5953155", "0.5950431", "0.5946793", "0.59424114", "0.59416246", "0.5897033", "0.5880371", "0.5873415", "0.5856381", "0.5850813", "0.5848714", "0.58480513", "0.58440036", "0.5841689", "0.5833817", "0.5831214", "0.581856", "0.5817407", "0.58139235", "0.58117783", "0.5801142", "0.57987195", "0.57892287", "0.5778051", "0.57547635", "0.57509637", "0.5745837", "0.5744983", "0.5725634", "0.5718825", "0.57188135", "0.57148945", "0.57069385", "0.5700513", "0.5698137", "0.56924117", "0.56849813", "0.5684525", "0.5681503", "0.56806535", "0.5672764", "0.5670525", "0.5664588", "0.56525636", "0.56421775", "0.5640455", "0.56351715", "0.5621706", "0.56156546", "0.561398", "0.5609039", "0.5602763", "0.5598904", "0.5588838", "0.5587019", "0.5581374", "0.55812925", "0.5568448", "0.55683184", "0.5566676", "0.5566188", "0.55603087" ]
0.77078784
0
Get Post value with default value if querystring is not set
function GetPost($name, $default="") { return ValidRequiredPost($name) ? $_POST[$name] : $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_query_var($query_var, $default_value = '')\n {\n }", "function get_form_val($key, $default='', $getfirst=TRUE)\r\n{\r\n if ($getfirst)\r\n {\r\n return (empty($_GET[$key]) ? (empty($_POST[$key]) ? $default : $_POST[$key]) : $_GET[$key]);\r\n }\r\n else\r\n {\r\n return (empty($_POST[$key]) ? (empty($_GET[$key]) ? $default : $_GET[$key]) : $_POST[$key]);\r\n }\r\n}", "function getPostVal ($stringName, $autoDefault) {\r\n\t\treturn ((isset($_POST[$stringName])) ? $_POST[$stringName] : $autoDefault);\r\n\t}", "function get_form_field_value($field, $default_value = null) {\n if (!empty($_REQUEST[$field])) {\n return $_REQUEST[$field];\n } else {\n return $default_value;\n }\n}", "function queryparam_fetch($key, $default_value = null) {\n\t// check GET first\n\t$val = common_param_GET($_GET, $key, $default_value);\n\tif ($val != $default_value) {\n\t\tif ( is_string($val) )\n\t\t\t$val = urldecode($val);\n\t\treturn $val;\n\t}\n\n\t// next, try POST (with form encode)\n\t$val = common_param_GET($_POST, $key, $default_value);\n\tif ($val != $default_value)\n\t\treturn $val;\n\n\t// next, try to understand rawinput as a json string\n\n\t// check pre-parsed object\n\tif ( !isset($GLOBALS['phpinput_parsed']) ) {\n\t\t$GLOBALS['phpinput'] = file_get_contents(\"php://input\");\n\t\tif ( $GLOBALS['phpinput'] ) {\n\t\t\t$GLOBALS['phpinput_parsed'] = json_decode($GLOBALS['phpinput'], true);\n\t\t\tif ( $GLOBALS['phpinput_parsed'] ) {\n\t\t\t\telog(\"param is available as: \" . $GLOBALS['phpinput']);\n\t\t\t}\n\t\t}\n\t}\n\n\t// check key in parsed object\n\tif ( isset($GLOBALS['phpinput_parsed']) ) {\n\t\tif ( isset($GLOBALS['phpinput_parsed'][$key]) ) {\n\t\t\t$val = $GLOBALS['phpinput_parsed'][$key];\n\t\t\tif ($val != $default_value)\n\t\t\t\treturn $val;\n\t\t}\n\t}\n\n\treturn $default_value;\n}", "function GetQueryString($name, $default=\"\") {\n return ValidRequiredQueryString($name) ? $_GET[$name] : $default;\n}", "function GetPost ($var, $default='') {\n\treturn GetRequest($_POST, $var, $default);\n\t/*\n\tif (isset($_POST[$var]))\n\t\t$val = $_POST[$var];\n\telse\n\t\t$val = $default;\n\treturn $val;\n\t*/\n}", "function getVal( $name, $default = '' ) {\r\n\t\t\r\n\t\tif( isset( $_REQUEST[$name] ) ) return $this->unquote( $_REQUEST[$name] );\r\n\t\telse return $this->unquote( $default );\r\n\t}", "function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}", "protected function getValue($name, $default='')\r\n {\r\n if (isset($_GET[$name])) {\r\n return $_GET[$name];\r\n } else {\r\n return $default;\r\n }\r\n }", "protected function postValue($name, $default='')\r\n {\r\n if (isset($_POST[$name])) {\r\n return $_POST[$name];\r\n } else {\r\n return $default;\r\n }\r\n }", "function get_query_str_value($name) {\n\n return (array_key_exists($name, $_GET) ? $_GET[$name] : null);\n}", "public function get_query_arg( $name ) {\n\t\tglobal $taxnow, $typenow;\n\t\t$value = '';\n\t\t$url_args = wp_parse_args( wp_parse_url( wp_get_referer(), PHP_URL_QUERY ) );\n\t\t// Get the value of an arbitrary post argument.\n\t\t// @todo We are suppressing the need for a nonce check, which means this whole thing likely needs a rewrite.\n\t\t$post_arg_val = ! empty( $_POST[ $name ] ) ? sanitize_text_field( wp_unslash( $_POST[ $name ] ) ) : null; // @codingStandardsIgnoreLine\n\n\t\tswitch ( true ) {\n\t\t\tcase ( ! empty( get_query_var( $name ) ) ):\n\t\t\t\t$value = get_query_var( $name );\n\t\t\t\tbreak;\n\t\t\t// If the query arg isn't set. Check POST and GET requests.\n\t\t\tcase ( ! empty( $post_arg_val ) ):\n\t\t\t\t// Verify nonce here.\n\t\t\t\t$value = $post_arg_val;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $_GET[ $name ] ) ):\n\t\t\t\t$value = sanitize_text_field( wp_unslash( $_GET[ $name ] ) );\n\t\t\t\tbreak;\n\t\t\tcase ( 'post_type' === $name && ! empty( $typenow ) ):\n\t\t\t\t$value = $typenow;\n\t\t\t\tbreak;\n\t\t\tcase ( 'taxonomy' === $name && ! empty( $taxnow ) ):\n\t\t\t\t$value = $taxnow;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $url_args[ $name ] ) ):\n\t\t\t\t$value = $url_args[ $name ];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$value = '';\n\t\t}\n\t\treturn $value;\n\t}", "function getPostValue ( $name ) {\n\tglobal $HTTP_POST_VARS;\n\n\tif ( isset ( $_POST ) && is_array ( $_POST ) && ! empty ( $_POST[$name] ) ) {\n\t\t$HTTP_POST_VARS[$name] = $_POST[$name];\n\t\treturn $_POST[$name];\n\t} else if ( ! isset ( $HTTP_POST_VARS ) ) {\n\t\treturn null;\n\t} else if ( ! isset ( $HTTP_POST_VARS[$name] ) ) {\n\t\treturn null;\n\t}\n\treturn ( $HTTP_POST_VARS[$name] );\n}", "public static function getPostValue($name)\n {\n if (isset($_GET[$name])) return $_GET[$name];\n else if(isset($_POST[$name])) return $_POST[$name];\n else return '';\n }", "function set_value($post, $default=''){\n return @$_POST[$post] ? post($post) : $default;\n }", "function safePostGetVar($varName, $default=null)\n{\n if (isset($_POST[$varName]))\n return $_POST[$varName];\n elseif (isset($_GET[$varName]))\n return $_GET[$varName];\n else\n return $default;\n}", "public function get($query_var, $default_value = '')\n {\n }", "public function getFormParam($key, $default = null) {\r\n\t\tif (isset($_POST[$key])) {\r\n\t\t\treturn $_POST[$key];\r\n\t\t}\r\n\t\treturn $default;\r\n\t}", "public function param($queryParam, $default = null) {\n return $this->getRequest()->get($queryParam,$default);\n }", "function either_param_string($name, $default = false)\n{\n $ret = __param(array_merge($_POST, $_GET), $name, $default);\n if ($ret === null) {\n return null;\n }\n\n if ($ret === $default) {\n if ($default === null) {\n return null;\n }\n\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret, true);\n\n return $ret;\n}", "function post($param, $default = null) {\n static $rawPost;\n if (!empty($_POST[$param]))\n return is_array($_POST[$param]) ? $_POST[$param] : trim($_POST[$param]);\n if (!$rawPost) parse_str(file_get_contents('php://input'), $rawPost);\n if (!empty($rawPost[$param])) {\n return $rawPost[$param];\n }\n return $default;\n}", "function RequestVar($name, $default_value = true) {\r\n if (!isset($_REQUEST))\r\n return false;\r\n if (isset($_REQUEST[$name])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_REQUEST[$name]);\r\n return $_REQUEST[$name];\r\n }\r\n return $default_value;\r\n}", "function get_param($param_name)\n{\n $param_value = \"\";\n if(isset($_POST[$param_name]))\n $param_value = $_POST[$param_name];\n else if(isset($_GET[$param_name]))\n $param_value = $_GET[$param_name];\n\n return $param_value;\n}", "public function post($getParam, $default = \"\")\n {\n $val = $default;\n if (isset($_POST[$getParam])) {\n $val = $_POST[$getParam];\n }\n return $val;\n }", "function GetVar($name, $default_value = false) {\r\n if (!isset($_GET)) {\r\n return false;\r\n }\r\n if (isset($_GET[$name])) {\r\n if (!get_magic_quotes_gpc()) {\r\n return InjectSlashes($_GET[$name]);\r\n }\r\n return $_GET[$name];\r\n }\r\n return $default_value;\r\n}", "function post($name, $default = '') {\n return isset($_POST[$name]) ? $_POST[$name] : $default;\n}", "function atkGetPostVar($key=\"\")\n{\n\tif(empty($key) || $key==\"\")\n\t{\n\t\treturn $_REQUEST;\n\t}\n\telse\n\t{\n\t\tif (array_key_exists($key,$_REQUEST) && $_REQUEST[$key]!=\"\") return $_REQUEST[$key];\n\t\treturn \"\";\n\t}\n}", "public static function getParameter($name,$default=null) {\n\t if(isset($_REQUEST[$name])) {\n\t $value = $_REQUEST[$name];\n\t return Str::trimAll($value);\n\t }\n\t return $default;\n\t}", "function inputGet($key, $default = \"\")\n{\n\tif(inputHas($key)) {\n\t\treturn $_REQUEST[$key];\n\t} else {\n\t\treturn $default;\n\t}\n}", "public static function get_input_value($id, $default = NULL) {\n global $TFUSE;\n return ( $TFUSE->request->isset_GET($id) ? $TFUSE->request->GET($id) : $default );\n }", "function getUserFromForm()\n {\n $string= \"default\";\n\n if (isset($_POST['Parametro']))\n $string=$_POST['Parametro'];\n\n return $string;\n }", "function rget($key, $default=null){\n\treturn isset($_POST[$key]) ? $_POST[$key] : (isset($_GET[$key]) ? $_GET[$key] : $default);\n}", "private function get_post_request( $key, $default = false, $type = 'GET' ) {\n\t\t$return = $default;\n\t\tif ( false !== $this->has( $key, $type ) ) {\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'GET':\n\t\t\t\t\t$return = Helper::array_key_get( $key, $_GET, $default );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'POST':\n\t\t\t\t\t$return = Helper::array_key_get( $key, $_POST, $default );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'REQUEST':\n\t\t\t\t\t$return = Helper::array_key_get( $key, $_REQUEST, $default );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$return = $default;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "private function postget ( $key ) {\n if ( isset( $_POST[ $key ] ) ) {\n return filter_input( INPUT_POST, $key );\n } elseif ( isset( $_GET[ $key ] ) ) {\n return filter_input( INPUT_GET, $key );\n } else {\n return NULL;\n }\n }", "static function get_http_post_val($post_variable) {\n if (isset($_POST[$post_variable])) {\n return $_POST[$post_variable];\n } else {\n return '';\n }\n }", "public static function get($name, $default = null)\r\n {\r\n // checking if the $_REQUEST is set\r\n if(isset($_REQUEST[$name]))\r\n {\r\n return $_REQUEST[$name]; // return the value from $_GET\r\n }\r\n else\r\n {\r\n return $default; // return the default value\r\n }\r\n }", "public function getPost(string $name, $default = null)\n {\n if (isset($_POST[$name])) {\n return $_POST[$name];\n }\n\n return $default;\n }", "public function get_param($str, $default = null){\n\t\tif(isset($_GET[$str]))\n\t\t{\n\t\t\treturn $_GET[$str];\n\t\t}else if(isset($_POST[$str]))\n\t\t{\n\t\t\treturn $_POST[$str];\n\t\t}{\n\t\t\treturn $default;\n\t\t}\n\t}", "function getFormPostValue($fieldName, $defaultValue = null)\n {\n if (array_key_exists($fieldName, $_POST) === true) {\n return $_POST[$fieldName];\n }\n if (array_key_exists($fieldName, $_SESSION) === true) {\n return $_SESSION[$fieldName];\n }\n return $defaultValue;\n }", "function getPostVal($key) {\n $CI = & get_instance();\n $val = $CI->input->post($key);\n if ($val != \"\")\n return $val;\n else\n return false;\n}", "function PostVar($name, $default_value = false) {\r\n if (!isset($_POST)) {\r\n return false;\r\n }\r\n if (isset($_POST[$name])) {\r\n if (!get_magic_quotes_gpc()) {\r\n return InjectSlashes($_POST[$name]);\r\n }\r\n return $_POST[$name];\r\n }\r\n return $default_value;\r\n}", "public function getSwitchParamValue(): ?string\n {\n if (!$this->request) {\n return null;\n }\n\n return $this->request->query->get($this->switchParam, self::VIEW_FULL);\n }", "public function getQueryParam($key, $default = null) {\r\n\t\tif (isset($_GET[$key])) {\r\n\t\t\treturn $_GET[$key];\r\n\t\t}\r\n\t\treturn $default;\r\n\t}", "protected function getPost($key, $default = null)\n {\n return $this->request->request->get($key, $default);\n }", "public function getParam($key, $default = null)\n {\n $postParams = $this->getParsedBody();\n $getParams = $this->getQueryParams();\n $result = $default;\n if (is_array($postParams) && isset($postParams[$key])) {\n $result = $postParams[$key];\n } elseif (is_object($postParams) && property_exists($postParams, $key)) {\n $result = $postParams->$key;\n } elseif (isset($getParams[$key])) {\n $result = $getParams[$key];\n }\n\n return $result;\n }", "function queryparam_GET($key, $default_value = null) {\n\treturn common_param_GET($_GET, $key, $default_value);\n}", "public function getPostVariable($key, $defaultValue = null);", "function safePostVar($varName, $default=null)\n{\n if (isset($_POST[$varName]))\n return $_POST[$varName];\n else\n return $default;\n}", "public function getPostParameter($name,$defaultValue=null){\n\t\treturn isset($_POST[$name])? $_POST[$name] : $defaultValue;\n\t}", "function getValue($fieldName) {\r\n $value = '';\r\n if (isset($_REQUEST[$fieldName])) { \r\n $value = $_REQUEST[$fieldName];\r\n }\r\n return $value;\r\n }", "function r($param, $default = null) {\n if (!empty($_REQUEST[$param]))\n return is_array($_REQUEST[$param]) ? $_REQUEST[$param] : trim($_REQUEST[$param]);\n return $default;\n}", "function get_value_or_default($value,$default='')\n{\n\treturn (!empty($value)) ? $default : $value;\n}", "function _get_param($key, $default_value = '')\n\t\t{\n\t\t\t$val = $this->EE->TMPL->fetch_param($key);\n\n\t\t\tif($val == '') {\n\t\t\t\treturn $default_value;\n\t\t\t}\n\t\t\treturn $val;\n\t\t}", "public static function post($key, $default = null) {\n if (isset($_POST[$key])) {\n return $_POST[$key];\n }\n\n return $default;\n }", "function _get($str)\n{\n $val = !empty($_GET[$str]) ? $_GET[$str] : null;\n return $val;\n}", "function postValue($name, $defaultValue = NULL) {\r\n\r\n $value = $defaultValue;\r\n if (isset($_POST[$name])) {\r\n $value = $_POST[$name];\r\n }\r\n\r\n return $value;\r\n\r\n }", "function getOrDefault($var, $default) {\n return (isset($_GET[$var])) ? $_GET[$var] : $default;\n}", "public function param( $key, $default = null ) {\n\t\treturn isset( $_REQUEST[ $key ] ) && $_REQUEST[ $key ] !== '' ? $_REQUEST[ $key ] : $default;\n\t}", "public static function get($key, $default = null)\n {\n return static::has($key) ? $_REQUEST[$key] : null;\n }", "function getparam($name) {\n if (isset($_POST[$name])) {\n return $_POST[$name];\n } else {\n return \"\";\n }\n}", "protected function getPostRequest($key = null)\n {\n $post = $this->getRequest()->getPostValue();\n\n if (isset($key) && isset($post[$key])) {\n return $post[$key];\n } elseif (isset($key)) {\n return null;\n } else {\n return $post;\n }\n }", "function postInput($string)\n\t{\n\t\treturn inset($_post[$string]) ? $_post[$string] : '';\n\t}", "public function post( $key, $default = null ) \n\t{\n\t\tif ( !isset( $this->POST[$key] ) ) \n\t\t{\n\t\t\treturn $default;\n\t\t}\n\t\treturn $this->POST[$key];\n\t}", "public function getSubmittedValue() {\n return isset($_REQUEST[$this->name]) ? $_REQUEST[$this->name] : FALSE;\n }", "function param($key, $default = NULL)\n{\n\treturn isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;\n}", "function get_param($key, $default_value = '')\n\t{\n\t\t$val = ee()->TMPL->fetch_param($key);\n\t\t\n\t\tif($val == '') \n\t\t\treturn $default_value;\n\t\telse\n\t\t\treturn $val;\n\t}", "function getParam( $key, $default = NULL ) {\n return Yii::app()->request->getParam( $key, $default );\n}", "protected function get_post_value($name, $default = null) {\n $name = $this->get_post_field_name($name);\n return isset($_POST[$name]) ? $_POST[$name] : $default;\n }", "public function getPost(string $key = null, $filters = null, $defaultValue = null, bool $allowEmpty = true) {}", "public function getParameter($name,$defaultValue=null){\n\t\treturn isset($_GET[$name])? $_GET[$name] : $defaultValue;\n\t}", "function GET($key)\n {\n if (isset($_GET[$key]))\n $value = $_GET[$key];\n elseif (isset($GLOBALS['HTTP_GET_VARS'][$key]))\n $value = $GLOBALS['HTTP_GET_VARS'][$key];\n elseif (isset($_POST[$key]))\n $value = $_POST[$key];\n elseif (isset($GLOBALS['HTTP_POST_VARS'][$key]))\n $value = $GLOBALS['HTTP_POST_VARS'][$key];\n else\n return \"\";\n if (get_magic_quotes_gpc())\n return stripslashes($value);\n return $value;\n }", "function get_param($key, $default=false){\n if (is_array($key)){\n foreach ($key as $onekey){\n $ret = get_param($onekey);\n if ($ret)\n return $ret;\n }\n }else{ \n \n if ($_GET)\n if (array_key_exists($key,$_GET))\n return $_GET[$key];\n if ($_POST)\n if (array_key_exists($key,$_POST))\n return $_POST[$key]; \n }\n \n return $default;\n}", "function getPostParam($name,$def=null) {\n\treturn htmlentities(isset($_POST[$name]) ? $_POST[$name] : $def,ENT_QUOTES);\n\t\t\n}", "public function queryParam(string $name, $default = null)\n {\n return $this->request->getQueryParams()[$name] ?? $default;\n }", "public static function post($key, $default = \"\") {\n return(isset($_POST[$key]) ? $_POST[$key] : $default);\n }", "public static function requestPost($name = null, $default = null) {\n $result = null;\n\n if(isset($name)) {\n $result = isset($_POST[$name]) ? $_POST[$name] : $default;\n } else {\n $result = $_POST;\n }\n\n return $result;\n }", "public function getPost($name = null, $default = null)\n {\n return !$name ? $_POST : (isset($_POST[$name]) ? $_POST[$name] : $default);\n }", "function value($input, $default = false) {\n if (!empty($_SESSION['post'][$input])) {\n $temp = $_SESSION['post'][$input];\n unset($_SESSION['post'][$input]);\n\n return $temp;\n }\n\n return $default ?? false;\n}", "function getUrlStringValue($urlStringName, $returnIfNotSet) {\n if(isset($_GET[$urlStringName]) && $_GET[$urlStringName] != \"\")\n return $_GET[$urlStringName];\n else\n return $returnIfNotSet;\n}", "function get_url_param( $variable, $default='' )\n {\n return !empty( $_GET[ $variable ] )?$_GET[ $variable ]:$default;\n }", "public static function GET($key, $default = '') {\n if (isset($_GET[$key])) {\n return $_GET[$key];\n }\n return $default;\n }", "public function getRequestValue($key)\n {\n return $this->_request() ? $this->_request()->getParam($key) : null;\n }", "function get($name = null, $default = null)\n {\n if ($name === null) {\n return Request::query();\n }\n\n /*\n * Array field name, eg: field[key][key2][key3]\n */\n if (class_exists('October\\Rain\\Html\\Helper')) {\n $name = implode('.', October\\Rain\\Html\\Helper::nameToArray($name));\n }\n\n return array_get(Request::query(), $name, $default);\n }", "public static function p($string = '', $default = '')\n {\n return isset($_POST[$string]) ? $_POST[$string] : $default;\n }", "public static function getValue( $value ) {\n\t\treturn isset( $_GET[ $value ] ) ? $_GET[ $value ] : ( isset( $_POST[ $value ] ) ? $_POST[ $value ] : null );\n\t}", "public function getPost($key = null, $default = null)\n {\n if (null === $key) {\n return $_POST;\n }\n\n return (isset($_POST[$key])) ? $_POST[$key] : $default;\n }", "public static function get($key, $default = \"\") {\n return(isset($_GET[$key]) ? $_GET[$key] : $default);\n }", "function safe_retrieve_gp($varname, $default='', $null_is_default=false) {\n if ( is_array($_REQUEST) && \n array_key_exists($varname, $_REQUEST) &&\n ( ($_REQUEST[$varname] != null) || (!$null_is_default) ) ) \n return $_REQUEST[$varname];\n return $default;\n}", "private static function getValue($name)\n\t{\n\t\treturn $_POST[$name] ?? null;\n\t}", "public function post( $key, $value = '' ) {\n if( strlen( $value ) ) {\n $this->_post[ $key ] = $value;\n return $value;\n } else {\n return ( isset( $this->_post[ $key ] ) ) ? $this->_post[ $key ] : null;\n }\n }", "function app_contact_get_var($val = '', $default = '') {\n return !isset($_REQUEST[$val]) ? $default : trim($_REQUEST[$val], ' <>');\n}", "public function getRequestValue($key, $default = null)\n {\n return array_get($_REQUEST, $this->getOption('prefix') . $key, $default);\n }", "protected function get($name, $value = NULL) {\n\t\tif (isset($_GET[$name])) {\n\t\t\treturn trim(htmlspecialchars($_GET[$name]));\t\n\t\t} else if (isset($_POST[$name])) {\n\t\t\treturn trim(htmlspecialchars($_POST[$name]));\n\t\t}\n\t\treturn $value;\n\t}", "abstract public function get_posted_value();", "function get_param($param_name)\n{\n if($_POST[$param_name])\n\t\treturn $_POST[$param_name];\n\telse\n\t\treturn $_GET[$param_name];\n}", "protected static function getPostData($key, $default = null)\n {\n return empty($_POST) || empty($_POST[$key]) ? $default : $_POST[$key];\n }", "function get_var($varname, $method=\"\", $default_value=\"\")\n{\n\tglobal $_POST;\n\tglobal $_GET;\n\n\tif( isset($_GET[$varname]) && ((strcasecmp($method, \"get\") == 0 || $method == null)) )\n\t{\n\t\treturn $_GET[$varname];\n\t}\n\telse if(isset($_POST[$varname]))\n\t{\n\t\treturn $_POST[$varname];\n\t}\n\telse return $default_value;\n}", "public function query_string($default = '', $xss_clean = null)\n\t{\n\t\t$query_string = $this->server('QUERY_STRING', $xss_clean);\n\t\treturn ($query_string) ? $query_string : $default;\n\t}", "public function post($key = null, $default = null)\n {\n if($key == null){\n return $this->post;\n }\n else {\n if(array_key_exists($key, $this->post)){\n return $this->post[$key];\n }\n return $default;\n }\n }" ]
[ "0.71553534", "0.6914543", "0.6896532", "0.680189", "0.67324764", "0.6709569", "0.6687148", "0.666221", "0.6644682", "0.6618038", "0.65568715", "0.6542338", "0.65153116", "0.65057224", "0.64896667", "0.6476278", "0.64676577", "0.6450422", "0.64371306", "0.6417068", "0.64051634", "0.63918", "0.6382216", "0.6377795", "0.6354115", "0.62991804", "0.6293218", "0.6289795", "0.6280081", "0.6275091", "0.62702537", "0.6265282", "0.62506", "0.62448037", "0.6237137", "0.6231307", "0.6206848", "0.6204049", "0.62001544", "0.6198182", "0.6198145", "0.6192649", "0.61840916", "0.61839044", "0.6182322", "0.618009", "0.61620086", "0.6156307", "0.6143292", "0.61352754", "0.61100286", "0.6103993", "0.6096457", "0.60774726", "0.6066586", "0.60613865", "0.6050026", "0.6041994", "0.60361594", "0.6030384", "0.60280657", "0.60254055", "0.60217327", "0.60212594", "0.6019776", "0.60189974", "0.60178405", "0.60033435", "0.5988563", "0.5960025", "0.59449226", "0.59357435", "0.5934829", "0.59333354", "0.59326524", "0.59324306", "0.5931849", "0.5928908", "0.59139705", "0.5909703", "0.5908556", "0.5905615", "0.59023136", "0.59007376", "0.5889965", "0.588583", "0.5879071", "0.58788717", "0.5878853", "0.5876807", "0.5873688", "0.58640486", "0.5859878", "0.5856271", "0.5844834", "0.5843183", "0.58398217", "0.5830195", "0.5820666", "0.5820081" ]
0.6889245
3
Check that post param is not empty
function ValidRequiredPost($name) { return isset($_POST[$name]) && $_POST[$name] != ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmpty(){\n\t\tif(!empty($_POST)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isPostLeeg()\n {\n return empty($_POST);\n }", "function checkPOST() : bool\n {\n if (!(isset($_POST['firstName']) && isset($_POST['secondName'])))\n {\n return false; // not set\n }\n if (trim($_POST['firstName']) == '' && trim($_POST['secondName']) == '')\n {\n return false; // empty\n }\n return true;\n }", "function blankCheck() {\n\tfor($i = 0; $i < func_num_args(); $i++) {\n\t\tif (($_POST[func_get_arg($i)] == '') OR ($_POST[func_get_arg($i)] === 0)) {\n\t\t\tresponse(1, '必填项中含有空值');\n\t\t\texit(0);\n\t\t}\n\t}\n}", "function not_empty($fields = [])\r\n{\r\n if (count($fields) !=0) {\r\n foreach ($fields as $field) {\r\n if (empty($_POST [$field]) || trim($_POST[$field]) == \"\") { //trim escape all spaces. If empty : false\r\n return false;\r\n }\r\n }\r\n return true ; //fields filled\r\n }\r\n}", "public function is_empty()\r\n {\r\n if( $this->is_submit() && ($this->taintedInputs->length()=== 0))\r\n return true; \r\n else\r\n return false;\r\n }", "public function testIsInvalidEmptyPost() {\n\t\t$this->assertFalse($this->match->validate(array()));\n\t}", "public function hasPost()\n {\n if (func_num_args() == 0) {\n return !empty($this->post);\n }\n\n foreach (func_get_args() as $key) {\n if (!$this->hasParam($this->post, $key)) {\n return false;\n }\n }\n\n return true;\n }", "function not_empty($tableau) {\n\tforeach ($tableau as $champ) {\n\t\tif(empty($_POST[$champ]) || trim($_POST[$champ])==\"\" ){\n\t\t\treturn false;\n\t\t# code.\n\t\t}\n\n\t}\n\treturn true;\n}", "function post_exists($parameter){\n return key_exists($parameter, $_POST) && strlen(trim($_POST[$parameter])) > 0;\n}", "public function isEmpty()\n {\n return (!is_array($this->params) || count($this->params) == 0);\n }", "function fieldsEmpty() {\n if(empty($_POST['title']) || empty($_POST['date']) || empty($_POST['location'])) {\n return true;\n } else {\n return false;\n }\n}", "protected function __getPostRemoveEmpty(){\r\n if($this->request->isPost()){\r\n foreach($this->request->getPost() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_POST[$key]);\r\n }\r\n }\r\n }\r\n else{\r\n foreach($this->request->getQuery() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_GET[$key]);\r\n }\r\n }\r\n }\r\n }", "function validate_post($data)\n\t{\n\t\t/* Validating the hostname, the database name and the username. The password is optional. */\n\t\treturn !empty($data['db_host']) && !empty($data['db_username']) && !empty($data['db_name']) && !empty($data['site_url']);\n\t}", "function check_required_param($param = array(),$method){\n //set up method\n if (strtolower($method) == \"post\"){\n $r = $_POST;\n }else if (strtolower($method) == \"get\"){\n $r = $_GET;\n }\n //check of required param\n foreach ($param as $par){\n if (!isset($r[$par]) || empty($r[$par])){\n return false;\n break;\n }\n }\n return true;\n}", "public function hasPostData()\r\n\t{\r\n\t\treturn (is_array($this->postData) && !empty($this->postData));\r\n\t}", "public static function isPost()\n {\n return !empty($_POST);\n }", "protected function validatePOST() {\n return true;\n }", "public function post()\n {\n return count($_POST) > 0;\n }", "static function available()\n {\n foreach (func_get_args() as $key)\n if (!isset($_POST[$key]) || empty($_POST[$key]))\n return false;\n return true;\n }", "function filled_out($form_vars) {\n foreach ($form_vars as $key => $value) {\n if ((!isset($key)) || ($value == '')) {\n return false;\n }\n }\n return true;\n}", "public function validate_request() {\r\n\t\tif ($this->request != null && sizeof($this->request) != 1)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "public static function isPost($var=''){\n\t\tif(empty($var)){\n\t\t\tif(!empty($_POST)){return TRUE;}\n\t\t}\n\t\telse {\n\t\t\t//check if post variable exist and return value otherwise return empty\n\t\t\tif(!empty($_POST[$var])){\n\t\t\t\treturn trim($_POST[$var]);\n\t\t\t}\n\t\t\telseif(isset($_POST[$var])){return '';}\n\t\t}\n\t\treturn FALSE;\n\t}", "function filled_out($form_vars)\r\n{\r\n foreach ($form_vars as $key => $value)\r\n {\r\n if (!isset($key) || ($value == \"\"))\r\n return true;\r\n }\r\n return true;\r\n}", "function checkEmptyField($field) {\n\t return isset($field) && $field !== \"\" && $field !== '';\n }", "function required_params()\n {\n $params = func_get_args();\n foreach ($params as $value) {\n if (is_array($value)) {\n if (empty($value)) {\n return false;\n }\n } else {\n if ($value === null || strlen(trim($value)) == 0) {\n return false;\n }\n }\n }\n\n return true;\n }", "private function verify_parameters(){\n if( empty( $_GET['email'] ) || empty( $_GET['pms_key'] ) || empty( $_GET['subscription_id'] ) )\n return false;\n\n return true;\n }", "public function isPost() {\r\n return isset($_POST) && count($_POST) > 0;\r\n }", "function checkPost($postArray) {\n if (isset($postArray) && $postArray!= NULL) {\n return TRUE;\n } else {\n return FAlSE;\n }\n}", "function haveEmptyParameters($required_params, $request, $response){\n //initialization false\n $error = false; \n //to get the empty params\n $error_params = '';\n //get all the request params with the current request\n // $request_params = $_REQUEST;\n $request_params = $request->getParsedBody();\n\n // loop through params\n foreach($required_params as $param){\n // check the parameter is empty or parameter length is zero\n // !isset checks whether the parameter is empty\n if (!isset($request_params[$param]) || strlen($request_params[$param]) <= 0){\n # code...\n $error = true;\n // concatenate the parameter in error_params\n $error_params .= $param . ', ';\n }\n }\n\n if ($error) {\n # code...\n $error_detail = array();\n $error_detail['error'] = true;\n $error_detail['message'] = 'Required parameters ' . substr($error_params, 0, -2) . ' are missing or empty';\n // use the $response object to return the response\n // encode the error_detail in json format\n $response->write(json_encode($error_detail));\n }\n return $error;\n}", "function requirePOST(...$args) {\n foreach ($args as $field) {\n if (!isset($_POST[$field])) die(\"Missing data!\\n\");\n }\n}", "function validateFilled(string $name)\n{\n if (empty($_POST[$name])) {\n return 'Это поле должно быть заполнено';\n };\n}", "function empty_field_check() {\n $all_full =\n isset($_POST['email']) &&\n isset($_POST['username']) &&\n isset($_POST['password']) &&\n isset($_POST['name']) &&\n isset($_POST['surname']);\n \n if(!$all_full)\n launch_error(\"Some fields are empty.\");\n}", "function emptyPost() {\n\t\t$_POST = array();\n\t}", "public function isSubmitted()\n\t{\n\t\tif( $this->method == 'post' )\n\t\t{\n\t\t\treturn $this->request->getMethod() == 'post';\n\t\t}\n\n\t\t$arr = $this->request->getQueryString();\n\t\treturn ! empty( $arr );\n\t}", "Public static function parametersEmpty(){\n\n throw new \\yii\\web\\HttpException(206, 'Query parameters Should not empty', 405);\n\n\n }", "public function isPosted()\n\t{\n\t\treturn (! empty($_POST['change_password']));\n\t}", "public function isPayloadEmpty()\n {\n $postData = $this->getPayload();\n return empty((array)$postData);\n }", "public function isPost();", "public function req($value)\n {\n return '' != $value || empty($value);\n }", "public static function isPost()\n {\n return !empty($_POST) && isset($_POST);\n }", "public function hasParameters()\n {\n return !empty($this->params);\n }", "function check_if_set(){\r\n if(!(isset($_POST['first_name']) && isset($_POST['last_name']) && isset($_POST['email']) && isset($_POST['headline']) && isset($_POST['summary']))){\r\n\treturn false;\r\n }\r\n else{\r\n\treturn true;\r\n }\r\n}", "function _postn($v) {\r\n $r = isset($_POST[$v]) ? bwm_clean($_POST[$v]) : '';\r\n return $r == '' ? NULL : $r;\r\n}", "function not_empty(array $fields) { // création tableau\r\n\t\r\n\r\n\t\tif (count($fields)!=0)\t{ // verif.si il y a des elements dans le tableau\r\n\t\t\r\n\r\n\t\t\tforeach ($fields as $field) {\r\n\r\n\t\t\t\tif (empty($_POST[$field]) || trim($_POST[$field])==\"\") {\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\treturn false; // verif.que tous les champs soient remplis, sinon \"false\"\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\t\r\n\r\n\r\n\t\t}", "protected function getAllFieldsAreEmpty() {}", "function testEmptyPOSTExpectsNullArrayForFieldKey() {\n\t\t// arrange\n\t\t$_POST = array();\n\t\tglobal $post;\n\t\t$TestValidTextField = new TestValidTextField();\n\t\t$validated = array();\n\t\t$saved = array();\n\n\t\t// act\n\t\t$TestValidTextField->validate( $post->ID, $TestValidTextField->fields['field'], $validated, $saved );\n\n\t\t// assert\n\t\t$this->assertTrue( empty( $validated ) );\n\t}", "function is_field_empty(array $fields) {\n foreach ($fields as $key => $value) {\n $fields[$key] = isset($value) ? trim($value) : '';\n }\n /* If there is nothing a field then valid empty index is false */\n if (in_array(\"\", $fields, true)) {\n return false;\n }\n /* return array */\n return $fields;\n}", "private function value_exists( $key ) {\n\t\treturn ! empty( $_POST[ $key ] );\n\t}", "function issetandfilled($data) {\n if (!isset($data))\n return false;\n\n if (empty(trim($data)))\n return false;\n \n return true;\n}", "function bar() {\n\t\tif ( empty( $_POST['test'] ) ) { // Bad.\n\t\t\treturn;\n\t\t}\n\n\t\tdo_something( $_POST['test'] ); // Bad.\n\t}", "public function is_true_body_empty()\n {\n return $this->get_true_body() === '' || $this->get_true_body() === null;\n }", "function ValidRequiredQueryString($name) {\n return isset($_GET[$name]) && $_GET[$name] != \"\";\n}", "function emptyInputSignup($voornaam, $achternaam, $emailadres, $woonplaats, $postcode, $straatnaam, $huisnummer, $wachtwoord, $wachtwoordbevestiging) {\n\tif (empty($voornaam) || empty($achternaam) || empty($emailadres) || empty($woonplaats) || empty($postcode) || empty($straatnaam) || empty($huisnummer) || empty($wachtwoord) || empty($wachtwoordbevestiging)) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}", "public function notEmpty($field) {\n\t\treturn ( ! empty($_POST[$field['name']]));\n\t}", "public function validatePostData () {\n\t\t$message = \"success\";\n\n\t\t// check if the payer's name has been provided\n\t\t$customerName = $this->input->post('gtp_PayerName'); //$_POST['gtp_PayerName'];\n\t\tif(($customerName == \"\") || ($customerName == null)) {\n\t\t\t$message = \"Provide Your name please!\";\n\t\t\treturn $message;\n\t\t}\n\n\t\t// validate other fields\n\n\t\treturn $message;\n\t}", "function acf_is_empty($var)\n{\n}", "private function checkPost() {\r\n \r\n if (!is_null(filter_input(INPUT_POST, self::FORM_NAME_GAME_ADD))) {\r\n $this->dealWithAddNewGame();\r\n } else if (!is_null(filter_input(INPUT_POST, self::FORM_NAME_GAME_EDIT))) {\r\n $this->dealWithEditGame();\r\n }\r\n }", "function clean_input($data, $default = NULL) {\n // Sanitise data\n $data = trim($data);\n $data = stripslashes($data);\n // return isse, not empty and POST\n return isset($_POST[$data]) ? $_POST[$data] : $default;\n }", "function filled_out($form_vars) {\n\t\t// test that if each variable has a value\n\t\tforeach ($form_vars as $key => $value) {\n\t\t\tif ((!isset($key)) || ($value == '')) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function testPostEmpty()\n {\n $this->assertArrayEmpty($this->get_reflection_property_value('post'));\n }", "function checkPOSTParametersOrDie($parameters) {\n foreach ($parameters as $parameter) {\n isset($_POST[$parameter]) || die(\"'$parameter' parameter must be set by POST method.\");\n }\n}", "function checkContent($data) {\n /* This makes sure user just didn't type spaces in an attempt to make the form valid */\n foreach ($data as $key => $value) {\n $data[$key] = isset($value) ? trim($value) : '';\n }\n /* If there are empty field(s) then set the error array to\n * false otherwise it should be true. I know it sounds like that we should set it to true and\n * I will explain it better when we are all finished coding the validation\n * portion of the script.\n */\n if (in_array(\"\", $data, true)) {\n return FALSE;\n } else {\n return TRUE;\n }\n}", "function hasParam($name) {\n\t\tif (isset($this->getvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (isset($this->postvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "function acf_not_empty($var)\n{\n}", "public function testIsEmptyInput()\n {\n $this->assertTrue((new IndexController($this->request, $this->database))->isEmpty(['title', 'goal', 'image', 'summary'], []));\n \n /**\n * Test if input is missing\n */\n $this->assertTrue((new IndexController($this->request, $this->database))->isEmpty(['title', 'goal', 'image', 'summary'], ['title' => 'Petition1', 'goal' => 150, 'summary' => 'Petition Summary']));\n \n /**\n * Test if input is correct\n */\n $this->assertFalse((new IndexController($this->request, $this->database))->isEmpty(['title', 'goal', 'image', 'summary'], ['title' => 'Petition1', 'goal' => 150, 'image' => 'petition.jpg', 'summary' => 'Petition Summary']));\n }", "public function isPost(): bool {}", "function getCampo($campo)\n{\n if (!empty($_POST[$campo])) {\n return test_input($_POST[$campo]);\n }\n return \"\";\n}", "public function isPost() {\n\t\treturn (isset($_SERVER['REQUEST_METHOD']) AND $_SERVER['REQUEST_METHOD']=='POST');\n\t}", "function isTheseParametersAvailable($required_fields)\n{\n $error = false;\n $error_fields = \"\";\n $request_params = $_REQUEST;\n\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n $response = array();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echo json_encode($response);\n return false;\n }\n return true;\n}", "function exist_param($fieldname){\n return array_key_exists($fieldname, $_REQUEST);\n }", "protected function submitted ($post)\n\t{\n\t\treturn isset ($post['BoothNum']);\n\t}", "public function validateEmpty($data)\n {\n return true;\n }", "function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}", "private function is_valid_field_data() {\n\t\t$data = rgpost( $this->get_input_name() );\n\n\t\tif ( empty( $data ) ) {\n\t\t\tgf_recaptcha()->log_debug( __METHOD__ . \"(): Input {$this->get_input_name()} empty.\" );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn gf_recaptcha()->get_token_verifier()->verify_submission( $data );\n\t}", "function checkAddress(){\n $country = $_POST[\"country\"];\n $city = $_POST[\"city\"];\n $street = $_POST[\"street\"];\n $number = $_POST[\"number\"];\n if(empty($country) || empty($city) || empty($street) || empty($number)){\n return false; \n }\n return true; \n }", "private function isNotPost() : void\n {\n if(!($_SERVER['REQUEST_METHOD'] === 'POST'))\n {\n (new Session())->set('user','error', InputError::basicError());\n header('Location:' . self::REDIRECT_SIGNIN);\n die();\n }\n }", "function qa_is_http_post()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn $_SERVER['REQUEST_METHOD'] === 'POST' || !empty($_POST);\n}", "public function testWithEmptyParameterName()\n {\n self::expectException(EmptyParameterNameException::class);\n self::expectExceptionMessage('POST parameter name is empty');\n\n new WithPostParameter('', 'Bar');\n }", "function isEmpty($str = null){\n if ($str) {\n $cleanstr = trim($str);\n if (strlen($cleanstr)<=0) {\n echo \"input is Empty<br>\";\n return true;\n }else\n return false;\n}}", "public function isEmpty()\n {\n return $this->_value === '' || $this->_value === null;\n }", "function postif($field)\n\t{\n\t\treturn (isset($_POST[\"$field\"]) ? $_POST[\"$field\"] : false);\n\t}", "private function _hasPostContents($input)\n {\n return isset($_FILES[$input]) || isset($_POST[$input]);\n }", "public function isNeedPush(): bool\n\t{\n\t\treturn !empty($this->params);\n\t}", "public function requireNotNullOrEmpty($key)\n {\n\n $value = $this->getParam($key);\n if(is_null($value) || (is_string($value) && trim($value) == '')){\n throw new InvalidParameterException($key, $value, __FUNCTION__);\n }\n\n return $value;\n }", "function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}", "function is_blank( $value ) {\n return !isset( $value ) || trim( $value ) === '';\n}", "function checkMandatoryArguments()\n \t{\n \t\tif($this->mStrAdGUID == \"\" || $this->mStrAdGUID == null)\n \t\t\treturn false;\n \t\telse if($this->mStrQuantity == \"\" || $this->mStrQuantity == null)\n \t\t\treturn false;\n \t\telse\n \t\t\treturn true;\n \t}", "function hasPost($p_sKey) {\n\t\treturn array_key_exists($p_sKey, $_POST);\n\t}", "function is_empty()\n {\n }", "function emptyInputSignup($gebruikersnaam, $email, $password, $passwordRepeat){\n $result = true;\n if (empty($gebruikersnaam) || empty($email) || empty($password) || empty($passwordRepeat)){\n $result = true;\n }\n else{\n $result = false;\n }\n return $result;\n}", "function validateColums($POST) {\n if (isset( $POST['sName'] ) )\n return true;\n\n if ( (!isset($POST['label'])) &&\n (!isset($POST['asset_no'])) &&\n (!isset($POST['has_problems'])) &&\n (!isset($POST['comment'])) &&\n (!isset($POST['runs8021Q'])) &&\n (!isset($POST['location'])) &&\n (!isset($POST['MACs'])) &&\n (!isset($POST['label'])) &&\n (!isset($POST['attributeIDs'])) ) {\n return true;\n }\n\n}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function issetPost($key){\n if(isset($this->post[$key])){\n return true;\n }\n \n return false;\n }", "function _inputCheck(){\n if (isset($_POST['verder']) && $this->_verify() == \"\") {\n return true;\n }\n else {\n return false;\n }\n }", "function emptyInputRegister($fname,$lname,$contact,$uname,$pass,$pass2){\n $result = true;\n if(empty($fname) || empty($lname) || empty($contact) || empty($uname) || empty($pass) || empty($pass2)){\n $result = true;\n }else{\n $result = false;\n }\n return $result;\n}", "function checkrequest($name)\n {\n\t if($this->is_post()||$this->updatemode==true){\n\t\t return $_REQUEST[$name];\n/*\t\t if(isset($_REQUEST[$name])) {\n\t\t\t return $_REQUEST[$name];\n\t\t }\n\t\t elseif($_REQUEST[$name]==\"\") {\n\t\t return \"\";\n\t\t}*/\n }\n\telse\n\t return \"\";\n }", "private function validatePostName($_post_name){\n $this->post_name = htmlspecialchars($_post_name);\n if($this->post_name === '' or strlen($this->post_name) > 100){\n return false; //Was not a string, or an error occured\n }\n return true;\n }" ]
[ "0.7423945", "0.71076137", "0.70415545", "0.7016539", "0.6903644", "0.68790364", "0.68191296", "0.6761175", "0.67490524", "0.6694592", "0.66818935", "0.66723293", "0.6665045", "0.66259265", "0.6602465", "0.657979", "0.6578675", "0.6455953", "0.64507854", "0.6442074", "0.6432234", "0.64133346", "0.6401583", "0.6383392", "0.63793373", "0.6371754", "0.6341822", "0.63284606", "0.63083375", "0.6303849", "0.62700987", "0.62525415", "0.6251768", "0.6242572", "0.62290627", "0.6226725", "0.62144226", "0.6205546", "0.62007", "0.6183364", "0.6155351", "0.61463636", "0.6145854", "0.6142469", "0.6123021", "0.6121661", "0.60990864", "0.60840213", "0.6083083", "0.60732025", "0.60637254", "0.6055487", "0.6047187", "0.6039073", "0.6034723", "0.6029352", "0.6023048", "0.6020174", "0.6003269", "0.59965867", "0.59812784", "0.59788555", "0.596661", "0.594971", "0.5944844", "0.5928772", "0.59279686", "0.5926021", "0.5915999", "0.59063876", "0.59043074", "0.58996344", "0.5896221", "0.5886119", "0.5883946", "0.58675426", "0.5864415", "0.58625984", "0.5862201", "0.58562696", "0.5852088", "0.58491033", "0.58436894", "0.58353704", "0.5833095", "0.5826968", "0.5821129", "0.5814925", "0.5798779", "0.5796054", "0.5795272", "0.5789491", "0.57885414", "0.57826114", "0.57826114", "0.57821304", "0.5781048", "0.5769651", "0.57694906", "0.5759969" ]
0.7182731
1
Forces initialization of the proxy
public function __load() { $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _initProxy() {\n\t\t$options = $this->getOptions();\n\t\t$this->_config->setAutoGenerateProxyClasses(isset($options['proxy']['autoGenerateProxyClasses']) ? $options['proxy']['autoGenerateProxyClasses'] : true);\n\t\t$this->_config->setProxyDir(isset($options['proxy']['directory']) ? $options['proxy']['directory'] : APPLICATION_PATH . '/Model/Proxies');\n\t\t$this->_config->setProxyDir(isset($options['proxy']['directory']) ? $options['proxy']['directory'] : APPLICATION_PATH . '/Model/Proxies');\n\t\t$this->_config->setProxyNamespace(isset($options['proxy']['namespace']) ? $options['proxy']['namespace'] : 'Model\\Proxies');\n\t}", "public function useProxy() {\n $this->_use_proxy = TRUE;\n return $this;\n }", "public function setUp(): void\n {\n $this->proxy = NewInstance::of(Verified::class);\n }", "public function initialize() {\n if ($this->dispatcher->isFinished() && $this->dispatcher->wasForwarded())\n return;\n\n parent::initialize();\n }", "public function init()\n\t{\n\t\tini_set( \"soap.wsdl_cache_enabled\", \"0\" );\n\t}", "protected function initialize() {\n \n parent::initialize();\n \n //\n // Disable the PHP WSDL caching feature. \n //\n ini_set(\"soap.wsdl_cache_enabled\", 0);\n ini_set('soap.wsdl_cache_ttl', 0);\n }", "private function init()\n\t{\n\t\treturn;\n\t}", "protected function init() {return;}", "protected function setUp() {\n $this->object = new CallableActionProxy(function() {\n return 'test_proxy';\n });\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "public function __construct($proxy = null)\n {\n if (!is_null($proxy)) {\n $this->proxy = $proxy;\n }\n }", "protected function initialize() {\n // NOOP\n }", "public function setProxy($proxy);", "public function init()\n {\n $this->wxService = new WxService();\n parent::init();\n }", "protected abstract function init();", "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "public function _init() {}", "public function __construct()\n {\n $config = ConfigHolder::getConfig();\n $context = array();\n if(!empty($config->proxy))\n {\n $context['http'] = array('proxy' => filter_var($config->proxy, FILTER_SANITIZE_STRING));\n }\n $default_context = stream_context_get_default ($context); \n libxml_set_streams_context($default_context); \n }", "protected function _init(){\n\t\t//Hook called at the beginning of self::run();\n\t}", "protected function setUp()\n {\n $this->manager = Manager::getInstance()\n ->setEndpoint($this->endpoint)\n ->setProxy($this->proxy);\n }", "public function early_init(){\n\t\t$this->db = new EMPS_MongoDB;\n\t\t$this->mdb = $this->mongodb->mdb;\n\t\t\n\t\t$this->p = new EMPS_Properties;\t\n\n\t\tif(!$this->fast){\n\t\t\t$this->auth = new EMPS_Auth;\t\t\t\n\t\t}\n\t}", "protected function _initialize()\n\t{\n\t\t$this->_do = Kiwi_Object_Manager::load\n\t\t(\n\t\t\t'Kiwi_Slide'\n\t\t); // allows caching\n\n\t\tparent::_initialize();\n\t}", "public function __construct(SettingsProxy $proxyIn){\r\n $this->proxy = $proxyIn;\r\n }", "public function initialize() {\r\n if (!$this->persistent) {\r\n $this->connect();\r\n } else {\r\n $this->pconnect();\r\n }\r\n }", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function _init(){}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "abstract protected function initialize();", "abstract protected function initialize();", "abstract protected function initialize();", "abstract protected function initialize();", "abstract protected function initialize();", "public function __construct() {\n parent::__construct();\n $this->client = new Client( [\n 'timeout' => 1000,\n 'verify' => false,\n 'request.options' => [\n 'proxy' => 'tcp://113.160.234.147:47469',\n ],\n ] );\n }", "protected function _init()\n {\n }", "abstract protected function _init();", "abstract protected function _init();", "private function init()\n {\n return true;\n }", "protected function _init()\n {\n }", "protected function init() {\n\t}", "protected function init() {\n\t}", "protected function init() {\n }", "protected function init() {\n }", "abstract public function initialize();", "function init() {\n if ($this->_init === false) {\n $this->_init = true;\n $this->doInit();\n }\n }", "abstract public function init();", "public function init()\n {\n // Nothing needs to be done initially, huzzah!\n }", "public function _before_init(){}", "public function init()\n {\n \treturn;\n }", "protected function _init()\r\n\t{\r\n\t}", "final public function initialize()\r\n\t{\r\n\t\t$initStrategy = $this->initializationStrategy;\r\n\r\n\t\tif (!$this->isKernelInitialized)\r\n\t\t{\r\n\t\t\tif ($initStrategy != null)\r\n\t\t\t\t$initStrategy->preInitialize();\r\n\r\n\t\t\tinclude($_SERVER[\"DOCUMENT_ROOT\"].BX_ROOT.\"/modules/main/lib/bxf.php\");\r\n\t\t\t$this->initializeKernel($initStrategy);\r\n\r\n\t\t\t$this->isKernelInitialized = true;\r\n\t\t}\r\n\r\n\t\tif (!empty($this->transferUri))\r\n\t\t{\r\n\t\t\t$transferUri = $this->transferUri;\r\n\t\t\t$this->transferUri = null;\r\n\r\n\t\t\t$this->transferUri($transferUri);\r\n\t\t\tdie();\r\n\t\t}\r\n\r\n\t\tif (!$this->isShellInitialized)\r\n\t\t{\r\n\t\t\t$this->initializeShell($initStrategy);\r\n\r\n\t\t\tif ($initStrategy != null)\r\n\t\t\t\t$initStrategy->postInitialize();\r\n\r\n\t\t\t$this->isShellInitialized = true;\r\n\t\t}\r\n\t}", "public function init()\r\r\n\t{\r\r\n\t\t$this->ip=$_SERVER[\"REMOTE_ADDR\"];\r\r\n\t\tparent::init();\r\r\n\t}" ]
[ "0.75635636", "0.6560218", "0.65170795", "0.6495727", "0.6461294", "0.6409547", "0.6353856", "0.6326196", "0.630571", "0.6300076", "0.6300076", "0.6300076", "0.6300076", "0.6299988", "0.6299988", "0.62994456", "0.62994456", "0.62994456", "0.62994456", "0.62994456", "0.62994456", "0.62729007", "0.62694365", "0.62433517", "0.62395644", "0.6223052", "0.62004745", "0.61887115", "0.61887115", "0.61887115", "0.61887115", "0.618047", "0.617718", "0.6156032", "0.61389446", "0.61181235", "0.61180663", "0.61116236", "0.6097738", "0.60887957", "0.60887957", "0.60887957", "0.60887957", "0.60887957", "0.60887957", "0.60783666", "0.60783666", "0.60783666", "0.60783666", "0.60783666", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.6078243", "0.604825", "0.604825", "0.60482305", "0.60481703", "0.60481703", "0.60481703", "0.60481703", "0.60481703", "0.6048114", "0.60479844", "0.60479844", "0.60479844", "0.60422856", "0.60422856", "0.60422856", "0.60422856", "0.60422856", "0.60399663", "0.6032872", "0.60237736", "0.60237736", "0.6007637", "0.60056794", "0.59969395", "0.59969395", "0.5985575", "0.5985575", "0.5981248", "0.5976089", "0.59722406", "0.59666467", "0.595934", "0.5955027", "0.5950718", "0.5945805", "0.5943182" ]
0.0
-1
Output login result in JSON format.
function output_json_results() { global $result; print json_encode($result); die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loginUser()\r\n {\r\n $req = $this->login->authenticate($this->user);\r\n $req_result = get_object_vars($req);\r\n print(json_encode($req_result));\r\n }", "function login()\n {\n $data = $this->input->post();\n $username = $data['user'];\n $password = $data['pass'];\n\n $login = $this->dynamicModel->loginUser($username,$password);\n header('Content-Type: application/json');\n echo json_encode($login);\n }", "public function getLoginResponse()\n {\n $result['responseCode'] = self::RESPONSE_LOGIN_OK;\n return $result;\n }", "public function auth()\n\t{\n\t\t$r = $this->do_auth();\n\t\t$x['status'] = $r;\n\t\techo json_encode($x);die;\n\t}", "public function index()\n {\n $user = Login::all('Username', 'Password');\n //var_dump($user);\n\n return Response::json($user);\n }", "private function _login(){\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n try {\r\n\r\n\r\n $username = $_POST['username'];\r\n $password = $_POST['password'];\r\n\r\n $path = ROOT.'/site/config/auth.txt';\r\n $adapter = new AuthAdapter($path,\r\n 'MRZPN',\r\n $username,\r\n $password);\r\n\r\n //$result = $adapter->authenticate($username, $password);\r\n\r\n $auth = new AuthenticationService();\r\n $result = $auth->authenticate($adapter);\r\n\r\n\r\n if(!$result->isValid()){\r\n $result->error = \"Incorrect username and password combination!\";\r\n /*\r\n foreach ($result->getMessages() as $message) {\r\n $result->error = \"$message\\n\";\r\n }\r\n */\r\n } else {\r\n $response = 200;\r\n $result->url = WEBROOT;\r\n }\r\n\r\n\r\n\r\n } catch (Exception $e) {\r\n $result->error = $e->getMessage();\r\n }\r\n\r\n }\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "public function UserAuthentication()\n\t{\n\t\t$this->layout = false;\n\n\t\t$username = String::Sanitize(strtolower(Html::Request(\"username\")));\n\t\t$password = String::Sanitize(Html::Request(\"password\"));\n\n\t\tif($username == \"[email protected]\" && $password == \"teste\") {\n\t\t\t$status = \"ok\";\n\t\t}\n\t\telse {\n\t\t\t$status =\"wrong_password\";\n\t\t}\n\n\t\t// Returning array\n\t\t$value = array(\"status\" => $status, \"username_received\" => $username, \"password_received\" => $password);\n\n\t\techo json_encode($value);\n\t}", "function please_login()\n{\n $result['type'] = \"error\";\n $result = json_encode($result);\n echo $result;\n die();\n}", "public function validateLoginAction(){\n\t\t \n\t\t $isValid = ! User::loginExists($_GET['login']);\n\t\t \n\t\t header('Content-Type: application/json');\n\t\t echo json_encode($isValid);\n\t }", "public function index()\n {\n $login = Login::all();\n return response()->json($login);\n }", "public function login()\n {\n $responseData = array('success'=>'1', 'labels'=>'etiquetas', 'message'=>\"Returned all site labels.\");\n\t\t$categoryResponse = json_encode($responseData);\n\t\treturn $categoryResponse;\n }", "function auth($username, $password) {\n\n // curl function to backend\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://afsaccess2.njit.edu/~es66/login.php\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, 'user='.$username.'&password='.$password);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n $decoded_json = json_decode($output);\n if ($decoded_json->{\"login\"} == \"success\") {\n $json[\"login\"] = \"ok\";\n if ($decoded_json->{\"Type\"} == \"1\") {\n $json[\"type\"] = \"instructor\";\n } else {\n $json[\"type\"] = \"student\";\n }\n //$json[\"type\"]=$decoded_json->{\"type\"};\n $json[\"username\"] = $decoded_json->{\"username\"};\n $json[\"firstname\"] = $decoded_json->{\"firstname\"};\n $json[\"lastname\"] = $decoded_json->{\"lastname\"};\n } else {\n $json[\"login\"] = \"bad\";\n }\n curl_close($ch);\n echo json_encode($json);\n}", "function doLogin() {\n\t\t$username = $this->input->post('username');\n\t\t$password = $this->input->post('password');\n\n\t\tif ($this->user->validate($username, $password)) {\n\t\t\t$this->user->startSession();\n\t\t\t$data = array(\n\t\t\t\t'success' => true\n\t\t\t);\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => 'Usuario ou senha incorretos.'\n\t\t\t);\n\t\t}\n\n\t\techo json_encode($data);\n\t}", "private function json_login()\n {\n $msg = \"Invalid Request. Email and Password Required\";\n $status = 400;\n $token = null;\n $input = json_decode(file_get_contents(\"php://input\"));\n\n if ($input) {\n\n if (isset($input->email) && isset($input->password)) {\n $query = \"SELECT userID, username, email, password FROM Users WHERE email LIKE :email\";\n $params = [\"email\" => $input->email];\n $res = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n $password = ($res['count']) ? $res['data'][0]['password'] : null;\n if (password_verify($input->password, $password)) {\n $msg = \"User Authorised. Welcome \" . $res['data'][0]['email'];\n $status = 200;\n\n $token = array();\n $token['email'] = $input->email;\n $token['email'] = $res['data'][0]['email'];\n $token['userID'] = $res['data'][0]['userID'];\n $token['username'] = $res['data'][0]['username'];\n $token['iat'] = time();\n $token['exp'] = time() + (60 + 60);\n\n $jwtkey = JWTKEY;\n $token = \\Firebase\\JWT\\JWT::encode($token, $jwtkey);\n\n } else {\n $msg = \"Email or Password is Invalid\";\n $status = 401;\n }\n }\n }\n\n return json_encode(array(\"status\" => $status, \"message\" => $msg, \"token\" => $token));\n }", "public function login(){\n\n $this->checkOptionsAndEnableCors();\n\n $email = $this->input->post('email');\n $password = $this->input->post('password');\n $user = $this->repository->findByEmailAndPassword($email, $password);\n\n if($user){\n echo json_encode($user);\n } else {\n http_response_code(401);\n }\n }", "#[Route('login', name: \"_user_login\", methods: ['POST'])]\n public function login(): JsonResponse\n {\n $user = $this->getUser();\n\n return $this->json([\n 'username' => $user->getUserIdentifier(),\n 'roles' => $user->getRoles()\n ]);\n }", "public function ajaxAction() {\n $result = $this->_auth->authenticate($this->_adapter);\n if ($result->isValid()) {\n $this->_auth->getStorage()->write(array(\"identity\" => $result->getIdentity(), \"user\" => new Josh_Auth_User($this->_type, $result->getMessages())));\n\n $ident = $this->_auth->getIdentity();\n\n $loggedIn = $this->view->partial('partials/userLoggedIn.phtml', array('userObj' => $ident['user']));\n $alert = $this->view->partial('partials/alert.phtml', array('alert' => 'Successful Login', 'alertClass' => 'alert-success'));\n\n $html = array(\"#userButton\" => $loggedIn, \"alert\" => $alert);\n $this->jsonResponse('success', 200, $html);\n } else {\n $errorMessage = $result->getMessages();\n $alert = $this->view->partial('partials/alert.phtml', array('alert' => $errorMessage['error'], 'alertClass' => 'alert-error'));\n\n $html = array(\"alert\" => $alert);\n $this->jsonResponse('error', 401, $html, $errorMessage['error']);\n }\n }", "public function print_login() {\n $returnurl = new moodle_url('/repository/repository_callback.php');\n $returnurl->param('callback', 'yes');\n $returnurl->param('repo_id', $this->id);\n $returnurl->param('sesskey', sesskey());\n\n $url = new moodle_url($this->client->createAuthUrl());\n $url->param('state', $returnurl->out_as_local_url(false));\n if ($this->options['ajax']) {\n $popup = new stdClass();\n $popup->type = 'popup';\n $popup->url = $url->out(false);\n return array('login' => array($popup));\n } else {\n echo '<a target=\"_blank\" href=\"'.$url->out(false).'\">'.get_string('login', 'repository').'</a>';\n }\n }", "public function loginAction()\n {\n Lb_Points_Helper_Data::debug_log(\"Login :\".$_POST['txtCardNumber'], true);\n $txtCardNumber = $_POST['txtCardNumber'];\n $result = Lb_Points_Helper_Data::verifyUser($txtCardNumber);\n echo json_encode($result);\n die;\n //echo \"You have logged in successfully.\";\n }", "public function user()\n\t{\n\n\t\t$user = $this->current_user ? $this->current_user : $this->ion_auth->get_user();\n\n\t\techo json_encode($user);die;\n\t}", "public function echoJson() {\r\n header(\"Content-type: application/json;\");\r\n echo $this->getResult();\r\n }", "public function actionUserLogin()\n {\n $result = array();\n if (!$this->_checkAuth())\n {\n $result['status'] = 'Error';\n $result['message'] = '邮箱或密码错误';\n }\n else\n {\n // TODO: using transactions\n $user = User::model()->find('LOWER(email)=?', array(strtolower($_SERVER['HTTP_USERNAME'])));\n\n $result['status'] = 'OK';\n $result['user'] = $user;\n }\n\n echo CJSON::encode($result);\n Yii::app()->end();\n }", "public function JSONreturn()\n\t{\n\t\techo json_encode( $this->json_return );\n\t}", "public function setOnLoginRequest()\n {\n $origin = $this->getOrigin();\n if ($this->originIsValid($origin)) {\n header('Access-Control-Allow-Origin: ' . $this->request->server->get('HTTP_ORIGIN'));\n header('Content-Type: application/json');\n header('Access-Control-Allow-Credentials: true');\n\n if ($this->request->get('email') && $this->request->get('password')) {\n $email = $this->request->get('email');\n $password = $this->request->get('password');\n\n $query = \\Database::$pdo->prepare(\"SELECT * FROM users WHERE email = ?\");\n $query->execute(array($email));\n $user = $query->fetch();\n if ($user && \\ModuleSSO::verifyPasswordHash($password, $user['password'])) {\n $this->setOrUpdateSSOCookie($user['id']);\n $token = (new JWT($this->getDomain()))->generate(array('uid' => $user['id']));\n\n //JsonResponse or json_encode does not work here\n echo '{\"status\":\"ok\",\"' . \\ModuleSSO::TOKEN_KEY . '\":\"' . $token . '\"}';\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"user_not_found\"))->send();\n }\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"bad_login\"))->send();\n }\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"http_origin_not_set_or_invalid\"))->send();\n }\n }", "function login(){\r\n\r\n $data = array (\"key_name\" => array(\"tom\", \"an\", \"bob\"), \"key_age\" => array(\"1\", \"10\", \"12\"));\r\n\r\n echo json_encode($data); //json encode the array to turn it into a string (passable format)\r\n }", "public function login()\n {\n return response()->json(['message' => 'this works']);\n }", "public function login()\n {\n $credentials = request(['email', 'password']);\n if (!$token = auth()->attempt($credentials)) {\n return response()->json(['error' => 'Unauthorized'], 401);\n }\n /*echo json_encode(auth()->user());\n echo json_encode($this->respondWithToken($token));*/\n\t $response = array();\n\t if(auth()->user()->privilegios == '1'){\n\t\t \n\t\t\t$response = $this->allAccess($token);\t\t\n\t\t\n\t }else{\n\t\t \n\t\t $response = $this->ConfigurableAccess($token);\n\t\t \n\t }\t \n //return $this->respondWithToken($token);\n return response()->json($response);\n }", "public function login(): \\Illuminate\\Http\\JsonResponse\n {\n $user = $this->user->getUserByPhone(\\request('phone'));\n if ($user && password_verify(\\request('password'), $user->password)) {\n $user['password'] = null;\n $token = auth('api')->login($user);\n return $this->apiResponse(['token' => $token],0,'登录成功');\n } else {\n return $this->apiResponse('', 1, '用户名或密码错误');\n }\n }", "public function actionLogin()\n {\n \\Yii::$app->response->format = Response::FORMAT_JSON;\n\n if(Yii::$app->request->isPost) {\n\n $model = new LoginForm();\n\n\n if ($model->load(Yii::$app->getRequest()->getBodyParams(), '') && $model->login()) {\n\n return ['status'=> 'success', 'access_token' => Yii::$app->user->identity->getAuthKey()];\n } else {\n\n return ['status' => 'error', 'message' => 'Wrong username or password'];;\n }\n\n }\n\n\n return ['status' => 'wrong', 'message' => 'Wrong HTTP method, POST needed'];\n }", "function login() {\n /**\n * This array will hold the errors we found\n */\n $errors = [];\n\n /**\n * Check whether a POST request was made\n * If a POST request was made, we can authorize and authenticate the user\n */\n if($_POST) {\n /**\n * Decode the received data to associative array\n */\n $data = json_decode($_POST[\"data\"], true);\n\n /**\n * Check whether user name and password were inputed\n */\n if(!$data[\"userName\"]) {\n $errors[] = \"Моля, въведете потребителско име.\";\n }\n\n if(!$data[\"password\"]) {\n $errors[] = \"Моля, въведете парола.\";\n }\n\n /** \n * If the user name and password were inputed we can validate them\n */\n if($data[\"userName\"] && $data[\"password\"]) {\n $user = new User($data[\"userName\"], $data[\"password\"]);\n $isValid = $user->isValid();\n\n /**\n * If the inputed user name and password were valid, we can store the to the session\n */\n if($isValid[\"success\"]){\n $_SESSION[\"userName\"] = $user->getUsername();\n $_SESSION[\"password\"] = $user->getPassword();\n } else {\n $errors[] = $isValid[\"error\"];\n }\n }\n \n $response;\n\n if($errors) {\n $response = [\"success\" => false, \"data\" => $errors];\n } else {\n $response = [\"success\" => true];\n }\n\n /**\n * Return response to the user\n */\n echo json_encode($response);\n } else {\n echo json_encode(array(\"succes\" => false, \"error\" => \"Не е изпратена правилна заявка\"));\n }\n }", "public function adminlogin(){\n\n \t return json_encode(User::All());\n }", "public function toJson() {\n\t\t\treturn json_encode(array(\n\t\t\t\t'username' => $this->username,\n\t\t\t\t'lastLogin' => $this->lastLogin\n\t\t\t));\n\t\t}", "public function showAuth()\n {\n $authUser = Auth::user();\n return response()->json($authUser);\n }", "public function login()\n {\n $p=$this->input->post();\n\n $email=$p['user_email'];\n $password=$p['user_password'];\n\n $rs=$this->um->login($email,$password);\n\n $msg=array();\n\n if($rs!='')\n {\n $id=$rs->user_id;\n\n $msg['alert']='success';\n $msg['link_to']='home-page';\n $msg['user_id']=$id;\n }\n else\n {\n $msg['alert']='';\n $msg['notify']='Incorrect email and password';\n }\n\n echo json_encode($msg);\n }", "function login() {\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\t\t\t$password = $_REQUEST['password'];\n\n\t\t\tinclude_once(\"login.php\");\n\n\t\t\t$log = new login();\n\t\t\t$authenticate = $log->userLogin($username, $password);\n\n\t\t\t// checking if bookings have been gotten from database\n\t\t\tif (!$authenticate) {\n\t\t\t echo '{\"result\":0,\"message\":\"Error authenticating\"}';\n\t\t\t return;\n\t\t\t}\n\n\t\t\t$row = $log->fetch();\n\t\t\tif (!$row) {\n\t\t\t echo '{\"result\":0, \"message\":\"username or password is wrong\"}';\n\t\t\t return;\n\t\t\t} else {\n\t\t\t\techo '{\"result\":1,\"userInfo\": ';echo json_encode($row);echo '}'; \n\t\t\t}\n\t\t}\n\t}", "public function loginUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$login = Application_Model_User::loginUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($login) {\n\t\t\t\t\t\techo json_encode($login);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}", "public function api_login_as_tourist(){\n\n \t$username = $this->input->post('username');\n $password = md5($this->input->post('password'));\n\n $user_id = $this->login_model->api_login_as_tourist($username,$password);\n\n if($user_id){\n\t\t $json_data['res'] = $user_id;\n\t\t echo json_encode($json_data);\n\t\t }else{\n\t\t $json_data['res'] = '0';\n\t\t echo json_encode($json_data);\n\t\t }\n }", "function loginAPIResponse(){\n \n $authentication = new Authentication();\n\n if(isset($_POST['username'], $_POST['password'])){\n \n $username = $_POST['username'];\n $password = $_POST['password'];\n\n $validaton = $authentication->login($username, $password);\n\n //Invalid credentials\n if($validaton === LoginConstants::INVALID_CREDENTIALS){\n \n $return = array(\n 'status' => 401 ,\n 'message' => \"Invalid credentials!\"\n );\n\n http_response_code(401);\n\n }\n //User is locked out\n else if ($validaton === LoginConstants::TOO_MANY_BAD_LOGINS){\n\n $return = array(\n 'status' => 403 ,\n 'message' => \"Unable to login please try again later.\"\n );\n\n http_response_code(403);\n\n }\n //Credentials were correct and user is logged in\n else {\n\n $return = array(\n 'status' => 200 ,\n 'message' => \"Login for $username was successful.\"\n );\n\n http_response_code(200);\n\n }\n\n }\n else {\n\n $return = array(\n 'status' => 400,\n 'message' => \"Missing params to post.\"\n );\n\n http_response_code(400);\n\n }\n\n //Send back response to client. \n print_r(json_encode($return));\n\n}", "function loggedInAPIResponse(){\n \n $authentication = new Authentication();\n\n $user = $authentication->checkLoggedIn(); \n \n if($user != null){\n\n $return = array(\n 'status' => 200,\n 'message' => \"There is a user logged in\",\n 'username' => $user->getUsername()\n );\n\n http_response_code(200);\n \n }\n //Means the user is null \n else {\n\n $return = array(\n 'status' => 401 ,\n 'message' => \"There is no user logged in\"\n );\n\n http_response_code(401);\n\n }\n\n //Send back response to client. \n print_r(json_encode($return));\n\n}", "function validateUserLogin()\n\t{\n\t\t$user=JFactory::getUser();\n\t\t$uid=$user->id;\n\t\t$response['validate']=new stdclass;\n\t\tif(!$uid)//user logged out\n\t\t{\n\t\t\t$response['validate']->error=1;\n\t\t\t$response['validate']->error_msg=JText::_('COM_JBOLO_UNAUTHORZIED_REQUEST');\n\t\t\t//output json response\n\t\t\theader('Content-type: application/json');\n\t\t\techo json_encode($response);\n\t\t\tjexit();\n\t\t}\n\t\treturn $response;\n\t}", "public function currentLogin() {\n $auth = Auth::user()->id;\n $user = User::find($auth);\n if(!$user) return response()->json(['message' => 'No record found!', 'status' => false], 404);\n return response()->json(['user' => $user, 'status' => true], 200); \n }", "public function login(){\n\t\t//$this->output->enable_profiler(TRUE);\n\n\t\tif (($emailId = $this->input->get_post('emailId')) && ($password = $this->input->get_post('password'))) {\n \n $data = array(\n 'email' => $emailId,\n 'password' => $password\n );\n \n $ret = $this->Lootel_model->login($data);\n \n if($ret){\n\t\t\t\n\t\t\t\t$response = array(\"status\"=>true,\"message\"=>\"Success\",$ret);\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Record not found\");\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Required parameter not found\");\n\t\t}\n\t\techo json_encode($response);\n\t\n }", "public function postLoginAction()\n {\n //get input\n $inputs = $this->getPostInput();\n\n //define default\n $default = [\n 'status' => 'active'\n ];\n\n // Validate input\n $params = $this->myValidate->validateApi($this->userLogin, $default, $inputs);\n\n if (isset($params['validate_error']))\n {\n //Validate error\n return $this->responseError($params['validate_error'], '/users');\n }\n\n //process user login\n $result = $this->userService->checkLogin($params);\n\n //Check response error\n if (!$result['success'])\n {\n //process error\n return $this->responseError($result['message'], '/users');\n }\n\n //return data\n $encoder = $this->createEncoder($this->modelName, $this->schemaName);\n\n return $this->response($encoder, $result['data']);\n }", "public function userInfo()\n {\n $this->startBrokerSession();\n $user = null;\n\n $userId = $this->getSessionData('sso_user');\n\n if ($userId) {\n $user = $this->getUserInfo($userId);\n if (!$user) return $this->fail(\"User not found\", 500); // Shouldn't happen\n }\n\n header('Content-type: application/json; charset=UTF-8');\n echo json_encode($user);\n }", "function showOutput() {\n $output = json_encode($this->data);\n echo $output;\n }", "public function index() {\n\t\t$json = array ();\n\t\t\n\t\tunset ( $this->session->data ['app_id'] );\n\t\t\n\t\t$data = json_decode ( file_get_contents ( 'php://input' ), true );\n\t\t$keys = array (\n\t\t\t\t'username',\n\t\t\t\t'password' \n\t\t);\n\t\t\n\t\tforeach ( $keys as $key ) {\n\t\t\tif (! isset ( $this->request->post [$key] )) {\n\t\t\t\t$this->request->post [$key] = '';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$username = ($this->request->post ['username'] ? $this->request->post ['username'] : (isset ( $data ['username'] ) ? $data ['username'] : ''));\n\t\t$password = ($this->request->post ['password'] ? $this->request->post ['password'] : (isset ( $data ['password'] ) ? $data ['password'] : ''));\n\t\t\n\t\tif ($this->customer->login ( $username, $password )) {\n\t\t\t\n\t\t\t$this->session->data ['app_id'] = sha1 ( $this->customer->getId () );\n\t\t\t\n\t\t\t$json ['cookie'] = $this->session->getId ();\n\t\t\t\n\t\t\t$json ['success'] = \"1\";\n\t\t} else {\n\t\t\t$json ['success'] = \"0\";\n\t\t}\n\t\t\n\t\t$this->response->addHeader ( 'Content-Type: application/json' );\n\t\t$this->response->setOutput ( json_encode ( $json ) );\n\t}", "public function please_login()\n {\n echo json_encode(array(\"status\"=>\"success\", \"msg\"=>\"Naaaa\"));\n die();\n }", "function getAllAdminLogins() {\n $request = $_GET;\n $result = $this->Administration_login_model->get_all_administration_logins($request, array());\n echo json_encode($result);\n exit;\n }", "public function UserListDetails()\n{\nglobal $dbObj,$common;\n\t\t\t\n$auth_token = $common->replaceEmpty('auth_token','');\n\t\t\t\n$result= array();\n\t\t\t \n if($action='userlist'){\n\t\t\t\t \n $sql= $dbObj->runQuery(\"select * from user where auth_token='\".$auth_token.\"' \");\n\t\t\n$num_row = mysql_num_rows($sql); \nif($num_row>0){\nwhile($logindetails = mysql_fetch_assoc($sql)) {\n$result = $logindetails;\n } \n \nheader('Content-Type: application/json');\n\t\t\t\necho json_encode($result);\t \t\t\t\t\n \n}\n\n\nelse {\n$results[] = \"No User List\";\necho json_encode($results);\n\t\t\t \n}\n\t\t\t\n}\n\n}", "public function showLoginForm(): Response\n {\n return $this->render('login.html');\n }", "public function outputAsJson()\n {\n header('Content-type: application/json');\n echo json_encode($this->result());\n }", "public function login()\n\t{\n\t\t$input = $this->input->post();\n\n\t\t$username = $this->db->escape_str($input['USR']);\n\t\t$password = $this->db->escape_str($input['PSW']);\n\n\t\t$result = array();\n\n\t\tif(isset($username) && isset($password)){\n\n\t\t\t$this->db->select('id, count(*) as total');\n\t\t\t$query = $this->db->get_where(' tb_user',array('username' => $username,'password' => $password), 1 );\n\n\t\t\t$data = $query->result_array();\n\n\t\t\t$total = $data[0]['total'];\n\t\t\t$user_id = $data[0]['id'];\n\n\t\t\tif( $total > 0 ){\n\n\t\t\t\t$this->session->set_userdata(array('is_login' => true));\n\t\t\t\t$this->session->set_userdata(array('user_id' => $user_id));\n\t\t\t\t$this->session->set_userdata(array('user_name' => $username ));\n\t\t\t\t$result['rs'] = true;//array('rs' => true);\n\n\t\t\t}else{\n\t\t\t\t$result = array('rs' => false, 'msg' => \"Login incorrect !\");\n\t\t\t}\n\n\t\t}else{\n\t\t\t$result = array('rs' => false, 'msg' => \"Wrong Solution Login\");\n\t\t}\n\n\t\techo json_encode($result);\n\t}", "public static function printJSONResult($result) {\n\t\techo \"{\";\n\t\tif (count(PNApplication::$errors) > 0) {\n\t\t\techo \"\\\"errors\\\":[\";\n\t\t\t$first = true;\n\t\t\tforeach (PNApplication::$errors as $e) {\n\t\t\t\tif ($first) $first = false; else echo \",\";\n\t\t\t\techo json_encode($e);\n\t\t\t}\n\t\t\techo \"],\";\n\t\t}\n\t\tif (count(PNApplication::$warnings) > 0) {\n\t\t\techo \"\\\"warnings\\\":[\";\n\t\t\t$first = true;\n\t\t\tforeach (PNApplication::$warnings as $e) {\n\t\t\t\tif ($first) $first = false; else echo \",\";\n\t\t\t\techo json_encode($e);\n\t\t\t}\n\t\t\techo \"],\";\n\t\t}\n\t\techo \"\\\"result\\\":\";\n\t\tif ($result === null) echo \"null\";\n\t\telse {\n\t\t\tif (count(PNApplication::$errors) == 0)\n\t\t\t\techo $result;\n\t\t\telse {\n\t\t\t\t// check the result is a valid JSON, as it may be corrupted due to errors\n\t\t\t\t$res = json_normalize($result);\n\t\t\t\t$res = json_decode($res, true);\n\t\t\t\techo json_encode($res);\n\t\t\t}\n\t\t}\n\t\techo \"}\";\n\t}", "public function logout()\n\t{\n\t\t$arr_result = array();\n\t\t$this->session->unset_userdata('is_login');\n\t\t$this->session->unset_userdata('user_id');\n\t\t$this->session->unset_userdata('user_name');\n\t\t$arr_result['rs'] = true;\n\n\t\techo json_encode($arr_result);\n\t}", "public function getUser()\n {\n //Auth::checkAuthentication();\n \n $json = array(\n 'user_name' => Session::get('user_name'),\n 'user_email' => Session::get('user_email'),\n 'user_gravatar_image_url' => Session::get('user_gravatar_image_url'),\n 'user_avatar_file' => Session::get('user_avatar_file'),\n 'user_account_type' => Session::get('user_account_type')\n );\n \n header(\"Content-Type: application/json\");\n echo json_encode($json);\n }", "public static function chkLogin_wp() {\n\t\theader('Content-Type: application/json');\n\t\t$response = array();\n\t\ttry {\n\t\t\tif ( empty( $_POST['login'] ) ) {\n\t\t\t\tthrow new \\Exception( 'Empty input', 0 );\n\t\t\t}\n\t\t\t$response['login'] = $_POST['login'];\n\t\t\t$l = sanitize_key( $_POST['login'] );\n\t\t\t$response['exists'] = ( username_exists( $l ) !== false );\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$response = array(\n\t\t\t\t'err' => $e->getMessage(),\n\t\t\t);\n\t\t}\n\n\t\tprint json_encode( $response );\n\t\texit();\n\t}", "public function return_json(){\n\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode($this->response));\n\t}", "function submit_login() {\n $email = $this->input->post('username');\n $password = $this->input->post('password');\n \n //Validating login\n $login_status = 'invalid';\n $login_status = $this->mod_users->auth_user($email, $password);\n\n //Replying ajax request with validation response\n echo json_encode($login_status);\n }", "public function api_login_as_guider(){\n \t\n \t$username = $this->input->post('username');\n $password = md5($this->input->post('password'));\n\n $user_id = $this->login_model->api_login_as_guider($username,$password);\n\n if($user_id){\n\t\t $json_data['res'] = $user_id;\n\t\t echo json_encode($json_data);\n\t\t }else{\n\t\t $json_data['res'] = '0';\n\t\t echo json_encode($json_data);\n\t\t }\n\n }", "public function postLogin() {\n\n\t\t// get input parameters\n\t\t//\n\t\t$username = Input::get('username');\n\t\t$password = Input::get('password');\n\n\t\t// validate user\n\t\t//\n\t\t$user = User::getByUsername($username);\n\t\tif ($user) {\n\t\t\tif (User::isValidPassword($password, $user->password)) {\n\t\t\t\tif ($user->hasBeenVerified()) {\n\t\t\t\t\tif ($user->isEnabled()) {\n\t\t\t\t\t\t$userAccount = $user->getUserAccount();\n\t\t\t\t\t\t$userAccount->penultimate_login_date = $userAccount->ultimate_login_date;\n\t\t\t\t\t\t$userAccount->ultimate_login_date = gmdate('Y-m-d H:i:s');\n\t\t\t\t\t\t$userAccount->save();\n\t\t\t\t\t\t$res = Response::json(array('user_uid' => $user->user_uid));\n\t\t\t\t\t\tSession::set('timestamp', time());\n\t\t\t\t\t\tSession::set('user_uid', $user->user_uid);\n\t\t\t\t\t\treturn $res;\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn Response::make('User has not been approved.', 401);\n\t\t\t\t} else\n\t\t\t\t\treturn Response::make('User email has not been verified.', 401);\n\t\t\t} else\n\t\t\t\treturn Response::make('Incorrect username or password.', 401);\n\t\t} else\n\t\t\treturn Response::make('Incorrect username or password.', 401);\n\n\t\t/*\n\t\t$credentials = array(\n\t\t\t'username' => $username,\n\t\t\t'password' => $password\n\t\t);\n\n\t\tif (Auth::attempt($credentials)) {\n\t\t\treturn Response::json(array(\n\t\t\t\t'user_uid' => $user->uid\n\t\t\t));\n\t\t} else\n\t\t\treturn Response::error('500');\n\t\t*/\n\t}", "function SignIn($data){\n $username_input = $data[\"Username\"];\n $password_input = $data[\"Password\"];\n \n //purpose is to display portfolio\n \n \n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n\n $qry = \"Select * from LogIn where username='$username_input' and password= '$password_input'\";\n $result = $mysqli->query($qry);\n \n $x = 0;\n if($result->num_rows > 0)\n {\n while($row = $result->fetch_assoc()){\n $x++;\n }\n }\n \n var_dump($x);\n $returnObj = array('LogInStatus' => $x);\n var_dump($returnObj);\n return (json_encode($returnObj));\n \n $mysqli.close();\n}", "function loginFail($type) {\n echo json_encode(['code'=>$type]);\n\n exit();\n}", "function doLogin()\n {\n\n //var_dump($sql);exit;\n /*if($res){*/\n //存入session\n /*session_start();\n $_SESSION['user'] = json_encode($res);*/\n\n //展示数据库\n $sql = 'show databases;';\n $res = $GLOBALS['data']->query($sql)->fetchAll();\n foreach ($res as $k=>$v){\n $res[$k] = $v['Database'];\n }\n //var_dump($res);exit;\n\n include \"views/homePage.html\";\n /*}*/\n }", "public function index()\n\t{\n\t\t$data = $this->session->all_userdata();\n\t\t$this->json->output($data);\n\t}", "public function JSONifyResults($result)\n {\n $output = array();\n $output = $result->fetch_all(MYSQLI_ASSOC);\n echo json_encode($output, JSON_PRETTY_PRINT);\n }", "public function auth(){\n return response()->json($this->usuario->api_Auth());\n }", "public function usersLogin() {\n // login uses its own handle\n $httpLogin = $this->_prepareLoginRequest();\n $url = $this->_appendApiKey($this->uriBase . '/users/login.json');\n $data = array('login' => $this->username, 'password' => $this->password);\n return $this->_processRequest($httpLogin, $url, 'post', $data);\n }", "public function response() {\n $response = (object)[\n 'count' => $this->response,\n 'errors' => $this->errors\n ];\n echo json_encode($response); \n }", "function login($user_name,$password){\n\t$conn = db_connect();\n\t$sql_cmd = sprintf(\n\t\t\"SELECT * FROM `User` WHERE `Email` = '%s'\",// and `Password` = '%s'\",\n\t\t$conn->real_escape_string($user_name)\n\t\t//,$conn->real_escape_string($password)\n\t);\n\t$result=$conn->query($sql_cmd);\n\t$response_obj=new stdClass();\n\tif ($result->num_rows > 0) {\n\t\t$row = $result->fetch_assoc();\n\t\t$response_obj->action=\"login\";\n\t\t$response_obj->ID=$row[\"ID\"];\n\t\t$response_obj->FirstName=$row[\"FirstName\"];\n\t\t$response_obj->LastName=$row[\"LastName\"];\n\t\t$response_obj->Active=$row[\"Active\"];\n\t\t$response_obj->Email=$row[\"Email\"];\n\t\t$response_obj->Password=$row[\"Password\"];\n\t\t$response_obj->Permission=$row[\"Permission\"];\n\t\tif(($response_obj->ID!=null) &&\n\t\t ($response_obj->Password==null || $response_obj->Password==$password) &&\n\t\t ($response_obj->Active>=1)\n\t\t ){\n\t\t \tsession_start();\n\t\t\t$_SESSION['user_id'] = $response_obj->ID;\n\t\t\t//$_SESSION['user_name'] = $response_obj->FirstName.\" \".$response_obj->LastName;\n\t\t\t//$_SESSION['user_email']=$response_obj->Email;\n\t\t\t$_SESSION['user_permission']=$response_obj->Permission; \n\t\t\t//$return_msg=\"{'result':'Pass','message':'Hello, \".$response_obj->FirstName.\"'}\";\n\t\t\t$response_obj->result=\"Pass\";\n\t\t\tunset($response_obj->Password);\n\t\t}\n\t\telse{\n\t\t\t//$return_msg=\"{'result':'Fail','message':'Invalid Account or Password!'}\";\n\t\t\t$response_obj->result=\"Fail\";\n\t\t}\n\t}\n\telse{\n\t\t$response_obj->result=\"Fail\";\n\t}\n\t$conn->close();\n\t$strResult = json_encode($response_obj);\n\t//file_put_contents('php://stderr', print_r($strResult.\"\\n\", TRUE)); //************Debug**********\n\techo $strResult;\n}", "protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }", "public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }", "public function authLogin() {\n\t\tif($this->input->post()) {\n\t\t\t$user = $this->input->post('username');\n\t\t\t$pass = $this->input->post('upassword');\n\t\t\t$login = $this->m_user->checkLogin($user, $pass);\n\t\t\tif($login) {\n\t\t\t\t$output = array('success' => true, 'login' => $login);\n\t\t\t\t$this->session->set_userdata('u_login', $login);\n\t\t\t\t$this->session->set_userdata('u_name', $login->username);\n\t\t\t\t$this->session->set_userdata('u_level', $login->level);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t} else {\n\t\t\t\t$output = array('success' => false, 'login' => null);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t}\n\t\t}\n\t}", "public function login()\n\t{\n\t\t$account = $_POST['account'];\n\t\t$password = $_POST['password'];\n\t\t$staff = D('Staff');\n\t\t$sql = \"select * from lib_staff where staff_id = '{$account}' and password='{$password}'\";\n\t\t$return = $staff->query($sql);\n\t\tif ($return) {\n\n\t\t\tcookie('staffAccount', $account, 3600 * 24);\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'success',\n\t\t\t\t'msg' => 'Welcome!'\n\t\t\t));\n\t\t\techo $json;\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function login() {\n return $this->run('login', array());\n }", "public function indexAction()\n {\n\n $user = $this->get('security.token_storage')->getToken()->getUser();\n if (!is_object($user)) {\n return new JsonResponse('user not found or not authenticate ...', Response::HTTP_NOT_FOUND);\n } \n \n $em = $this->getDoctrine()->getManager();\n \n $user = $em->getRepository('AppBundle:User')->findAll();\n \n $serializer = SerializerBuilder::create()->build();\n $user = $serializer->serialize($user, 'json');\n \n return new Response($user, Response::HTTP_OK);\n }", "public function login() {\r\n\r\n $this->load->library('form_validation');\r\n\r\n $this->form_validation->set_rules('password', 'Password', 'required');\r\n $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|callback_get_user['. $this->input->post('password') .']');\r\n\r\n if( $this->form_validation->run() === false ) {\r\n $response = array('status' => 'error', 'message' => 'Email or password incorrect.');\r\n } else {\r\n $response = array('status' => 'success', 'redirect' => '/account/feed');\r\n }\r\n\r\n echo json_encode( $response );\r\n exit;\r\n\r\n }", "public function ajaxLogin()\n {\n if(isset($_POST)){\n\n $email = $_POST['email'];\n $senha = md5($_POST['senha']);\n\n //Busca o usuario\n $busca = $this->usuario->num_rows([\"email\" => $email, \"senha\" => $senha]);\n\n if($busca == 1){\n\n $usuario = $this->usuario->get([\"email\" => $email, \"senha\" => $senha]);\n\n\n $_SESSION['SOS-USUARIO']['NOME'] = $usuario[0]->nome;\n $_SESSION['SOS-USUARIO']['EMAIL'] = $usuario[0]->email;\n\n $dados = array(\n \"tipo\" => true,\n \"mensagem\" => \"Usuário logado com sucesso, aguarde\"\n );\n\n }else{\n\n $dados = array(\n \"tipo\" => false,\n \"mensagem\" => \"Usuário não encontrado!\"\n );\n\n }\n\n }else{\n\n $dados = array(\n \"tipo\" => false,\n \"mensagem\" => \"Dados não enviado\"\n );\n\n }\n\n echo json_encode($dados);\n\n }", "public function getUser() {\n $data = DB::table('users')->select('*', 'id as id_tmp')->get();\n header(\"Content-type: application/json\");\n echo \"{\\\"data\\\":\" . json_encode($data) . \"}\";\n }", "public function response() {\n\n\t\tif (!$this->loginModel->loggedIn()) {\n\n\t\t\t$message = $this->loginMessage;\n\t\t\t$saveUserAferSubmit = $this->saveUserAferSubmit;\n\t\t\t\n\t\t\t$response = $this->generateLoginFormHTML($message);\n\t\t\t\n\t\t} else {\n\n\t\t\tif($this->reload()) {\n\t\t\t\t$message = \"\";\n\t\t\t} else {\n\t\t\t\t$message = \"Welcome\";\n\t\t\t}\n\n\t\t\t$response = $this->generateLogoutButtonHTML($message);\n\t\t\t\n\t\t}\n\n\t\treturn $response;\n\t}", "public function login()\n {\n $response = $this->response();\n $config = [\n ['field' => 'username', 'label' => '', 'rules' => 'trim|required|min_length[4]|max_length[100]|valid_email'],\n ['field' => 'password', 'label' => '', 'rules' => 'trim|required|min_length[8]|max_length[50]'],\n ['field' => 'keepmeconnected', 'label' => '', 'rules' => 'trim|integer'],\n ];\n $this->form_validation->set_rules($config);\n if ($this->form_validation->run() === false) {\n $response[\"errors\"] = $this->form_validation->error_array();\n $this->output->set_output(json_encode($response));\n return false;\n }\n $redirect = false;\n $username = $this->input->post('username');\n $password = $this->input->post('password');\n $keepmeconnected = $this->input->post('keepmeconnected');\n\n $oaut2auth = $this->oauth_server->user_credentials(true);\n if ($oaut2auth->getStatusCode() == 200 && $this->oauth_web->login($username, $password, $oaut2auth->getParameters(), $keepmeconnected == true)) {\n $response = array_merge($response, $oaut2auth->getParameters());\n // if success\n $response[\"msg\"] = \"Successful\";\n $response[\"status\"] = true;\n $response[\"redirect\"] = site_url();\n } else {\n $response[\"errors\"][\"username\"] = $this->lang->line(\"bad_user_pass_combinaison\");\n }\n $this->output->set_output(json_encode($response));\n }", "public function loginPostAction() {\r\n\t\t$email = $this->getRequest()->getPost('email', false);\r\n\t\t$password = $this->getRequest()->getPost('password', false);\r\n\t\t\r\n\t\t$error = '';\r\n\t\tif ($email && $password) {\r\n\t\t\ttry {\r\n\t\t\t\t$this->_getCustomerSession()->login($email, $password);\r\n\t\t\t}\r\n\t\t\tcatch(Exception $ex) {\r\n\t\t\t\t$error = $ex->getMessage();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$result = array();\r\n\t\t$result['error'] = $error;\r\n\t\tif ($error == '') $result['success'] = true;\r\n\t\t$this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t}", "public function ajaxLogin(){\n\n if(isset($_POST)){\n\n $email = $_POST['email'];\n $senha = md5($_POST['senha']);\n\n $dadosUsuario = $this->objUsuario->get([\"email\" => $email, \"senha\" => $senha]);\n $buscaUsuario = $dadosUsuario->fetch(\\PDO::FETCH_OBJ);\n $qtdeUsuario = $dadosUsuario->rowCount();\n\n if($qtdeUsuario == 1){\n\n $_SESSION['usuario']['nome'] = $buscaUsuario->nome;\n $_SESSION['usuario']['email'] = $buscaUsuario->email;\n $_SESSION['usuario']['senha'] = $buscaUsuario->senha;\n\n $dados = [\n \"tipo\" => true,\n \"mensagem\" => \"Logado com sucesso, aguarde...\"\n ];\n\n }else{\n $dados = [\n \"tipo\" => false,\n \"mensagem\" => \"Usuário não encontrado no sistema\"\n ];\n }\n\n }else{\n $dados = [\n \"tipo\" => false,\n \"mensagem\" => \"Dados não enviado\"\n ];\n }\n\n echo json_encode($dados);\n }", "public function authAction() {\n global $config;\n header('Content-Type: application/json');\n if (isset($_POST[\"username\"])&&$_POST[\"username\"]!=\"\"&&isset($_POST[\"password\"])&&$_POST[\"password\"]!=\"\") {\n $username=preg_replace(\"/[^a-zA-Z0-9_\\-]+/\",\"\",$_POST[\"username\"]);\n foreach ($this->users as $user) {\n if ($username==$user[\"username\"]) {\n if (generatePasswordHash($_POST[\"password\"])==$user[\"password\"]) {\n //Valid Password\n $key = get_jwt_key();\n $now=time();\n $token = array(\n \"iss\" => $config[\"serverName\"],\n \"iat\" => $now,\n \"exp\" => $now+intval($config[\"jwtTokenExpire\"]),\n \"user\"=>$user[\"username\"]\n );\n $jwt = JWT::encode($token, $key);\n echo json_encode(array(\"success\"=>true,\"jwt\"=>$jwt));\n return;\n } else {\n echo json_encode(array(\"success\"=>false,\"message\"=>\"invalid password\"));\n return;\n }\n }\n }\n echo json_encode(array(\"success\"=>false,\"message\"=>\"user not found\"));\n return;\n } else {\n echo json_encode(array(\"success\"=>false,\"message\"=>\"missing username/password fields\"));\n return;\n }\n }", "public function userAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ($loginUser) {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'userId' => $loginUser->getId(),\n 'username' => $loginUser->getUsername(),\n 'authenticated' => true,\n 'userType' => $loginUser->getUserType(),\n 'emailAddress' => $loginUser->getEmailAddress(),\n 'firstName' => $loginUser->getFirstName(),\n 'lastName' => $loginUser->getLastName(),\n 'birthdate' => $loginUser->getBirthdate(),\n 'isVerified' => method_exists(($loginUser), 'isVerified') ? $loginUser->isVerified() : null,\n 'isEmailVerified' => method_exists(($loginUser), 'isEmailVerified') ? $loginUser->isEmailVerified() : null,\n 'status' => $loginUser->getStatus(),\n 'uuid' => $loginUser->getUUID(),\n // 'imageId' => $loginUser->getProfileImageId(),\n // 'coverImageType' => $loginUser->getProfileCoverImageType(),\n // 'coverImageId' => $loginUser->getProfileCoverImageId(),\n // 'coverPresetImageId' => $loginUser->getProfileCoverPresetImageId(),\n // 'coverTing' => $loginUser->getProfileCoverTint(),\n ));\n exit();\n } else {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'authenticated' => false,\n ));\n exit();\n }\n }", "function login(){\n\t\t$apikey = $this->get_api_key();\n\t\t$apisecret = $this->get_api_secret();\n\t\t$authorization = $this->get_authorization();\n\t\t$user = new \\gcalc\\db\\api_user( $apikey, $apisecret, $authorization );\n\t\tif ( $user->login() ) {\n\t\t\t$credetials = $user->get_credentials();\t\t\t\t\n\t\t} else {\n\t\t\t$credetials = array(\n\t\t\t\t'login' => 'anonymous',\n\t\t\t\t'access_level' => 0\n\t\t\t);\n\t\t}\n\t\treturn $credetials;\n\t}", "function output($result, $error) {\n\t$return = array();\n\tif (isset($result)) $return['result'] = $result;\n\tif (isset($error)) $return['error'] = $error;\n\techo json_encode($return);\n}", "public function get(){\n\t\t\treturn Response::json(Auth::user());\n\t\t}", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "function normalLogin($POSTdata) {\n \n //Init variables\n $uname = null;\n $upass = null;\n $umail = null;\n $uid = null;\n $error = array();\n $data = array();\n $output = array();\n \n /*\n ==========================\n 1° step : get/validate data\n ===========================\n */\n //Get usermail\n if(isset($POSTdata['usermail']))\n $umail = $POSTdata['usermail'];\n else $error[] = 'No usermail';\n\n if($umail)\n if(!Validate::isEmail($umail))\n $error[] = 'Invalid usermail';\n \n //Get password\n if(isset($POSTdata['userpassword']))\n $upass = $POSTdata['userpassword'];\n else $error[] = 'No userpassword';\n \n if($upass)\n if(!Validate::isPasswd($upass))\n $error[] = 'Invalid password';\n \n if(sizeof($error)) {\n $output['success'] = 'invalid fields';\n print json_encode($output);\n exit();\n }\n \n \n /*\n ======================\n 2° step : handle data\n ======================\n */\n $data = Db::q('SELECT * FROM '._DB_PREFIX_.'users WHERE playermail = \"'.mysql_escape_string($umail).'\" AND playerpassword = \"'.md5($upass).'\" LIMIT 1');\n if(!sizeof($data)) {\n $output['success'] = 'invalid user 1';\n print json_encode($output);\n die();\n }\n \n if($data[0]['playernick']) \n $output['success'] = 'success';\n else\n {\n $output['success'] = 'invalid user 2';\n print json_encode($output);\n die();\n }\n \n //Start session\n $_SESSION['playernick'] = $data[0]['playernick'];\n $_SESSION['playerid'] = $data[0]['id'];\n $_SESSION['playermail'] = $umail;\n $_SESSION['ltype'] = 'normal';\n \n //Return data\n print json_encode($output);\n die();\n}", "public function accessList()\n {\n $this->startBrokerSession();\n $user = null;\n\n $username = $this->getSessionData('sso_user');\n\n if ($username) {\n $accessList = $this->getAccessList($username);\n } else {\n return $this->fail(\"User not found\", 500); // Shouldn't happen\n }\n\n header('Content-type: application/json; charset=UTF-8');\n echo json_encode($accessList);\n }", "public function logins_check_user_login()\n\t{\n\t\t$login = array();\n\t\t$result = array();\n\t\t$data = array();\n \n\t\t$login[\"username\"] = clean($this->input->post(\"username\"));\t\n\t\t$login[\"password\"] = clean($this->input->post(\"password\"));\n\t\t$data[\"userdata\"] = $this->session->set_userdata(\"tempdata\", strip_slashes($login));\n\t\t\n\t $data = $this->common->authenticateUserLogin($login);\n\t\tif($data)\n\t\t{\n\t\t\t$result = 'success';\n\t\t\t//$result[\"response\"] = '';\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\t$result = 'error';\n\t\t\t//$result[\"response\"] = 'Authentication failed. No username exists';\n\t\t}\n\t\t\n\t\t//$msg_arr = implode(\"|::|\",$result);\n\t\techo json_encode($result);\n\t\tdie;\n\t}", "function login()\n{\n\tglobal $conf, $json, $resout, $db;\n\n\t$username = cRequest::any('_user');\n\t$password = cRequest::any('_pass');\n\t$p = $password;\n\n\t//die(\"_user: $username | _pass: $password\");\n\t\n\tif ((!$password) || (!$username)) {\n\t\t# XXX: Error page\n\t\tdie(\"Username and Password Required\");\n\t}\n\n\t$dbh = $db->open($conf['db']['host'], $conf['db']['user'],\n\t\t\t $conf['db']['passwd'], $conf['db']['name']);\n\n\t$uname = $db->secure($username);\n\t$passwd = sha1($password);\n\n\t$sql = \"select * from {$conf['tbl']['usermap']}\n\t\twhere username='$uname';\";\n\t$ret = $db->query($sql);\n\tif ($ret) {\n\t\t$res = $db->asfetch($ret);\n\t\t$uid = $res['uid'];\n\t\t$actype = $res['actype'];\n\t\tswitch($actype) {\n\t\tcase 'sa':\n\t\t\t$sql = \"select * from {$conf['tbl']['login']}\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tcase 'a':\n\t\t\t$sql = \"select * from {$conf['tbl']['shopinfo']}\n\t\t\t\tleft join {$conf['tbl']['login']} \n\t\t\t\ton({$conf['tbl']['shopinfo']}.sid = \n\t\t\t\t{$conf['tbl']['login']}.uid )\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tcase 'u':\n\t\t\t$sql = \"select * from {$conf['tbl']['profile']}\n\t\t\t\tleft join {$conf['tbl']['login']} \n\t\t\t\ton({$conf['tbl']['profile']}.uid = \n\t\t\t\t{$conf['tbl']['login']}.uid )\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* XXX: ERROR */\n\t\t\tdie(\"[!] Error: No account with Username $uname\");\n\t\t\t/* NOTREACHED */\n\t\t}\n\n\t\t# cmp passwd\n\t\tif ($passwd != $res['passwd']) {\n\t\t\tprint_r($res);\n\t\t\tprint \"Passwords don't match[$passwd | {$res['passwd']}]\";\n\t\t\texit();\n\t\t}\n\n\t\t# get last login\n\t\t$sqll = \"select * from loginhistory where uid='$uid'\";\n\t\t$retl = $db->query($sqll);\n\t\t$resl = $db->asfetch($retl);\n\n\t\t# set up session data\n\t\t$sess = new cSession;\n\t\t$datetime = date('Y/m/d H:i:s');\n\t\t$lastip = cIP::getusrip();\n\t\t$location = cIP::getusrcountry($lastip); # FIXME: need to add ip2ctry dir\n\t\tif (isset($location['country_name'])) {\n\t\t\t$location = $location['country_name'];\n\t\t} else {\n\t\t\t$location = \"Unknown\";\n\t\t}\n\n\t\tif (preg_match('/1996\\/09\\/26 16:00:00/', $resl['lastlogin'], $match)) {\n\t\t\t$ll = $datetime;\n\t\t} else {\n\t\t\t$ll = $resl['lastlogin'];\n\t\t}\n\n\t\tif (preg_match('/0\\.0\\.0\\.0/', $resl['lastip'], $match)) {\n\t\t\t$lip = $lastip;\n\t\t} else {\n\t\t\t$lip = $resl['lastip'];\n\t\t}\n\n\t\t$sess->set('uid', $res['uid']);\n\t\t$sess->set('uname', $username);\n\t\t$sess->set('actype', $actype);\n\t\tif ($actype == 'u') {\n\t\t\t$sess->set('fname', $res['fname']);\n\t\t\t$sess->set('email', $res['email']);\n\t\t}\n\t\tif ($actype == 'a') {\n\t\t\t$sess->set('sname', $res['sname']);\n\t\t\t$sess->set('email', $res['email']);\n\t\t}\n\n\t\t$sess->set('lastlogin', $ll);\n\t\t$sess->set('lastip', $lip);\n\n\t\t# XXX: update login history\n\t\t$sql = \"update {$conf['tbl']['loginhistory']} set lastlogin='$datetime',\n\t\t\tlastip='$lastip', lastlocation='$location'\n\t\t\twhere uid='$uid';\";\n\t\t$db->query($sql);\n\n\t\t$db->close($dbh);\n\t\tunset($db);\n\t\tunset($sess);\n\n\t\theader(\"Location: dashboard.php\");\n\t\texit();\n\t} else {\n\t\t# XXX: Error page\n\t\tdie(\"[!] Fatal Error: No account with Username '$uname'\");\n\t\t/* NOTREACHED */\n\t}\n}", "public function login(LoginAuthRequest $request) : JsonResponse\n {\n $user = (new AuthService())->authUser($request->email, $request->password);\n\n $token = $user->createToken('my-device-token');\n\n $response = [\n \t\t'user' => $user,\n \t\t'token' => $token\n \t];\n\n \treturn response()->json($response, Response::HTTP_OK);\n }", "public function export()\n {\n return $this->connector->exportLoginData();\n }", "public function action_login() {\n try {\n $i = Input::post();\n $auth = new \\Craftpip\\OAuth\\Auth();\n $auth->logout();\n if (\\Auth::instance()\n ->check()\n ) {\n $response = array(\n 'status' => true,\n 'redirect' => dash_url,\n );\n }\n else {\n $user = $auth->getByUsernameEmail($i['email']);\n if (!$user) {\n throw new \\Craftpip\\Exception('The Email or Username is not registered with us.');\n }\n $auth->setId($user['id']);\n\n $a = $auth->login($i['email'], $i['password']);\n if ($a) {\n $isVerified = $auth->getAttr('verified');\n if (!$isVerified) {\n $auth->logout();\n throw new \\Craftpip\\Exception('Your account is not activated, please head to your Email & activate your Gitftp account.');\n }\n\n $response = array(\n 'status' => true,\n 'redirect' => dash_url,\n );\n }\n else {\n throw new \\Craftpip\\Exception('The username & password did not match.');\n }\n }\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n\n echo json_encode($response);\n }", "function login($user, $pass)\n{\n\t$conn = oci_connect('malz', '1Qaz2wsx', '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=db1.chpc.ndsu.nodak.edu)(Port=1521)))(CONNECT_DATA=(SID=cs)))');\n\t\n\t//Select customer with last name from field\n\t$query = 'select accountId, userName from Account where userName = :user';\n\t$results = array();\n\t\n\t$user = '\\\\'.$user.'\\\\';\n\t$stid = oci_parse($conn,$query);\n\toci_bind_by_name($stid, ':user', $user);\n\t//oci_bind_by_name($stid, ':pass', $pass);\n\t$success = oci_execute($stid,OCI_DEFAULT);\n\n\twhile ($row = oci_fetch_array($stid,OCI_ASSOC)) \n\t{\n\t $results[] = $row;\n\t}\n\n\n\techo json_encode($results);\n\toci_free_statement($stid);\n\toci_close($conn);\n}", "function isLoggedIn($loginBoolean){\n echo json_encode((array(\n 'isLoggedIn' => $loginBoolean\n )));\n}", "public function Authecticate()\n{\n\t\n\n global $dbObj,$common;\n\t\t\t\n$username = $common->replaceEmpty('username','');\n$userpassword = $common->replaceEmpty('password','');\n\t\t\t\n$result= array();\n \t\t\t \n if($action='login'){\n\t\t\t\t \n $sql_username =\"SELECT * from ras_users where username = '\".$username.\"' and block = '0' \"; \n $rs_username = $dbObj->runQuery($sql_username);\n \n \tif($rows_username = mysql_fetch_assoc($rs_username)){ \n\t\t $dbpassword = $rows_username['password']; \n\t\t\t\t \n\t\tif(JUserHelper::verifyPassword($userpassword, $rows_username['password'], $rows_username['id'])){\n\t\t\t\n\t\t$datelogged = date('Y-m-d H:i:s');\n\t\t$sqlLog = \"INSERT INTO ras_user_visit_log SET userID='\".$rows_username['id'].\"', useFrom = 'Android', dateLogged='\".$datelogged.\"'\";\n\t\t$dbObj->runQuery($sqlLog);\n\t\t\n\t\t $result[]=$rows_username; \n echo json_encode(array('status'=>'1',$result));\n\t\t }\n\t\t \n\t\t else{\n\t\t\t\t$result[] = \"0\";\n\t\t\t\techo json_encode($result); \n\t\t\t\t}\n\t\t\t\t\n}\n else{\n\t\t\t\t$result[] = \"No Record\";\n\t\t\t\techo json_encode($result); \n\t\t\t\t}\n\n} // action close\n\n}", "function signIn(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\n\t\t\tinclude_once(\"security.php\");\n\t\t\t\n\t\t\tif($this->username == \"\" || $this->password == null){\n\t\t\t\t$json->invalidRequest();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$userInfo = $db->prepare('SELECT * FROM user WHERE Username = :username');\n\t\t\t\t$userInfo->bindParam(':username', $this->username);\n\t\t\t\t$userInfo->execute();\n\t\t\t\t\n\t\t\t\t//Check if user exists\n\t\t\t\tif($userInfo->rowCount() == 0){\n\t\t\t\t\t$json->notFound(\"User\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t//If exists, pull Password hash and verify against inserted password\n\t\t\t\t\tforeach($userInfo as $row) {\n\t\t\t\t\t\tif($row['Password'] === crypt($this->password, $row['Password'])){\n\t\t\t\t\t\t\t//correct username & password combination\n\t\t\t\t\t\t\techo '{ \"User\" : { \"Id\" : '.$row['Id'].', \"Username\" : \"'.$row['Username'].'\", \"Subject\" : '.$row['Subject'].', \"Admin\" : '.$row['Admin'].', \"ApiKey\" : \"'.$row['ApiKey'].'\" } }';\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$json->unauthorizedInvalidPassword();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function userLogin()\n\t{\n\t\t$userName = $_POST['userName'];\n\t\t$password = $_POST['userPassword'];\n\t\t$rememberData = $_POST['rememberData'];\n\n\t\t# Verify if the user currently exists in the Database\n\t\t$result = validateUserCredentials($userName);\n\n\t\tif ($result['status'] == 'COMPLETE')\n\t\t{\n\t\t\t$decryptedPassword = decryptPassword($result['password']);\n\n\t\t\t# Compare the decrypted password with the one provided by the user\n\t\t \tif ($decryptedPassword === $password)\n\t\t \t{\n\t\t \t$response = array(\"status\" => \"COMPLETE\");\n\n\t\t\t # Starting the sesion\n\t\t \tstartSession($result['fName'], $result['lName'], $userName);\n\n\t\t\t # Setting the cookies\n\t\t\t if ($rememberData)\n\t\t\t\t{\n\t\t\t\t\tsetcookie(\"cookieUserName\", $userName);\n\t\t\t \t}\n\t\t\t echo json_encode($response);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdie(json_encode(errors(306)));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode($result));\n\t\t}\n\t}", "public function generateLoginData() {\n $data = $this->getCookieCredentials();\n\n // Create request according to specification.\n $data = array(\n 'payload' => array(\n 'userName' => $data['username'],\n 'password' => $data['password'],\n ),\n 'requestHeader' => array(\n 'businessEntityId' => $this->businessEntityId,\n ),\n );\n\n // Using normal json_encode and not the Drupal one for the unescaped slashes.\n return \"request=\" . json_encode($data, JSON_UNESCAPED_SLASHES);\n }" ]
[ "0.73900574", "0.6807616", "0.6681354", "0.663231", "0.6626077", "0.66252226", "0.6582416", "0.6323892", "0.6282264", "0.6253441", "0.6243655", "0.6230951", "0.62254465", "0.62050563", "0.6196849", "0.6177105", "0.61737764", "0.61737204", "0.6159185", "0.6148827", "0.61296576", "0.6123293", "0.610442", "0.60657746", "0.6049255", "0.6043019", "0.59984314", "0.5992873", "0.59847593", "0.59739107", "0.59693104", "0.59587973", "0.5942813", "0.59426075", "0.5934658", "0.5926045", "0.592201", "0.5917804", "0.5916739", "0.590216", "0.59012455", "0.5900213", "0.58963346", "0.58946204", "0.58912176", "0.5888344", "0.58764845", "0.5876258", "0.5870095", "0.5864699", "0.5861886", "0.5861504", "0.5845274", "0.5830311", "0.58202887", "0.5816437", "0.5807612", "0.57954127", "0.57818604", "0.5781255", "0.5764821", "0.57515055", "0.57476866", "0.5738799", "0.5738137", "0.5729899", "0.5720849", "0.57202095", "0.57151866", "0.5711775", "0.57077986", "0.5707752", "0.5704871", "0.5700858", "0.56907064", "0.56857044", "0.56792533", "0.5679199", "0.5678458", "0.56711245", "0.566989", "0.5669198", "0.56657207", "0.565598", "0.56520694", "0.5649378", "0.56456804", "0.56381285", "0.56378186", "0.5637097", "0.56175345", "0.56140924", "0.5614067", "0.56134385", "0.56128997", "0.56075287", "0.5598086", "0.5591151", "0.5585143", "0.556716", "0.5565489" ]
0.0
-1
Register Convers8 user in Wordpress
function register_wordpress_user($convers8_user, $secret) { $wp_user_id = wp_insert_user(array( 'user_pass' => md5($convers8_user["id"] . $secret), 'user_login' => $convers8_user["id"], // make sure no illegal characters occur in user_nicename, since it is also in the member's URL 'user_nicename' => sanitize_title_with_dashes($convers8_user["firstName"] . '-' . $convers8_user["lastName"]), 'display_name' => $convers8_user["firstName"] . ' ' . $convers8_user["lastName"], 'nickname' => $convers8_user["firstName"] . ' ' . $convers8_user["lastName"], 'first_name' => $convers8_user["firstName"], 'last_name' => $convers8_user["lastName"], 'user_email' => $convers8_user["id"] . '-' . get_option('convers8_websiteid') . '-' . md5($convers8_user["id"] . $secret) . '@users.convers8.eu' )); return $wp_user_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_newUser( $args ) {\n \n global $wp_xmlrpc_server, $wp_roles;\n $wp_xmlrpc_server->escape($args);\n\n $blog_ID = (int) $args[0]; // for future use\n $username = $args[1];\n $password = $args[2];\n $content_struct = $args[3];\n $send_mail = isset( $args[4] ) ? $args[4] : false;\n\n if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )\n return $wp_xmlrpc_server->error;\n\n if ( ! current_user_can( 'create_users' ) )\n return new IXR_Error( 401, __( 'You are not allowed to create users' ) );\n\n // this hold all the user data\n $user_data = array();\n \n $user_data['user_login'] = '';\n if( isset ( $content_struct['user_login'] ) ) {\n\n $user_data['user_login'] = sanitize_user( $content_struct['user_login'] );\n //Remove any non-printable chars from the login string to see if we have ended up with an empty username\n $user_data['user_login'] = trim( $user_data['user_login'] );\n\n }\n\n if( empty ( $user_data['user_login'] ) )\n return new IXR_Error( 403, __( 'Cannot create a user with an empty login name. ' ) );\n if( username_exists ( $user_data['user_login'] ) )\n return new IXR_Error( 403, __( 'This username is already registered.' ) );\n\n //password cannot be empty\n if( empty ( $content_struct['user_pass'] ) )\n return new IXR_Error( 403, __( 'password cannot be empty' ) );\n\n $user_data['user_pass'] = $content_struct['user_pass'];\n\n // check whether email address is valid\n if( ! is_email( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'email id is not valid' ) );\n\n // check whether it is already registered\n if( email_exists( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'This email address is already registered' ) );\n\n $user_data['user_email'] = $content_struct['user_email'];\n\n // If no role is specified default role is used\n $user_data['role'] = get_option('default_role');\n if( isset ( $content_struct['role'] ) ) {\n\n if( ! isset ( $wp_roles ) )\n $wp_roles = new WP_Roles ();\n if( ! array_key_exists( $content_struct['role'], $wp_roles->get_names() ) )\n return new IXR_Error( 403, __( 'The role specified is not valid' ) );\n $user_data['role'] = $content_struct['role'];\n \n }\n\n $user_data['first_name'] = '';\n if( isset ( $content_struct['first_name'] ) )\n $user_data['first_name'] = $content_struct['first_name'];\n\n $user_data['last_name'] = '';\n if( isset ( $content_struct['last_name'] ) )\n $user_data['last_name'] = $content_struct['last_name'];\n\n $user_data['user_url'] = '';\n if( isset ( $content_struct['user_url'] ) )\n $user_data['user_url'] = $content_struct['user_url'];\n\n $user_id = wp_insert_user( $user_data );\n\n if ( is_wp_error( $user_id ) )\n return new IXR_Error( 500, $user_id->get_error_message() );\n\n if ( ! $user_id )\n return new IXR_Error( 500, __( 'Sorry, your entry could not be posted. Something wrong happened.' ) );\n\n if( $send_mail ) {\n \n $subject = \"[\".get_bloginfo('name').\"] Your username and password\";\n $message = \"Username: \".$user_data['user_login'].\"\\nPassword: \".$user_data['user_pass'].\"\\n\".get_bloginfo('siteurl').\"/wp-login.php\";\n wp_mail( $user_data['user_email'], $subject, $message );\n \n }\n\n return strval( $user_id );\n\n}", "function user_register($user_info)\n {\n }", "public function register_user()\n {\n \n return true;\n \n }", "function wpmu_signup_user($user, $user_email, $meta = array())\n {\n }", "function func_bp_core_signup_user($user_id, $user_login, $user_password, $user_email, $usermeta){\n $args = array( 'field' => 'Are You A Coach', 'user_id' => $user_id); \n $_xprofile_coach_yes_no = bp_get_profile_field_data($args); \n if( $_xprofile_coach_yes_no == 'Yes'){ \n\t//change user role to coach \n\t$wp_user = get_user_by('ID', $user_id); \n\t$wp_user->remove_role('subscriber'); \n\t$wp_user->add_role('coach');\n }\n}", "public function register_with_tyk() {\n\t\ttry {\n\t\t\t$tyk = new Tyk_API();\n\t\t\t$user_id = $tyk->post('/portal/developers', array(\n\t\t\t\t'email' => $this->user->user_email,\n\t\t\t\t));\n\t\t\t$this->set_tyk_id($user_id);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\ttrigger_error(sprintf('Could not register user for API: %s', $e->getMessage()), E_USER_WARNING);\n\t\t}\n\t}", "function register_user() {\n\n\t\tif ( ! class_exists( 'QuadMenu' ) ) {\n\t\t\twp_die();\n\t\t}\n\n\t\tif ( ! check_ajax_referer( 'quadmenu', 'nonce', false ) ) {\n\t\t\tQuadMenu::send_json_error( esc_html__( 'Please reload page.', 'quadmenu' ) );\n\t\t}\n\n\t\t$mail = isset( $_POST['mail'] ) ? $_POST['mail'] : false;\n\t\t$pass = isset( $_POST['pass'] ) ? $_POST['pass'] : false;\n\n\t\tif ( empty( $mail ) || ! is_email( $mail ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a valid email address.', 'quadmenu' ) ) );\n\t\t}\n\n\t\tif ( empty( $pass ) ) {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', esc_html__( 'Please provide a password.', 'quadmenu' ) ) );\n\t\t}\n\n\t\t$userdata = array(\n\t\t\t'user_login' => $mail,\n\t\t\t'user_email' => $mail,\n\t\t\t'user_pass' => $pass,\n\t\t);\n\n\t\t$user_id = wp_insert_user( apply_filter( 'ml_qmpext_register_user_userdata', $userdata ) );\n\n\t\tif ( ! is_wp_error( $user_id ) ) {\n\n\t\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t\tif ( $user ) {\n\t\t\t\twp_set_current_user( $user_id, $user->user_login );\n\t\t\t\twp_set_auth_cookie( $user_id );\n\t\t\t\tdo_action( 'wp_login', $user->user_login, $user );\n\t\t\t}\n\n\t\t\tQuadMenu::send_json_success( sprintf( '<div class=\"quadmenu-alert alert-success\">%s</div>', esc_html__( 'Welcome! Your user have been created.', 'quadmenu' ) ) );\n\t\t} else {\n\t\t\tQuadMenu::send_json_error( sprintf( '<div class=\"quadmenu-alert alert-danger\">%s</div>', $user_id->get_error_message() ) );\n\t\t}\n\t\twp_die();\n\t}", "public function registerUser($data);", "public function register() {\n\t\tif ($this -> Auth -> loggedIn()) {\n\t\t\t$this -> Session -> setFlash('You are already registered.');\n\t\t\t$this -> redirect($this -> referer());\n\t\t}\n\t\tif ($this -> request -> is('post')) {\n\t\t\t$this -> User -> create();\n\t\t\t$data = $this -> request -> data;\n\t\t\t$data['User']['public_key'] = uniqid();\n\t\t\t$data['User']['role'] = \"user\";\n\t\t\t$data['User']['api_key'] = md5(microtime().rand());\n\t\t\tif ($this -> User -> save($data)) {\n\t\t\t\t$this -> Session -> setFlash(__('You have succesfully registered. Now you can login.'));\n\t\t\t\t$this -> redirect('/users/login');\n\t\t\t} else {\n\t\t\t\t$this -> Session -> setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t}\n\n\t\t$this -> set('title_for_layout', 'User Registration');\n\t}", "function add_role_and_user_for_Zabbio_on_plugin_activate() {\n add_role(\n 'ZabbioApp',\n __( 'ZabbioApp' ),\n array(\n 'create_posts' => true,\n 'edit_others_posts' => true,\n 'edit_posts' => true,\n 'edit_published_posts' => true,\n 'list_users' => true,\n 'manage_categories' => true,\n 'publish_posts' => true,\n 'read' => true\n )\n );\n\n $user_name = 'ZabbioApp';\n $user_email = '';\n if ( !username_exists($user_name) ) {\n $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false );\n $user_id = wp_insert_user( \n array(\n 'user_pass' => $random_password,\n 'user_login' => $user_name,\n 'role' => 'ZabbioApp',\n 'user_email' => ''\n )\n );\n } else {\n $random_password = __('User already exists. Password inherited.');\n }\n}", "public function register($u) {\n $this->user_id = $u; \n }", "public function on_registration( $user_id ) {\n\t\tmnetwork_add_user( $user_id, get_current_blog_id() );\n\t}", "public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }", "function __construct($args) {\n\t\t$this->register_args = $args;\n\t\t$this->default_fields = array(\n\t\t\t'username' => array( // the key will be used in the label for attribute and the input name\n\t\t\t\t'title' => __('Username', 'cell-user'), // the label text\n\t\t\t\t'type' => 'text', // the input type or textarea\n\t\t\t\t'required' => 1, // is it required? 1 or 0\n\t\t\t\t'required_text' => __('(required)', 'cell-user'),\n\t\t\t\t'note' =>__('Use 3 - 15 character lowercase, numbers and \\'- \\' only', 'cell-user') // does it need a helper note, use inline html tags only\n\t\t\t),\n\t\t\t'email' => array(\n\t\t\t\t'title' => __('Email', 'cell-user'),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'required' => 1,\n\t\t\t\t'note' => ''\n\t\t\t),\n\t\t\t'password' => array(\n\t\t\t\t'title' => __('Password', 'cell-user'),\n\t\t\t\t'type' => 'password',\n\t\t\t\t'required' => 1,\n\t\t\t\t'note' => ''\n\t\t\t)\n\t\t);\n\n\n\t\t// add a shortcode\n\t\tadd_shortcode('cell-user-register', array( $this, 'shortcode_output'));\n\n\t\t// add a redirect for logged out user\n\t\tadd_action('template_redirect', array( $this, 'redirect_user'));\n\n\t\t// add login ajax handler function\n\t\tadd_action('wp_ajax_nopriv_frontend_registration', array( $this, 'process_frontend_registration'));\n\n\t\t// add login ajax handler function\n\t\tadd_action('wp_ajax_nopriv_confirm_registration', array( $this, 'process_confirm_registration'));\n\n\t\t// if this \n\t\tif (isset($this->register_args['captcha'])){\n\t\t\tadd_action('wp_ajax_nopriv_get_captcha_image', array( $this, 'get_captcha_image'));\t\n\t\t}\t\t\n\n\t\t// flush rewrite on registration\n\t\tadd_action( 'wp_loaded', array($this, 'registration_flush_rewrite'));\n\n\t}", "public function registerNewUser($fullName,$email,$password);", "function ft_wp_user_register($user_id)\r\n{\r\n $role = ft_wp_get_wpuser_role($user_id);\r\n\r\n $formtools_account_id = \"\";\r\n if (!empty($role))\r\n {\r\n // now get the Form Tools account ID associated with this role type\r\n $access_level = \"formtoolsaccess__{$role}\";\r\n $formtools_account_id = get_option($access_level);\r\n }\r\n\r\n update_usermeta($user_id, 'form_tools_access', $formtools_account_id);\r\n}", "function stm_user_registration_save( $user_id ) {\r\n\t$post_title = '';\r\n if ( isset( $_POST['first_name'] ) )\r\n\t\t$post_title = $_POST['first_name'];\r\n\telse{\r\n\t\t$user_info = get_userdata($user_id);\r\n\t\t//$username = $user_info->user_login;\r\n\t\t$first_name = $user_info->first_name;\r\n\t\t$last_name = $user_info->last_name;\r\n\t\t$post_title = $first_name . ' ' . $last_name;\r\n\t}\r\n\r\n\r\n\t$defaults = array(\r\n\t\t\t\t 'post_type' => 'ocbmembers',\r\n\t\t\t\t 'post_title' => $post_title,\r\n\t\t\t\t 'post_content' => 'Replace with your content.',\r\n\t\t\t\t 'post_status' => 'publish'\r\n\t\t\t\t);\r\n\tif($post_id = wp_insert_post( $defaults )) {\r\n\t\t// add to user profile\r\n\t\tadd_post_meta($post_id, '_stm_user_id', $user_id);\r\n\r\n\t\t//add user profile to post\r\n\t\tupdate_user_meta( $user_id, '_stm_profile_post_id', $post_id );\r\n\r\n\t\tupdate_user_meta( $user_id, 'show_admin_bar_front', 'false' );\r\n\r\n\t}\r\n\r\n}", "public function action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n '[email protected]',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }", "function ajax_reg_new_user()\n{\n\n // Verify nonce\n check_ajax_referer('woocommerce-register', 'security');\n\n // Nonce is checked, get the POST data and sign user on\n $info = array();\n $info['user_login'] = $_POST['email'];\n $info['user_pass'] = $_POST['password'];\n $info['user_email'] = $_POST['email'];\n\n if (!$_POST['email']) {\n echo json_encode(array('registered' => false, 'message' => 'Whoops, Please enter an email address'));\n die();\n }\n\n if (!$_POST['password']) {\n echo json_encode(array('registered' => false, 'message' => 'Hmm... Please enter a password'));\n die();\n }\n\n $user_signup = wp_insert_user($info);\n\n if (is_wp_error($user_signup)) {\n\n echo json_encode(array('registered' => false, 'message' => 'Uh oh! ' . $user_signup->get_error_message()));\n\n } else {\n\n echo json_encode(array('registered' => true, 'message' => __('Hooray, login successful, redirecting...')));\n }\n\n die();\n}", "public function users_register_pre_add_user($h)\n {\n if (isset($h->vars['reg_flags'])) {\n $h->currentUser->role = 'pending';\n }\n }", "private function register(): void\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n }", "function wp_new_user_notification($user_id, $plaintext_pass = '')\n {\n }", "public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }", "function give_register_and_login_new_user( $user_data = array() ) {\n\t// Verify the array.\n\tif ( empty( $user_data ) ) {\n\t\treturn - 1;\n\t}\n\n\tif ( give_get_errors() ) {\n\t\treturn - 1;\n\t}\n\n\t$user_args = apply_filters( 'give_insert_user_args', array(\n\t\t'user_login' => isset( $user_data['user_login'] ) ? $user_data['user_login'] : '',\n\t\t'user_pass' => isset( $user_data['user_pass'] ) ? $user_data['user_pass'] : '',\n\t\t'user_email' => isset( $user_data['user_email'] ) ? $user_data['user_email'] : '',\n\t\t'first_name' => isset( $user_data['user_first'] ) ? $user_data['user_first'] : '',\n\t\t'last_name' => isset( $user_data['user_last'] ) ? $user_data['user_last'] : '',\n\t\t'user_registered' => date( 'Y-m-d H:i:s' ),\n\t\t'role' => give_get_option( 'donor_default_user_role', 'give_donor' ),\n\t), $user_data );\n\n\t// Insert new user.\n\t$user_id = wp_insert_user( $user_args );\n\n\t// Validate inserted user.\n\tif ( is_wp_error( $user_id ) ) {\n\t\treturn - 1;\n\t}\n\n\t// Allow themes and plugins to filter the user data.\n\t$user_data = apply_filters( 'give_insert_user_data', $user_data, $user_args );\n\n\t/**\n\t * Fires after inserting user.\n\t *\n\t * @since 1.0\n\t *\n\t * @param int $user_id User id.\n\t * @param array $user_data Array containing user data.\n\t */\n\tdo_action( 'give_insert_user', $user_id, $user_data );\n\n\t/**\n\t * Filter allow user to alter if user when to login or not when user is register for the first time.\n\t *\n\t * @since 1.8.13\n\t *\n\t * return bool True if login with registration and False if only want to register.\n\t */\n\tif ( true === (bool) apply_filters( 'give_log_user_in_on_register', true ) ) {\n\t\t// Login new user.\n\t\tgive_log_user_in( $user_id, $user_data['user_login'], $user_data['user_pass'] );\n\t}\n\n\t// Return user id.\n\treturn $user_id;\n}", "public function do_register_user() {\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t\t\t$redirect_url = home_url( 'member-register' );\n\t\t\t\n\t\t\tif( !get_option( 'users_can_register' ) ) {\n\t\t\t\t// Reg closed\n\t\t\t\t$redirect_url = add_query_arg( 'register-errors', 'closed', $redirect_url );\n\t\t\t} else {\n\t\t\t\t$email = sanitize_email($_POST['email']);\n\t\t\t\t$company_name = sanitize_text_field( $_POST['company_name'] );\n\t\t\t\t$first_name = sanitize_text_field( $_POST['first_name'] );\n\t\t\t\t$last_name = sanitize_text_field( $_POST['last_name'] );\n\t\t\t\t$contact_phone = sanitize_text_field( $_POST['contact_phone'] );\n\t\t\t\t$mobile_phone = sanitize_text_field( $_POST['mobile_phone'] );\n\t\t\t\t$job_title = sanitize_text_field( $_POST['job_title'] );\n\t\t\t\t$sector = sanitize_text_field( $_POST['sector'] );\n\t\t\t\t$ftseIndex = sanitize_text_field( $_POST['ftseIndex'] );\n\t\t\t\t$invTrust = sanitize_text_field( $_POST['invTrust'] );\n\t\t\t\t$sec_name = sanitize_text_field( $_POST['sec_name'] );\n\t\t\t\t$sec_email = sanitize_text_field( $_POST['sec_email'] );\n\t\t\t\t\n\t\t\t\t$result = $this->register_user( $email, $company_name, $first_name, $last_name, $contact_phone, $mobile_phone, $job_title, $sector, $ftseIndex, $invTrust, $sec_name, $sec_email );\n\t\t\t\t\n\t\t\t\tif( is_wp_error( $result ) ) {\n\t\t\t\t\t// Parse errors into string and append as parameter to redirect\n\t\t\t\t\t$errors = join( ',', $result->get_error_codes() );\n\t\t\t\t\t$redirect_url = add_query_arg( 'register-errors', $errors, $redirect_url );\n\t\t\t\t} else {\n\t\t\t\t\t// Success\n\t\t\t\t\t$redirect_url = home_url( 'thank-you-for-registering' );\n//\t\t\t\t\t$redirect_url = add_query_arg( 'registered', $email, $redirect_url );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\twp_redirect( $redirect_url );\n\t\t\texit;\n\t\t}\n\t}", "public function sign_up()\n {\n\n }", "public function register()\n {\n add_filter( 'upload_mimes', array( $this, 'add_custom_file_types_supprot' ) );\n\n // add svg support\n add_filter( 'wp_prepare_attachment_for_js', array( $this, 'add_svg_media_thumbnails' ), 10, 3 );\n\n // filter wordpress filetype security check\n add_filter('wp_check_filetype_and_ext', array( $this, 'wp_check_filetype_and_ext' ) , 5, 5);\n\n // Add Custom user fields to ccd_client user role\n add_action( 'show_user_profile', array( $this, 'add_custom_user_fields' ) );\n add_action( 'edit_user_profile', array( $this, 'add_custom_user_fields' ) );\n\n // handle custom user fields update / form post\n add_action( 'personal_options_update', array( $this, 'update_custom_user_fields' ) );\n add_action( 'edit_user_profile_update', array( $this, 'update_custom_user_fields' ) );\n }", "function register_user($username,$email,$institution){\n\t}", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }", "function users_user_register($args)\n{\n // If has logged in, header to index.php\n if (pnUserLoggedIn()) {\n return pnRedirect(pnConfigGetVar('entrypoint', 'index.php'));\n }\n\n $template = 'users_user_register.htm';\n // check if we've agreed to the age limit\n if (pnModGetVar('Users', 'minage') != 0 && !stristr(pnServerGetVar('HTTP_REFERER'), 'register')) {\n $template = 'users_user_checkage.htm';\n }\n\n // create output object\n $pnRender = & pnRender::getInstance('Users', false);\n\n // other vars\n $modvars = pnModGetVar('Users');\n\n $pnRender->assign($modvars);\n $pnRender->assign('sitename', pnConfigGetVar('sitename'));\n $pnRender->assign('legal', pnModAvailable('legal'));\n $pnRender->assign('tou_active', pnModGetVar('legal', 'termsofuse', true));\n $pnRender->assign('pp_active', pnModGetVar('legal', 'privacypolicy', true));\n\n return $pnRender->fetch($template);\n}", "function wpachievements_wordpress_register($user_id){\r\n if( !empty($user_id) ){\r\n $type='user_register'; $uid=$user_id; $postid='';\r\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $points = (int)get_blog_option(1, 'wpachievements_reg_points');\r\n } else{\r\n $points = (int)get_option('wpachievements_reg_points');\r\n }\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, $points);\r\n }\r\n }", "function add_signup_shortcode()\n\t{ \n\t\n\t\tob_start();\n\t\t\n\t\tif ( !is_user_logged_in() ) \n\t\t{ \n\t\t\t\n\t\t\techo ' <div class=\"woocommerce\">';\n\t\t\t\n\t\t\tif(isset($_POST['register']) && sanitize_text_field ($_POST['register'] ) )\n\t\t\t{\n\t\t\n\t\t\t\t$nonce_check = isset($_POST['_wpnonce_phoe_register_form'])?sanitize_text_field( $_POST['_wpnonce_phoe_register_form'] ):'';\n\n\t\t\t\tif ( ! wp_verify_nonce( $nonce_check, 'phoe_register_form' ) ) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdie( 'Security check failed' ); \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$reg_email = isset($_POST['email'])?sanitize_email($_POST['email']):'';\n\t\t\t\t\n\t\t\t\t$reg_password = isset($_POST['password'])? sanitize_text_field($_POST['password']):'';\n\t\t\t\t\n\t\t\t\t$arr_name = explode(\"@\",$reg_email); \n\t\t\t\t\n\t\t\t\t$temp = $arr_name[0];\n\t\t\t\t\n\t\t\t\t$user = get_user_by( 'email',$reg_email );\t\t\t \n\t\t\t \n\t\t\t\tif($reg_email == '')\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\techo '<ul class=\"woocommerce-error\">\n\t\t\t\t\t\n\t\t\t\t\t\t\t<li><strong>Error:</strong> Please provide a valid email address.</li>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t </ul>';\n\t\t\t \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if($reg_password == '')\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\techo '<ul class=\"woocommerce-error\">\n\t\t\t\t\t\n\t\t\t\t\t\t\t<li><strong>Error:</strong> Please enter an account password.</li>\n\t\t\t\t\t\t\t\n\t\t\t\t\t </ul>';\n\t\t\t }\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(is_email($reg_email))\n\t\t\t\t\t{ \t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(is_object($user) && $user->user_email == $reg_email)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t\techo'<ul class=\"woocommerce-error\">\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<li><strong>Error:</strong> An account is already registered with your email address. Please login.</li>\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t </ul>';\n\t\t\t\t\t\t}\n\t\t\t\t\t else\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && empty( $reg_password ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$reg_password = wp_generate_password();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$password_generated = true;\n\n\t\t\t\t\t\t\t\t} elseif ( empty( $reg_password ) ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\treturn new WP_Error( 'registration-error-missing-password', __( 'Please enter an account password.', 'woocommerce' ) );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$password_generated = false;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$userdata=array(\"role\"=>\"customer\",\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"user_email\"=>$reg_email,\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"user_login\"=>$temp,\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"user_pass\"=>$reg_password);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($user_id = wp_insert_user( $userdata ))\n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdo_action('woocommerce_created_customer', $user_id, $userdata, $password_generated);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$user1 = get_user_by('id',$user_id);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\twp_set_current_user( $user1->ID, $user1->user_login );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t wp_set_auth_cookie( $user1->ID );\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t do_action( 'wp_login', $user1->user_login,$user1 );\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $location = home_url().\"/my-account/\"; \n\t\t\t\t\t\t\t\twp_redirect($location);\n\n\t\t\t\t\t\t\t exit;\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<ul class=\"woocommerce-error\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<li><strong>Error:</strong> Please provide a valid email address.</li>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</ul>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n?> \n\t\n\t\t\t<div class=\"col-set\" id=\"customer_login\">\n\t\t\t\t<div class=\"col\">\n\t\t\t\t\t<h2>Register</h2>\n\t\t\t\t\t<form method=\"post\" class=\"register\">\t\n\n\t\t\t\t\t\t<?php $nonce_register = wp_create_nonce( 'phoe_register_form' ); ?>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t<input type=\"hidden\" value=\"<?php echo $nonce_register; ?>\" name=\"_wpnonce_phoe_register_form\" id=\"_wpnonce_phoe_register_form\" />\n\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t\t\t\t<label for=\"reg_email\">Email address <span class=\"required\">*</span></label>\n\t\t\t\t\t\t\t<input type=\"email\" class=\"input-text\" name=\"email\" id=\"reg_email\" value=\"<?php echo isset( $reg_email ) ? $reg_email: '' ; ?>\" >\n\t\t\t\t\t\t</p>\t\t\t\n\t\t\t\t\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t\t\t\t\t<label for=\"reg_password\">Password <span class=\"required\">*</span></label>\n\t\t\t\t\t\t\t\t<input type=\"password\" class=\"input-text\" name=\"password\" id=\"reg_password \" >\n\t\t\t\t\t\t\t</p>\t\t\t\n\t\t\t\t\t\t<div style=\"left: -999em; position: absolute;\"><label for=\"trap\">Anti-spam</label><input type=\"text\" name=\"email_2\" id=\"trap\" tabindex=\"-1\"></div>\t\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"form-row\">\n\t\t\t\t\t\t\t<input type=\"hidden\" id=\"_wpnonce\" name=\"_wpnonce\" value=\"70c2c9e9dd\"><input type=\"hidden\" name=\"_wp_http_referer\" value=\"<?php echo get_site_url(); ?>/my-account/\">\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"button\" name=\"register\" value=\"Register\">\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\n<?php \n\n\t\t}\n\t\t\n\t\treturn ob_get_clean();\n\t}", "protected function RegisterIfNew(){\n // Si el sitio es de acceso gratuito, no debe registrarse al usuario.\n // Luego debe autorizarse el acceso en el metodo Authorize\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return;\n }\n\t\t\n\t\t// Crear la cuenta de usuarios nuevos\n // if (!DBHelper::is_user_registered($this->user)){\n // if (!(int)$this->data->mobile || \n // (int)($this->data->client_app_version) < AU_NEW_USER_MIN_VERSION_CODE){\n // // Force update\n // $this->url = Url::Parse(\"http://\". HTTP_HOST .\"/__www/new_user_update_required.php\");\n // }else{\n // DBHelper::createNewAccount($this->user, DIAS_PRUEBA);\n // }\n // }\n \n // No crear cuenta. En su lugar mostrar una pagina notificando\n // E:\\XAMPP\\htdocs\\__www\\no_registration_allowed.html\n \n if (!DBHelper::is_user_registered($this->user)){\n DBHelper::storeMailAddress($this->user);\n $this->url = Url::Parse(\"http://auroraml.com/__www/no_registration_allowed.html\");\n }\n }", "function we_tag_saveRegisteredUser(array $attribs){\n\tif(!(defined('CUSTOMER_TABLE') && isset($_REQUEST['s']))){\n\t\treturn;\n\t}\n\n\t$userexists = weTag_getAttribute('userexists', $attribs, false, we_base_request::STRING);\n\t$userempty = weTag_getAttribute('userempty', $attribs, '', we_base_request::STRING);\n\t$passempty = weTag_getAttribute('passempty', $attribs, '', we_base_request::STRING);\n\t$changesessiondata = weTag_getAttribute('changesessiondata', $attribs, true, we_base_request::BOOL);\n\t$default_register = f('SELECT pref_value FROM ' . SETTINGS_TABLE . ' WHERE tool=\"webadmin\" AND pref_name=\"default_saveRegisteredUser_register\"') === 'true';\n\t$registerallowed = (isset($attribs['register']) ? weTag_getAttribute('register', $attribs, $default_register, we_base_request::BOOL) : $default_register);\n\t$protected = weTag_getAttribute('protected', $attribs, '', we_base_request::STRING_LIST);\n\t$allowed = weTag_getAttribute('allowed', $attribs, '', we_base_request::STRING_LIST);\n\t$pwdRule = weTag_getAttribute('passwordRule', $attribs, '', we_base_request::RAW);\n\n\tif(isset($_REQUEST['s']['Password2'])){\n\t\tunset($_REQUEST['s']['Password2']);\n\t}\n\twe_base_util::convertDateInRequest($_REQUEST['s'], false);\n\n\t$uid = we_base_request::_(we_base_request::INT, 's', false, 'ID');\n\t$username = trim(we_base_request::_(we_base_request::STRING, 's', '', 'Username'));\n\t$password = we_base_request::_(we_base_request::RAW, 's', false, 'Password');\n\t//register new User\n\tif(($uid === false || $uid <= 0) && (!isset($_SESSION['webuser']['ID'])) && $registerallowed && (!isset($_SESSION['webuser']['registered']) || !$_SESSION['webuser']['registered'])){ // neuer User\n\t\tif(!$username){\n\t\t\twe_tag_saveRegisteredUser_keepInput();\n\t\t\t$GLOBALS['ERROR']['saveRegisteredUser'] = we_customer_customer::PWD_USER_EMPTY;\n\t\t\tif($userempty !== ''){\n\t\t\t\techo we_html_element::jsElement(we_message_reporting::getShowMessageCall(($userempty ? : g_l('modules_customer', '[username_empty]')), we_message_reporting::WE_MESSAGE_FRONTEND));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif(we_customer_customer::customerNameExist($username, $GLOBALS['DB_WE'])){\n\t\t\t// Eingabe in Session schreiben, damit die eingegebenen Werte erhalten bleiben!\n\t\t\twe_tag_saveRegisteredUser_keepInput();\n\t\t\t$GLOBALS['ERROR']['saveRegisteredUser'] = we_customer_customer::PWD_USER_EXISTS;\n\t\t\tif($userexists !== ''){\n\t\t\t\techo we_html_element::jsElement(we_message_reporting::getShowMessageCall(sprintf(($userexists ? : g_l('modules_customer', '[username_exists]')), $username), we_message_reporting::WE_MESSAGE_FRONTEND));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif(!$password){\n\t\t\twe_tag_saveRegisteredUser_keepInput();\n\t\t\t$GLOBALS['ERROR']['saveRegisteredUser'] = we_customer_customer::PWD_FIELD_NOT_SET;\n\t\t\tif($passempty !== ''){\n\t\t\t\techo we_html_element::jsElement(we_message_reporting::getShowMessageCall(($passempty ? : g_l('modules_customer', '[password_empty]')), we_message_reporting::WE_MESSAGE_FRONTEND));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif($pwdRule && !preg_match('/' . addcslashes($pwdRule, '/') . '/', $password)){\n\t\t\twe_tag_saveRegisteredUser_keepInput();\n\t\t\t$GLOBALS['ERROR']['saveRegisteredUser'] = we_customer_customer::PWD_NOT_SUFFICIENT;\n\t\t\treturn;\n\t\t}\n\n\t\t// username existiert noch nicht!\n\t\t$hook = new weHook('customer_preSave', '', array('customer' => &$_REQUEST['s'], 'from' => 'tag', 'type' => 'new', 'tagname' => 'saveRegisteredUser'));\n\t\t$ret = $hook->executeHook();\n\n\t\twe_saveCustomerImages();\n\t\t$set = we_tag_saveRegisteredUser_processRequest($protected, $allowed);\n\n\t\tif($set){\n\t\t\t// User in DB speichern\n\t\t\t$set['ModifyDate'] = sql_function('UNIX_TIMESTAMP()');\n\t\t\t$set['MemberSince'] = sql_function('UNIX_TIMESTAMP()');\n\t\t\t$set['LastAccess'] = sql_function('UNIX_TIMESTAMP()');\n\t\t\t$set['LastLogin'] = sql_function('UNIX_TIMESTAMP()');\n\t\t\t$set['ModifiedBy'] = 'frontend';\n\n\t\t\t$GLOBALS['DB_WE']->query('INSERT INTO ' . CUSTOMER_TABLE . ' SET ' . we_database_base::arraySetter($set));\n\t\t\t$id = $GLOBALS['DB_WE']->getInsertId();\n\t\t\tif($id){\n\t\t\t\t// User in session speichern\n\t\t\t\t$_SESSION['webuser'] = array(\n\t\t\t\t\t'ID' => $id,\n\t\t\t\t\t'registered' => true, //needed for reload\n\t\t\t\t);\n\t\t\t\t$GLOBALS['we_customer_write_ID'] = $_SESSION['webuser']['ID'];\n\t\t\t\t//make sure to always load session data\n\t\t\t\t$changesessiondata = true;\n\t\t\t}else{\n\t\t\t\t$GLOBALS['ERROR']['saveRegisteredUser'] = we_customer_customer::PWD_UNKNOWN_ERROR;\n\t\t\t}\n\t\t}\n\t} else if(!empty($_SESSION['webuser']['registered']) && ($uid == $_SESSION['webuser']['ID'])){ // existing user\n\t\t// existierender User (Daten werden von User geaendert)!!\n\t\t$weUsername = $username? : $_SESSION['webuser']['Username'];\n\n\t\tif(f('SELECT 1 FROM ' . CUSTOMER_TABLE . ' WHERE Username=\"' . $GLOBALS['DB_WE']->escape($weUsername) . '\" AND ID!=' . intval($_SESSION['webuser']['ID']))){\n\t\t\t$GLOBALS['ERROR']['saveRegisteredUser'] = we_customer_customer::PWD_USER_EXISTS;\n\t\t\tif($userexists !== ''){\n\t\t\t\techo we_html_element::jsElement(we_message_reporting::getShowMessageCall(sprintf($userexists ? : g_l('modules_customer', '[username_exists]'), $weUsername), we_message_reporting::WE_MESSAGE_FRONTEND));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif(isset($_REQUEST['s'])){// es existiert kein anderer User mit den neuen Username oder username hat sich nicht geaendert\n\t\t\t$hook = new weHook('customer_preSave', '', array('customer' => &$_REQUEST['s'], 'from' => 'tag', 'type' => 'modify', 'tagname' => 'saveRegisteredUser'));\n\t\t\t$ret = $hook->executeHook();\n\n\t\t\twe_saveCustomerImages();\n\t\t\t$set_a = we_tag_saveRegisteredUser_processRequest($protected, $allowed);\n\t\t\t$password = we_base_request::_(we_base_request::RAW, 's', we_customer_customer::NOPWD_CHANGE, 'Password');\n\t\t\tif($password !== we_customer_customer::NOPWD_CHANGE){\n\t\t\t\tif(!$password){\n\t\t\t\t\tif($changesessiondata){\n\t\t\t\t\t\twe_tag_saveRegisteredUser_keepInput(true);\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['ERROR']['saveRegisteredUser'] = we_customer_customer::PWD_FIELD_NOT_SET;\n\t\t\t\t\tif($passempty !== ''){\n\t\t\t\t\t\techo we_html_element::jsElement(we_message_reporting::getShowMessageCall(($passempty ? : g_l('modules_customer', '[password_empty]')), we_message_reporting::WE_MESSAGE_FRONTEND));\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif($pwdRule && !preg_match('/' . addcslashes($pwdRule, '/') . '/', $password)){\n\t\t\t\t\tif($changesessiondata){\n\t\t\t\t\t\twe_tag_saveRegisteredUser_keepInput(true);\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['ERROR']['saveRegisteredUser'] = we_customer_customer::PWD_NOT_SUFFICIENT;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(!we_customer_customer::comparePassword(f('SELECT Password FROM ' . CUSTOMER_TABLE . ' WHERE ID=' . $_SESSION['webuser']['ID']), $password)){//bei Passwordaenderungen muessen die Autologins des Users geloescht werden\n\t\t\t\t\t$GLOBALS['DB_WE']->query('DELETE FROM ' . CUSTOMER_AUTOLOGIN_TABLE . ' WHERE WebUserID=' . intval($_SESSION['webuser']['ID']));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($set_a){\n\t\t\t\t$set_a['ModifyDate'] = sql_function('UNIX_TIMESTAMP()');\n\t\t\t\t$set_a['ModifiedBy'] = 'frontend';\n\t\t\t\t$GLOBALS['DB_WE']->query('UPDATE ' . CUSTOMER_TABLE . ' SET ' . we_database_base::arraySetter($set_a) . ' WHERE ID=' . intval($_SESSION['webuser']['ID']));\n\t\t\t\tif(!$GLOBALS['DB_WE']->affected_rows()){\n\t\t\t\t\t$GLOBALS['ERROR']['saveRegisteredUser'] = we_customer_customer::PWD_UNKNOWN_ERROR;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//die neuen daten in die session schreiben\n\t$oldReg = !empty($_SESSION['webuser']['registered']);\n\tif($changesessiondata && $oldReg){\n\t\t//keep Password if known\n\t\tif(SECURITY_SESSION_PASSWORD & we_customer_customer::STORE_PASSWORD){\n\t\t\t//FIXME: on register password is in $_REQUEST['s']['Password']\n\t\t\t$oldPwd = $_SESSION['webuser']['_Password'];\n\t\t}\n\t\t$_SESSION['webuser'] = array_merge(getHash('SELECT * FROM ' . CUSTOMER_TABLE . ' WHERE ID=' . $_SESSION['webuser']['ID'], null, MYSQL_ASSOC), we_customer_customer::getEncryptedFields());\n\t\tif((SECURITY_SESSION_PASSWORD & we_customer_customer::STORE_DBPASSWORD) == 0){\n\t\t\tunset($_SESSION['webuser']['Password']);\n\t\t}\n\t\tif(SECURITY_SESSION_PASSWORD & we_customer_customer::STORE_PASSWORD){\n\t\t\t$_SESSION['webuser']['_Password'] = $oldPwd;\n\t\t}\n\t}\n\t//don't set anything that wasn't set before\n\t$_SESSION['webuser']['registered'] = $oldReg;\n}", "function ajax_register() {\n \n\t\t\t// First check the nonce, if it fails the function will break\n\t\t\tcheck_ajax_referer( 'ajax-register-nonce', 'securityregister', false );\n\t\t\t\t\n\t\t\t// Nonce is checked, get the POST data and sign user on\n\t\t\t$info = array();\n\t\t\t$info['user_nicename'] = $info['nickname'] = $info['display_name'] = $info['first_name'] = $info['user_login'] = sanitize_user($_POST['username']) ;\n\t\t\t$info['user_pass'] = sanitize_text_field($_POST['password']);\n\t\t\t$info['user_email'] = sanitize_email( $_POST['email']);\n\t\t\t\n\t\t\t// Register the user\n\t\t\t$user_register = wp_insert_user( $info );\n\t\t\t if ( is_wp_error($user_register) ){\t\n\t\t\t\t$error = $user_register->get_error_codes()\t;\n\t\t\t\t\n\t\t\t\tif(in_array('empty_user_login', $error))\n\t\t\t\t\techo json_encode(array('loggedin'=>false, 'message'=>__($user_register->get_error_message('empty_user_login'))));\n\t\t\t\telseif(in_array('existing_user_login',$error))\n\t\t\t\t\techo json_encode(array('loggedin'=>false, 'message'=>__('El nombre de usuario ya existe.', 'project045' )));\n\t\t\t\telseif(in_array('existing_user_email',$error))\n\t\t\t\techo json_encode(array('loggedin'=>false, 'message'=>__('La dirección de email ya existe.', 'project045' )));\n\t\t\t} else {\t\t\t\n\t\t\t \tself::auth_user_login($info['nickname'], $info['user_pass'], __( 'Registro', 'project045' ) ); \n\t\t\t}\n\t\t \n\t\t\tdie();\n\t\t}", "public function register()\n {\n $create_from = $this->request->get_body_params();\n\n $input = (object) array_intersect_key( $create_from,\n array_fill_keys(['username', 'password', 'email'], false)\n );\n\n $update = [\n 'first_name',\n 'last_name',\n ];\n\n /** @var \\WP_Error|integer $user */\n $user_id = \\wp_create_user($input->username, $input->password, $input->email);\n\n if (\\is_wp_error($user_id)) {\n throw new UnauthorizedException($user_id->get_error_message());\n }\n\n /** @var \\WP_User $user */\n $user = \\get_userdata($user_id);\n\n foreach ($update as $att) {\n $user->$att = $create_from[$att];\n }\n\n \\wp_update_user($user);\n\n return $this->response->ok([\n 'message' => sprintf(__('Hello %s', PMLD_TD), $user->nickname),\n 'user' => User::make($user),\n ]);\n\n }", "public static function init() {\n\t\tadd_action( 'user_register', array( __CLASS__, 'user_register' ) );\n\t}", "public static function user_created(core\\event\\user_created $event)\n {\n\n global $CFG;\n $user_data = user_get_users_by_id(array($event->relateduserid));\n\n // User password should be encrypted. Using Openssl for it.\n // We will use token as the key as it is present on both sites.\n // Open SSL encryption initialization.\n $enc_method = 'AES-128-CTR';\n\n\n $api_handler = api_handler_instance();\n if (isset($CFG->eb_connection_settings)) {\n $sites = unserialize($CFG->eb_connection_settings);\n $synch_conditions = unserialize($CFG->eb_synch_settings);\n\n foreach ($sites as $key => $value) {\n if ($synch_conditions[$value[\"wp_name\"]][\"user_creation\"] && $value['wp_token']) {\n $password = '';\n $enc_iv = '';\n // If new password in not empty\n if (isset($_POST['newpassword']) && $_POST['newpassword']) {\n $enc_key = openssl_digest($value[\"wp_token\"], 'SHA256', true);\n $enc_iv = substr(hash('sha256', $value[\"wp_token\"]), 0, 16);\n // $crypttext = openssl_encrypt($_POST['newpassword'], $enc_method, $enc_key, 0, $enc_iv) . \"::\" . bin2hex($enc_iv);\n $password = openssl_encrypt($_POST['newpassword'], $enc_method, $enc_key, 0, $enc_iv);\n }\n\n $request_data = array(\n 'action' => 'user_creation',\n 'user_id' => $event->relateduserid,\n 'user_name' => $user_data[$event->relateduserid]->username,\n 'first_name' => $user_data[$event->relateduserid]->firstname,\n 'last_name' => $user_data[$event->relateduserid]->lastname,\n 'email' => $user_data[$event->relateduserid]->email,\n 'password' => $password,\n 'enc_iv' => $enc_iv,\n 'secret_key' => $value['wp_token'], // Adding Token for verification in WP from Moodle.\n );\n\n $api_handler->connect_to_wp_with_args($value[\"wp_url\"], $request_data);\n }\n }\n }\n\n }", "function addUser($user,$password) {\r\n\t\twp_create_user($user->mName,$password,$user->mEmail);\r\n\t\treturn true;\r\n\t}", "function wpmu_signup_blog($domain, $path, $title, $user, $user_email, $meta = array())\n {\n }", "function wp_set_password($password, $user_id)\n {\n }", "function sdds_add_new_member()\n{\n if (isset($_POST['aff-user-email']) && wp_verify_nonce($_POST['aff-register-nonce'], 'aff-reg-nonce'))\n {\n $user_email = $_POST['aff-user-email'];\n $user_first = $_POST['aff-user-first'];\n $user_last = $_POST['aff-user-last'];\n $user_phone = $_POST['aff-user-phone'];\n\n //required for username checks\n // require_once(ABSPATH . WPINC . '/registration.php');\n if ($user_email == '')\n {\n aff_errors()->add('email_empty', __('Please enter your email address'));\n }\n if ($user_first == '')\n {\n aff_errors()->add('name_empty', __('Please enter your first name'));\n }\n if ($user_last == '')\n {\n aff_errors()->add('name_empty', __('Please enter your last name'));\n }\n if ($user_phone == '')\n {\n aff_errors()->add('phone_empty', __('Please enter your phone number'));\n }\n if (!is_email($user_email))\n {\n aff_errors()->add('email_invalid', __('Looks like this email address is not valid!'));\n }\n if (email_exists($user_email))\n {\n aff_errors()->add('email_used', __('Looks like this email address is already registered! Please login to access your dashboard'));\n }\n\n $errors = aff_errors()->get_error_messages();\n\n //only create user if errors are empty\n $user_pass = \"6Tr%#lKG_#@$%%7\";\n if (empty($errors))\n {\n $new_user_id = wp_insert_user(array(\n 'user_login' => $user_email, //idk if an email can be a valid username\n 'user_pass' => $user_pass, //autogenerate?\n 'user_email' => $user_email,\n 'first_name' => $user_first,\n 'last_name' => $user_last, //maybe separate first and last to avoid explosion\n 'user_registered' => date('Y-m-d H:i:s') ,\n 'role' => 'affiliate'\n ));\n\n if ($new_user_id)\n {\n //send alert to admin\n wp_new_user_notification($new_user_id, null, 'both');\n //log new user in\n wp_set_auth_cookie($user_email, true);\n wp_set_current_user($new_user_id, $user_email);\n do_action('wp_login', $user_email, $new_user_id);\n\n //send user to dashboard page\n wp_redirect(home_url() . '/affiliate-thank-you');\n exit;\n }\n }\n }\n}", "function sign_up($user_post_data)\n\t{\n\t\t$salted_password = hash_pbkdf2(\"sha1\", $user_post_data[\"password\"], $user_post_data[\"salt\"], $user_post_data[\"iteration_count\"], 40);\n\t\t$client_key = hash_hmac(\"sha1\", $salted_password, \"'Client Key'\");\n\t\t$server_key = hash_hmac(\"sha1\", $salted_password, \"'Server Key'\");\n\t\t$hashed_password = sha1($client_key);\n\t\t$user_post_data[\"password\"] = $hashed_password;\n\n\t\t$query_builder= $this->db->db_connect();\n\t\t$query = $query_builder->prepare(\"insert into user(name,lastname,email,password,server_key,salt,iteration_count,user_created) values(?,?,?,?,?,?,?,?)\");\n\t\t$query->execute(array($user_post_data[\"name\"], $user_post_data[\"lastname\"], $user_post_data[\"email\"], $user_post_data[\"password\"],$server_key, $user_post_data[\"salt\"], $user_post_data[\"iteration_count\"], $user_post_data[\"user_signed_up\"]));\n\t\treturn true;\n\t\t$this->db->db_disconnect();\n\t\t\n\t}", "function Register()\r\n\t{\r\n\t\tglobal $Site;\r\n\t\t//if all the details is valid save the user on data base\r\n\t\tif ($this->IsValid())\r\n\t\t{\r\n\t\t\t$MemberID = GetID(\"member\", \"MemberID\");//getting last MemberID +1 for adding one more user\r\n\t\t\t$DateAdded = date(\"Y-m-d H:i:s\");\r\n\t\t\t$DateUpdated = $DateAdded;\r\n\t\t\t$IsEnable = 1;\r\n\t\t\t$pass = base64_encode($this->Password);\r\n\t\t\t$SQL = \"insert into member (MemberID, ProfileType, FirstName, LastName, TelNo, Email, Password, IsActive, IsEnable, DateAdded, DateUpdated) values ($MemberID, 'user', '$this->FirstName', '$this->LastName', '$this->PhoneNumber', '$this->Email', '$pass', '1' , '$IsEnable', '$DateAdded', '$DateUpdated')\";\r\n\t\t\tGetRS($SQL);\r\n\t\t\t$_SESSION['SAWMemberID'] = $MemberID;//cookie- to not allow impersonation of another user PHP gives each customer ID\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t}", "public function register_admin_end() {\n SwpmMiscUtils::check_user_permission_and_is_admin('member creation by admin');\n \n //Check nonce\n if ( !isset( $_POST['_wpnonce_create_swpmuser_admin_end'] ) || !wp_verify_nonce($_POST['_wpnonce_create_swpmuser_admin_end'], 'create_swpmuser_admin_end' )){\n //Nonce check failed.\n wp_die(SwpmUtils::_(\"Error! Nonce verification failed for user registration from admin end.\"));\n }\n \n global $wpdb;\n $member = SwpmTransfer::$default_fields;\n $form = new SwpmForm($member);\n if ($form->is_valid()) {\n $member_info = $form->get_sanitized_member_form_data();\n $account_status = SwpmSettings::get_instance()->get_value('default-account-status', 'active');\n $member_info['account_state'] = $account_status;\n $plain_password = $member_info['plain_password'];\n unset($member_info['plain_password']);\n $wpdb->insert($wpdb->prefix . \"swpm_members_tbl\", $member_info);\n \n //Register to wordpress\n $query = $wpdb->prepare(\"SELECT role FROM \" . $wpdb->prefix . \"swpm_membership_tbl WHERE id = %d\", $member_info['membership_level']);\n $wp_user_info = array();\n $wp_user_info['user_nicename'] = implode('-', explode(' ', $member_info['user_name']));\n $wp_user_info['display_name'] = $member_info['user_name'];\n $wp_user_info['user_email'] = $member_info['email'];\n $wp_user_info['nickname'] = $member_info['user_name'];\n if (isset($member_info['first_name'])) {\n $wp_user_info['first_name'] = $member_info['first_name'];\n }\n if (isset($member_info['last_name'])) {\n $wp_user_info['last_name'] = $member_info['last_name'];\n }\n $wp_user_info['user_login'] = $member_info['user_name'];\n $wp_user_info['password'] = $plain_password;\n $wp_user_info['role'] = $wpdb->get_var($query);\n $wp_user_info['user_registered'] = date('Y-m-d H:i:s');\n SwpmUtils::create_wp_user($wp_user_info);\n //End register to wordpress\n \n //Send notification\n $send_notification = SwpmSettings::get_instance()->get_value('enable-notification-after-manual-user-add');\n $member_info['plain_password'] = $plain_password;\n $this->member_info = $member_info;\n if (!empty($send_notification)) {\n $this->send_reg_email();\n }\n \n //Trigger action hook\n do_action('swpm_admin_end_registration_complete_user_data', $member_info);\n \n //Save success message\n $message = array('succeeded' => true, 'message' => '<p>' . SwpmUtils::_('Member record added successfully.') . '</p>');\n SwpmTransfer::get_instance()->set('status', $message);\n wp_redirect('admin.php?page=simple_wp_membership');\n exit(0);\n }\n $message = array('succeeded' => false, 'message' => SwpmUtils::_('Please correct the following:'), 'extra' => $form->get_errors());\n SwpmTransfer::get_instance()->set('status', $message);\n }", "function install_root_user() {\n $fields = array(\n 'username' => $site_config['adminUser'],\n 'password' => $site_config['adminPassword'],\n 'role' => DEFAULT_ADMIN_RID,\n 'email' => $site_config['adminEmail'],\n 'name' => $site_config['adminName'],\n 'language' => Session::get('lang'),\n 'active' => 1\n );\n $new_user = new User();\n if($new_user->create($fields)) {\n return true;\n }\n else {\n System::addMessage('error', rt('The site administrator could not be created. Please verify that your server meets the requirements for the application and that your database user has sufficient permissions ot make changes in the database'));\n }\n}", "function testDoubleRegistration() {\n\t\t$pkey = Cgn_User::registerUser($this->user);\n\t\t$this->assertEqual(FALSE, $pkey);\n\t}", "function wp_new_user_notification($user_id, $plaintext_pass = '') {\n\t$user = get_userdata( $user_id );\n\n\t// The blogname option is escaped with esc_html on the way into the database in sanitize_option\n\t// we want to reverse this for the plain text arena of emails.\n\t$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);\n\n\t$signIn = join(array(get_site_url(),'/sign-in/'));\n\n\t$message = sprintf(__('Username: %s'), $user->user_email) . \"\\r\\n\";\n\t$message .= sprintf(__('Password: %s'), $plaintext_pass) . \"\\r\\n\";\n\t$message .= sprintf(__('Sign in at: %s'),$signIn) . \"\\r\\n\";\n\n\twp_mail($user->user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);\n\n}", "function after_switch_theme() {\n \\add_role('demo', __('Demo', 'theme-piber'), get_role('administrator')->capabilities);\n \\wp_insert_user(array(\n 'user_login' => 'demo',\n 'user_pass' => 'demo',\n 'role' => 'demo',\n ));\n}", "function register_dz40()\n\t\t{\n\t\t\tglobal $db,$bbspre,$registerinfo;\n\t\t\t$this->username\t\t=\t$registerinfo[user]\t;\n\t\t\t$this->password\t\t=\t$registerinfo[pass]\t;\n\n\t\t\t$this->userkind\t\t=\t'10'\t\t\t\t;\t//\tCHANGE BY YOUR BBS CONFIG\n\n\t\t\t$this->email\t\t=\t$email\t\t\t\t;\n\n\t\t\tif (!$db->num($db->query(\"select username from {$bbspre}members where username='\".$this->username.\"'\")))\n\t\t\t{\n\t\t\t\t$db->query(\"INSERT INTO {$bbspre}members\n\t\t\t\t\t(username,password,groupid,regip,regdate,email,timeoffset)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('\".$this->username.\"','\".$this->password.\"','10','\".getenv(\"REMOTE_ADDR\").\"','\".time().\"','\".$this->email.\"','8')\");\n\t\t\t\t$uid = $db->query_id();\n\t\t\t\t$db->query(\"INSERT INTO {$bbspre}memberfields (uid, site, icq) VALUES ('$uid', '$site', '$icq')\");\n\t\t\t}\n\t\t}", "public function initializeBackendUser() {}", "public function initializeBackendUser() {}", "function itstar_send_registration_admin_email($user_id){\n // add_user_meta( $user_id, 'hash', $hash );\n \n \n\n $message = '';\n $user_info = get_userdata($user_id);\n $to = get_option('admin_email'); \n $un = $user_info->display_name; \n $pw = $user_info->user_pass;\n $viraclub_id = get_user_meta( $user_id, 'viraclub', 1);\n\n $subject = __('New User Have Registered ','itstar').get_option('blogname'); \n \n $message .= __('Username: ','itstar').$un;\n $message .= \"\\n\";\n $message .= __('Password: ','itstar').$pw;\n $message .= \"\\n\\n\";\n $message .= __('ViraClub ID: ','itstar').'V'.$viraclub_id;\n\n \n //$message .= 'Please click this link to activate your account:';\n // $message .= home_url('/').'activate?id='.$un.'&key='.$hash;\n $headers = 'From: <[email protected]>' . \"\\r\\n\"; \n wp_mail($to, $subject, $message); \n}", "public function action_register(){\n\t\t\n\t\t$user = CurUser::get();\n\t\t\n\t\tif($user->save($_POST, User_Model::SAVE_REGISTER)){\n\t\t\t$user->login($user->{CurUser::LOGIN_FIELD}, $_POST['password']);\n\t\t\tApp::redirect('user/profile/greeting');\n\t\t\treturn TRUE;\n\t\t}else{\n\t\t\tMessenger::get()->addError('При регистрации возникли ошибки:', $user->getError());\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function registerUser($args) {\n $this->db->insert('user', [\n 'email' => $args['email'],\n 'password' => md5($args['password']),\n 'role' => $args['role'],\n 'created_at' => date('Y-m-d H:i:s', time()),\n 'account_status' => $args['account_status']\n ]);\n\t\treturn $this->db->insert_id();\n }", "public function sign_up()\n\t{\n\t\t$post = $this->input->post();\n\t\t$return = $this->accounts->register($post, 'settings'); /*this will redirect to settings page */\n\t\t// debug($this->session);\n\t\t// debug($return, 1);\n\t}", "function tumblr_users_register_user($userinfo, $access_token){\n\t\t\n\t\t$password = random_string(32);\n\n\t\t$email = \"{$userinfo->response->user->name}@donotsend-tumblr.com\";\n\n\t\t$user = users_create_user(array(\n\t\t\t\"username\" => $userinfo->response->user->name,\n\t\t\t\"email\" => $email,\n\t\t\t\"password\" => $password,\n\t\t));\n\n\t\tif (! $user){\n\t\t\treturn not_okay(\"dberr_user\");\n\t\t}\n\n\t\t$tumblr_user = tumblr_users_create_user(array(\n\t\t\t'user_id' => $user['user']['id'],\n\t\t\t'oauth_token' => $access_token['oauth_token'],\n\t\t\t'oauth_secret' => $access_token['oauth_token_secret'],\n\t\t\t'tumblr_username' => $userinfo->response->user->name,\n\t\t\t'following' => $userinfo->response->user->following,\n\t\t\t'likes' => $userinfo->response->user->likes,\n\t\t\t'default_post_format' => $userinfo->response->user->default_post_format\n\t\t));\n\n\t\tif (! $tumblr_user){\n\t\t\treturn not_okay(\"dberr_tumblruser\");\n\t\t}\n\n\t\treturn okay(array(\n\t\t\t'user' => $user,\n\t\t\t'tumblr_user' => $tumblr_user,\n\t\t));\n\t}", "function validate_user_signup()\n {\n }", "public static function invite_wp() {\n\t\theader('Content-Type: application/json');\n\t\tglobal $acc;\n\n\t\t$response = array(\n\t\t\t'success' => true,\n\t\t);\n\n\t\t$cid = $_POST['cid'];\n\t\t$c = new \\WPSF\\Contact( $cid );\n\n\t\t// We are creating new.\n\t\t$id = self::create_wp_account();\n\t\tif ( is_wp_error( $id ) ) {\n\t\t\tprint json_encode(array(\n\t\t\t\t'error' => 'WP user creation failure.',\n\t\t\t\t'messages' => $id->get_error_messages(),\n\t\t\t));\n\t\t\texit();\n\t\t}\n\n\t\t/** I HATE WORKAROUNDS LIKE THIS. Just let me save via the name dammit. **/\n\t\tglobal $wpsf_acf_fields;\n\t\tupdate_field( $wpsf_acf_fields['wpsf_contactid'], $cid, 'user_'.$id );\n\n\t\twp_signon( array(\n\t\t\t'user_login' => $_POST['username'],\n\t\t\t'user_password' => $_POST['password'],\n\t\t\t'remember' => true,\n\t\t) );\n\t\twp_set_current_user( $id );\n\n\t\t$c['WP_Username__c'] = $_POST['username'];\n\t\t$c->update();\n\n\t\treturn wp_send_json_success( $response );\n\t}", "public function onRegistrationInitialize(GetResponseUserEvent $event)\n {\n\t\t$user = $event->getUser();\n\t\t\n\t\t$tokenGenerator = $this->container->get('fos_user.util.token_generator');\n\t\t$password = substr($tokenGenerator->generateToken(), 0, 8); // 8 chars\t\t\n\t\t$password = '1234';\n\t\t\n\t\t$smscode = (int) ( rand(10,99).''.rand(10,99) ); #.''.rand(10,99) );\n\t\t\n\t\t$user->setPlainPassword( $password );\n\t\t$user->setSmsValidationCode( $smscode );\n }", "function b2c_signup( $return_uri = '' ) {\n\n\ttry {\n\t\t$authorization_endpoint = b2c_get_signup_endpoint( $return_uri );\n\t\tif ( $authorization_endpoint ) {\n\t\t\twp_redirect( $authorization_endpoint );\n\t\t}\n\t} catch ( Exception $e ) {\n\t\techo $e->getMessage();\n\t}\n\t\texit;\n\n}", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n unset($DBA, $rs, $fields, $fieldvals);\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'id');\n $idfields = array(0 => 'username');\n $idvals = array(0 => $this->Username);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('ID', $res['id']);\n }\n }\n unset($DBA, $rs, $fields, $idfields, $idvals);\n }", "public function p_signup(){\n\t\tforeach($_POST as $field => $value){\n\t\t\tif(empty($value)){\n\t\t\t\tRouter::redirect('/users/signup/empty-fields');\n\t\t\t}\n\t\t}\n\n\t\t#check for duplicate email\n\t\tif ($this->userObj->confirm_unique_email($_POST['email']) == false){\n\t\t\t#send back to signup page\n\t\t\tRouter::redirect(\"/users/signup/duplicate\");\n\t\t}\n\n\t\t#adding data to the user\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\n\t\t#encrypt password\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t#create encrypted token via email and a random string\n\t\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\n\t\t#Insert into the db\n\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\t\t# log in the new user\n\n\t\tsetcookie(\"token\", $_POST['token'], strtotime('+2 weeks'), '/');\n\n\t\t# redirect to home\n\t\tRouter::redirect('/users/home');\n\t\t\n\t}", "function registerUser($username, $firstname, $lastname, $email, $password) {\n\tglobal $connection;\n\n\t$username = escape($_POST['username']);\n\t$firstname = escape($_POST['firstname']);\n\t$lastname = escape($_POST['lastname']);\n\t$email = escape($_POST['email']);\n\t$password = escape($_POST['password']);\n\n\t$password = password_hash($password, PASSWORD_BCRYPT, array('cost' => 12));\n\n\t$query = \"INSERT INTO users (username, user_firstname, user_lastname, user_email, user_password, user_role) \";\n\t$query .= \"VALUES('{$username}', '{$firstname}', '{$lastname}', '{$email}', '{$password}', 'subscriber' )\";\n\t$register_user = mysqli_query($connection, $query);\n\tconfirm($register_user);\n\n}", "public function registration()\n {\n \n }", "function wp_ajax_save_wporg_username()\n {\n }", "function eve_api_user_register_form_submit(&$form, &$form_state) {\n $account = $form_state['user'];\n $uid = (int) $account->uid;\n $key_id = (int) $form_state['signup_object']['keyID'];\n $v_code = (string) $form_state['signup_object']['vCode'];\n\n $character = eve_api_create_key($account, $key_id, $v_code);\n\n if (isset($character['not_found']) || $character == FALSE) {\n db_update('users')->fields(array(\n 'characterID' => 0,\n 'name' => $account->name,\n 'signature' => '',\n ))->condition('uid', $uid, '=')->execute();\n\n $default_role = user_role_load(variable_get('eve_api_unverified_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', $default_role->rid);\n\n drupal_set_message(t('Registration partially failed, please verify API Key when activated.'), 'error');\n return;\n }\n\n $queue = DrupalQueue::get('eve_api_cron_api_user_sync');\n $queue->createItem(array(\n 'uid' => $uid,\n 'runs' => 1,\n ));\n\n $character_name = (string) $character['characterName'];\n $character_id = (int) $character['characterID'];\n $corporation_name = (string) $character['corporationName'];\n $character_is_blue = FALSE;\n\n if ($corporation_role = user_role_load_by_name($corporation_name)) {\n user_multiple_role_edit(array($uid), 'add_role', (int) $corporation_role->rid);\n\n $alliance_role = user_role_load(variable_get('eve_api_alliance_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', (int) $alliance_role->rid);\n }\n elseif (eve_api_verify_blue($character)) {\n $character_is_blue = TRUE;\n\n $blue_role = user_role_load(variable_get('eve_api_blue_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', (int) $blue_role->rid);\n }\n else {\n $default_role = user_role_load(variable_get('eve_api_unverified_role', 2));\n user_multiple_role_edit(array($uid), 'add_role', $default_role->rid);\n }\n\n module_invoke_all('eve_api_user_update', array(\n 'account' => $account,\n 'character' => $character,\n 'character_is_blue' => $character_is_blue,\n ));\n\n db_update('users')->fields(array(\n 'characterID' => $character_id,\n 'name' => $character_name,\n 'signature' => '',\n ))->condition('uid', $uid, '=')->execute();\n}", "function wp_install( string $blog_title, string $user_name, string $user_email, bool $public,\n string $deprecated = '', string $user_password = '', string $language = '' ) {\n\n if ( ! empty( $deprecated ) ) {\n _deprecated_argument( __FUNCTION__, '2.6' );\n }\n\n wp_check_mysql_version();\n wp_cache_flush();\n make_db_current_silent();\n populate_options();\n populate_roles();\n\n if ( $language ) {\n update_option( 'WPLANG', $language );\n } elseif ( env( 'WPLANG' ) ) {\n update_option( 'WPLANG', env( 'WPLANG' ) );\n }\n\n update_option( 'blogname', $blog_title );\n update_option( 'admin_email', $user_email );\n update_option( 'blog_public', $public );\n\n // Prefer empty description if someone forgots to change it.\n update_option( 'blogdescription', '' );\n\n $guessurl = wp_guess_url();\n\n update_option( 'siteurl', $guessurl );\n\n // If not a public blog, don't ping.\n if ( ! $public ) {\n update_option( 'default_pingback_flag', 0 );\n }\n\n /*\n * Create default user. If the user already exists, the user tables are\n * being shared among blogs. Just set the role in that case.\n */\n $user_id = username_exists( $user_name );\n $user_password = trim( $user_password );\n $email_password = false;\n if ( ! $user_id && empty( $user_password ) ) {\n $user_password = wp_generate_password( 12, false );\n $message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');\n $user_id = wp_create_user($user_name, $user_password, $user_email);\n update_user_option($user_id, 'default_password_nag', true, true);\n $email_password = true;\n } elseif ( ! $user_id ) {\n // Password has been provided.\n $message = '<em>'.__('Your chosen password.').'</em>';\n $user_id = wp_create_user($user_name, $user_password, $user_email);\n } else {\n $message = __('User already exists. Password inherited.');\n }\n\n $user = new WP_User($user_id);\n $user->set_role('administrator');\n\n wp_install_defaults($user_id);\n\n wp_install_maybe_enable_pretty_permalinks();\n\n flush_rewrite_rules();\n\n wp_cache_flush();\n\n /**\n * Fires after a site is fully installed.\n *\n * @since 3.9.0\n *\n * @param WP_User $user The site owner.\n */\n do_action( 'wp_install', $user );\n\n return array( 'url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message );\n}", "private function register()\n {\n $s = 'INSERT INTO `users` (`project`, `authService`, `authServiceID`, `vcs_login`, `email`, `anonymousIdent`, `conf`, `last_connect`) VALUES (\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\", now())';\n $params = array($this->project, $this->authService, $this->authServiceID, $this->vcsLogin, $this->email, $this->anonymousIdent, json_encode($this->defaultConf));\n\n $this->conn->query($s, $params);\n return $this->conn->insert_id();\n }", "function registerUser() {\n\n\tglobal $db;\n\tglobal $password;\n\tglobal $username;\n\tglobal $firstname;\n\tglobal $lastname;\n\tglobal $email;\n\tglobal $register;\n\n\t$password = password_hash($password, PASSWORD_BCRYPT, array('cost' => 12));\n\n $query = \"INSERT INTO \";\n $query .= \"user(username, user_password, user_email, user_firstname, user_lastname, user_role, date) \";\n $query .= \"VALUES('{$username}', '{$password}', '{$email}', '{$firstname}', '{$lastname}', 'Costumer', now())\";\n\n $result = mysqli_query($db, $query);\n\n confirmQuery($result);\n\n $register = \"<p class='alert-success'>You have been registered</p>\";\n}", "function wp_authenticate_user($userdata)\n{\n $isActivated = get_user_meta($userdata->ID, 'is_active', true) || user_can($userdata->ID, 'manage_options');\n\n if (!$isActivated) {\n $userdata = new WP_Error(\n 'confirmation_error',\n __('<strong>ERROR:</strong> We have not yet activated your account. If you have any questions please use the form at the bottom of the page.')\n );\n }\n return $userdata;\n}", "function crowdx_install(){\r\n if (!is_plugin_active('phpx/phpx.php')){\r\n die('CrowdX requires the <a href=\"http://www.phpx.org/\" target=\"_new\">PHPX Framework</a>. Please install PHPX and then reinstall CrowdX.');\r\n }\r\n \r\n if (!get_option('crowdx_options')){\r\n //$sql = 'CREATE TABLE IF NOT EXISTS `' . $this->wpdb->prefix . '_cx_user` ( `wp_user_id` int(10) NOT NULL, `cx_user_active` tinyint(1) NOT NULL DEFAULT \\'0\\', UNIQUE KEY `wp_user_id` (wp_user_id`), KEY `cx_user_active` (`cx_user_active`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;';\r\n //$this->wpdb->query($sql);\r\n \r\n $options = array();\r\n $options['enable'] = false;\r\n $options['all_users'] = false;\r\n $options['server'] = 'http://yourserver';\r\n \r\n \r\n update_option('crowdx_options', $options);\r\n }\r\n }", "function wp_new_user_notification($user_id, $plaintext_pass = '', $flag='') {\r\n\tif(func_num_args() > 1 && $flag !== 1)\r\n\t\treturn;\r\n\r\n\t$user = new WP_User($user_id);\r\n\r\n\t$user_login = stripslashes($user->user_login);\r\n\t$user_email = stripslashes($user->user_email);\r\n\r\n\t// The blogname option is escaped with esc_html on the way into the database in sanitize_option\r\n\t// we want to reverse this for the plain text arena of emails.\r\n\t$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);\r\n\r\n\t$message = sprintf(__('New user registration on your site %s:'), $blogname) . \"\\r\\n\\r\\n\";\r\n\t$message .= sprintf(__('Username: %s'), $user_login) . \"\\r\\n\\r\\n\";\r\n\t$message .= sprintf(__('E-mail: %s'), $user_email) . \"\\r\\n\";\r\n\r\n\t@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);\r\n\t\r\n\tif ( empty($plaintext_pass) )\r\n\t\treturn;\r\n\r\n\t// 你可以在此修改发送给用户的注册通知Email\r\n\t$message = sprintf(__('Username: %s'), $user_login) . \"\\r\\n\";\r\n\t$message .= sprintf(__('Password: %s'), $plaintext_pass) . \"\\r\\n\";\r\n\t$message .= '登陆网址: ' . wp_login_url() . \"\\r\\n\";\r\n\r\n\t// sprintf(__('[%s] Your username and password'), $blogname) 为邮件标题\r\n\twp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);\r\n}", "function callback_handler() {\n global $CFG, $DB, $SESSION;\n \n $client_key = $this->config->client_key;\n $client_secret = $this->config->client_secret;\n $wordpress_host = $this->config->wordpress_host;\n \n // strip the trailing slashes from the end of the host URL to avoid any confusion (and to make the code easier to read)\n $wordpress_host = rtrim($wordpress_host, '/');\n \n // at this stage we have been provided with new permanent token\n $connection = new BasicOAuth($client_key, $client_secret, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\n \n $connection->host = $wordpress_host . \"/wp-json\";\n \n $connection->accessTokenURL = $wordpress_host . \"/oauth1/access\";\n \n $tokenCredentials = $connection->getAccessToken($_REQUEST['oauth_verifier']);\n \n if(isset($tokenCredentials['oauth_token']) && isset($tokenCredentials['oauth_token_secret'])) {\n \n $perm_connection = new BasicOAuth($client_key, $client_secret, $tokenCredentials['oauth_token'],\n $tokenCredentials['oauth_token_secret']);\n \n $account = $perm_connection->get($wordpress_host . '/wp-json/wp/v2/users/me?context=edit');\n \n if(isset($account)) {\n // firstly make sure there isn't an email collision:\n if($user = $DB->get_record('user', array('email'=>$account->email))) {\n if($user->auth != 'wordpress') {\n print_error('usercollision', 'auth_wordpress');\n }\n }\n \n // check to determine if a user has already been created... \n if($user = authenticate_user_login($account->username, $account->username)) {\n // TODO update the current user with the latest first name and last name pulled from WordPress?\n \n if (user_not_fully_set_up($user, false)) {\n $urltogo = $CFG->wwwroot.'/user/edit.php?id='.$user->id.'&amp;course='.SITEID;\n // We don't delete $SESSION->wantsurl yet, so we get there later\n \n }\n } else {\n require_once($CFG->dirroot . '/user/lib.php');\n \n // we need to configure a new user account\n $user = new stdClass();\n \n $user->mnethostid = $CFG->mnet_localhost_id;\n $user->confirmed = 1;\n $user->username = $account->username;\n $user->password = AUTH_PASSWORD_NOT_CACHED;\n $user->firstname = $account->first_name;\n $user->lastname = $account->last_name;\n $user->email = $account->email;\n $user->description = $account->description;\n $user->auth = 'wordpress';\n \n $id = user_create_user($user, false);\n \n $user = $DB->get_record('user', array('id'=>$id));\n }\n \n complete_user_login($user);\n \n if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) {\n $urltogo = $SESSION->wantsurl; /// Because it's an address in this site\n unset($SESSION->wantsurl);\n \n } else {\n $urltogo = $CFG->wwwroot.'/'; /// Go to the standard home page\n unset($SESSION->wantsurl); /// Just in case\n }\n \n /// Go to my-moodle page instead of homepage if defaulthomepage enabled\n if (!has_capability('moodle/site:config',context_system::instance()) and !empty($CFG->defaulthomepage) && $CFG->defaulthomepage == HOMEPAGE_MY and !isguestuser()) {\n if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {\n $urltogo = $CFG->wwwroot.'/my/';\n }\n }\n \n redirect($urltogo);\n \n exit;\n }\n }\n }", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public function regNewUser( $data ){\n\n\t\t$success = parent::regNewUser( $data );\n\t\n\t\tif( is_array( $success ) ){\n\t\t \treturn $this->createAnswer( 1,\"Username or email already exist\",403 );\n\t\t}elseif ( $success ){\n\t\t\treturn $this->createAnswer( 0,\"Congratulation you got permission\" );\n\t\t}else{\n\t\t return $this->createAnswer( 1,\"invalid query\",402 );\n\t\t}\n\t}", "public function register() {\n\n define('KDEBUG_JSON', true);\n\n $errors = array();\n $success = true;\n\n $slug = user::generateUniqueUsername($_REQUEST['username']);\n if (!isset($_REQUEST['username']) || empty($_REQUEST['username']) || $_REQUEST['username'] == 'Full name') {\n $errors['register_username'] = 'You must specify your Full Name';\n $success = false;\n } elseif (user::findOne(array('slug' => $slug))) {\n $errors['register_username'] = 'This username already exists';\n $success = false;\n }\n\n if (!isset($_REQUEST['email']) || empty($_REQUEST['email']) || $_REQUEST['email'] == 'email address') {\n $errors['register_email'] = 'You must specify an e-mail address';\n $success = false;\n } elseif (!filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL)) {\n $errors['register_email'] = 'Invalid e-mail address';\n $success = false;\n } elseif (user::findOne(array('email' => $_REQUEST['email'])) != null) {\n $errors['register_email'] = 'This e-mail address already exists';\n $success = false;\n }\n\n\n if (!isset($_REQUEST['password']) || empty($_REQUEST['password']) || $_REQUEST['password'] == 'password') {\n $errors['register_password'] = 'You must specify a password';\n $success = false;\n } elseif (user::verify('password', $_REQUEST['password']) !== true) {\n $errors['register_password'] = user::verify('password', $_REQUEST['password']);\n $success = false;\n }\n\n if ($_REQUEST['password'] != $_REQUEST['verify']) {\n $errors['register_verify'] = 'Your passwords do not match';\n $success = false;\n }\n\n if ($success) {\n\n // create our new user\n $user = new user();\n $user->email = $_REQUEST['email'];\n $user->username = $_REQUEST['username'];\n $user->slug = $slug;\n\n $user->public = 1;\n $user->created = time();\n $user->updated = time();\n $user->password = crypt($_REQUEST['password']);\n $user->save();\n $user->login();\n\n }\n\n echo json_encode(array('success' => $success, 'errors' => $errors));\n return true;\n\n }", "function obdiy_auto_login_new_user( $user_id ) {\n\twp_set_current_user( $user_id );\n\twp_set_auth_cookie( $user_id, false, is_ssl() );\n}", "function signup_wptc_server_wptc() {\r\n\r\n\tWPTC_Base_Factory::get('Wptc_App_Functions')->verify_ajax_requests();\r\n\r\n\t$config = WPTC_Factory::get('config');\r\n\r\n\t$email = trim($config->get_option('main_account_email', true));\r\n\t$emailhash = md5($email);\r\n\t$email_encoded = base64_encode($email);\r\n\r\n\t$pwd = trim($config->get_option('main_account_pwd', true));\r\n\t$pwd_encoded = base64_encode($pwd);\r\n\r\n\tif (empty($email) || empty($pwd)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\twptc_log($email, \"--------email--------\");\r\n\r\n\t$name = trim($config->get_option('main_account_name'));\r\n\t// $cron_url = site_url('wp-cron.php'); //wp cron commented because of new cron\r\n\t$cron_url = get_wptc_cron_url();\r\n\r\n\t$app_id = 0;\r\n\tif ($config->get_option('appID')) {\r\n\t\t$app_id = $config->get_option('appID');\r\n\t}\r\n\r\n\t//$post_string = \"name=\" . $name . \"&emailhash=\" . $emailhash . \"&cron_url=\" . $cron_url . \"&email=\" . $email_encoded . \"&pwd=\" . $pwd_encoded . \"&site_url=\" . home_url();\r\n\r\n\t$post_arr = array(\r\n\t\t'email' => $email_encoded,\r\n\t\t'pwd' => $pwd_encoded,\r\n\t\t'cron_url' => $cron_url,\r\n\t\t'site_url' => home_url(),\r\n\t\t'name' => $name,\r\n\t\t'emailhash' => $emailhash,\r\n\t\t'app_id' => $app_id,\r\n\t);\r\n\r\n\t$result = do_cron_call_wptc('signup', $post_arr);\r\n\r\n\t$resarr = json_decode($result);\r\n\r\n\twptc_log($resarr, \"--------resarr-node reply--------\");\r\n\r\n\tif (!empty($resarr) && $resarr->status == 'success') {\r\n\t\t$config->set_option('wptc_server_connected', true);\r\n\t\t$config->set_option('signup', 'done');\r\n\t\t$config->set_option('appID', $resarr->appID);\r\n\r\n\t\tinit_auto_backup_settings_wptc($config);\r\n\t\t$set = push_settings_wptc_server($resarr->appID, 'signup');\r\n\t\tif (WPTC_ENV !== 'production') {\r\n\t\t\t// echo $set;\r\n\t\t}\r\n\r\n\t\t$to_url = network_admin_url() . 'admin.php?page=wp-time-capsule';\r\n\t\treturn true;\r\n\t} else {\r\n\t\t$config->set_option('last_service_error', $result);\r\n\t\t$config->set_option('appID', false);\r\n\r\n\t\tif (WPTC_ENV !== 'production') {\r\n\t\t\techo \"Creating Cron service failed\";\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}", "function ajax_login_register_init()\n{\n\n // Enable the user with no privileges to run ajax_login() in AJAX\n add_action('wp_ajax_nopriv_ajaxlogin', 'ajax_login');\n\n add_action('wp_ajax_nopriv_register_user', 'ajax_reg_new_user');\n\n}", "function eve_api_form_user_register_form_alter(&$form, &$form_state) {\n global $user;\n\n unset($form['actions']);\n\n $account = $form['#user'];\n $register = ((int) $form['#user']->uid > 0 ? FALSE : TRUE);\n\n $admin = user_access('administer users');\n\n $form['account']['#type'] = 'fieldset';\n $form['account']['#title'] = t('Blue Status Verified');\n $form['account']['#description'] = t('Please select your main character from the drop down box. This character will be used to identify yourself throughout the site and various tools.');\n\n $form['#validate'] = array(\n 'eve_api_user_register_form_validate',\n 'user_account_form_validate',\n 'user_validate_picture',\n 'user_register_validate',\n );\n\n $form['#submit'] = array(\n 'user_register_submit',\n 'eve_api_user_register_form_submit',\n 'ctools_wizard_submit',\n );\n\n if (!is_array($form_state['signup_object'])) {\n form_set_error('keyID', t('Unknown Error, please try again.'));\n form_set_error('vCode');\n drupal_goto('user/register');\n }\n\n $key_id = (int) $form_state['signup_object']['keyID'];\n $v_code = (string) $form_state['signup_object']['vCode'];\n\n $query = array(\n 'keyID' => $key_id,\n 'vCode' => $v_code,\n );\n\n $characters = eve_api_get_api_key_info_api($query);\n\n if (isset($characters['error'])) {\n form_set_error('keyID', t('Unknown Error, please try again.'));\n form_set_error('vCode');\n drupal_goto('user/register');\n }\n\n $whitelist = array();\n\n if (!empty($characters)) {\n foreach ($characters['characters'] as $character) {\n $whitelist[] = (int) $character['characterID'];\n }\n }\n\n $result = db_query('SELECT characterID FROM {eve_api_whitelist} WHERE characterID IN (:characterIDs)', array(\n ':characterIDs' => $whitelist,\n ));\n\n $allow_expires = variable_get('eve_api_require_expires', FALSE) ? FALSE : !empty($characters['expires']);\n $allow_type = variable_get('eve_api_require_type', TRUE) ? $characters['type'] != 'Account' : FALSE;\n\n if ($result->rowCount()) {\n if ($allow_expires || ($characters['accessMask'] & 8388680) != 8388680) {\n form_set_error('keyID', t('Unknown Error, please try again.'));\n form_set_error('vCode');\n drupal_goto('user/register');\n }\n }\n else {\n if ($allow_expires || $allow_type || ($characters['accessMask'] & variable_get('eve_api_access_mask', 268435455)) != variable_get('eve_api_access_mask', 268435455)) {\n form_set_error('keyID', t('Unknown Error, please try again.'));\n form_set_error('vCode');\n drupal_goto('user/register');\n }\n }\n\n if (!eve_api_verify_blue($characters)) {\n form_set_error('keyID', t('Unknown Error, please try again.'));\n form_set_error('vCode');\n drupal_goto('user/register');\n }\n\n if (eve_api_characters_exist($characters)) {\n form_set_error('keyID', t('Unknown Error, please try again.'));\n form_set_error('vCode');\n drupal_goto('user/register');\n }\n\n if (!variable_get('eve_api_require_blue', FALSE)) {\n $valid_characters_list = eve_api_list_valid_characters($characters);\n }\n else {\n $valid_characters_list = eve_api_list_valid_characters($characters, FALSE);\n }\n\n $form['account']['name'] = array(\n '#type' => 'select',\n '#title' => t('Select your Main Character'),\n '#options' => drupal_map_assoc($valid_characters_list),\n '#description' => t('Detected valid Main Characters.'),\n '#required' => TRUE,\n '#empty_option' => t('- Select a New Character -'),\n '#attributes' => array('class' => array('username')),\n '#access' => ($register || ($user->uid == $account->uid && user_access('change own username')) || $admin),\n '#weight' => -10,\n );\n}", "function user_signup($Oau_postgrads)\n\t{\n\n\t\tglobal $Oau_auth;\n\n\t\tarray_walk($Oau_postgrads, 'array_sanitize');\n\t\t$Oau_postgrads['password'] = md5($Oau_postgrads['password']);\n\t\t$fields = '`' .implode('`, `', array_keys($Oau_postgrads)) . '`';\n\t\t$data = '\\'' .implode('\\', \\'', $Oau_postgrads) . '\\'';\n\t\t$query = \"INSERT INTO `student` ($fields) VALUES ($data)\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\temail($Oau_postgrads['email'], 'Activate your account', \"\n\t\tHello \" . $Oau_postgrads['fname'] .\", \\n\\n\n\n\t\tYou need to activate your student login account, so use the link below:\\n\\n\n\n\t\thttp://www.oau-pgtranscript.senttrigg.com/activate.php?email=\" .$Oau_postgrads['email']. \"&email_code=\" .$Oau_postgrads['email_code']. \"\\n\\n\n\n\t\t--Oau PG Transcript\\n\\n\n\t\thttps://wwww.oau-pgtranscript.senttrigg.com\n\t\t\");\n\n\t}", "function admin_user_signup($Admin_Oau_postgrads)\n\t{\n\n\t\tglobal $Oau_auth;\n\n\t\tarray_walk($Admin_Oau_postgrads, 'array_sanitize');\n\t\t$Admin_Oau_postgrads['password'] = md5($Admin_Oau_postgrads['password']);\n\t\t$fields = '`' .implode('`, `', array_keys($Admin_Oau_postgrads)) . '`';\n\t\t$data = '\\'' .implode('\\', \\'', $Admin_Oau_postgrads) . '\\'';\n\t\t$query = \"INSERT INTO `administrator` ($fields) VALUES ($data)\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\temail($Admin_Oau_postgrads['email'], 'Activate your account', \"\n\t\tHello \" . $Admin_Oau_postgrads['fname'] .\", \\n\\n\n\n\t\tYou need to activate your admin login account, so use the link below:\\n\\n\n\n\t\thttp://www.oau-pgtranscript.senttrigg.com/admin/activate.php?email=\" .$Admin_Oau_postgrads['email']. \"&email_code=\" .$Admin_Oau_postgrads['email_code']. \"\\n\\n\n\n\t\t--Oau PG Transcript\\n\\n\n\t\thttps://wwww.oau-pgtranscript.senttrigg.com\n\t\t\");\n\t}", "public function paml_register_new_user( $user_login, $user_email ) {\n\t\tglobal $paml_options;\n\t\t$labels = $paml_options['modal-labels'];\n \n\t\t$errors = new WP_Error();\n\t\t$sanitized_user_login = sanitize_user( $user_login );\n\t\t$user_email = apply_filters( 'user_registration_email', $user_email );\n\n\t\t// Check the username was sanitized\n\t\tif ( $sanitized_user_login == '' ) {\n\t\t\t$errors->add( 'empty_username', __( 'Please enter a username.', 'pressapps' ) );\n\t\t} elseif ( ! validate_username( $user_login ) ) {\n\t\t\t$errors->add( 'invalid_username', __( 'This username is invalid because it uses illegal characters. Please enter a valid username.', 'pressapps' ) );\n\t\t\t$sanitized_user_login = '';\n\t\t} elseif ( username_exists( $sanitized_user_login ) ) {\n\t\t\t$errors->add( 'username_exists', __( 'This username is already registered. Please choose another one.', 'pressapps' ) );\n\t\t}\n\n\t\t// Check the email address\n\t\tif ( $user_email == '' ) {\n\t\t\t$errors->add( 'empty_email', __( 'Please type your email address.', 'pressapps' ) );\n\t\t} elseif ( ! is_email( $user_email ) ) {\n\t\t\t$errors->add( 'invalid_email', __( 'The email address isn\\'t correct.', 'pressapps' ) );\n\t\t\t$user_email = '';\n\t\t} elseif ( email_exists( $user_email ) ) {\n\t\t\t$errors->add( 'email_exists', __( 'This email is already registered, please choose another one.', 'pressapps' ) );\n\t\t}\n /**\n * password Validation if the User Defined Password Is Allowed\n */\n if(isset($paml_options['userdefine_password'])){\n if(empty($_REQUEST['password'])){\n $errors->add( 'empty_password', __( 'Please type your password.', 'pressapps' ) );\n }elseif (strlen($_REQUEST['password'])<6) {\n $errors->add( 'minlength_password', __( 'Password must be 6 character long.', 'pressapps' ) );\n }elseif ($_REQUEST['password'] != $_REQUEST['cpassword']) {\n $errors->add( 'unequal_password', __( 'Passwords do not match.', 'pressapps' ) );\n }\n }\n \n\t\t$errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );\n\n\t\tif ( $errors->get_error_code() )\n\t\t\treturn $errors;\n $user_pass = (isset($paml_options['userdefine_password']))?$_REQUEST['password']:wp_generate_password( 12, false );\n\t\t$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );\n\n\t\tif ( ! $user_id ) {\n\t\t\t$errors->add( 'registerfail', __( 'Couldn\\'t register you... please contact the site administrator', 'pressapps' ) );\n\n\t\t\treturn $errors;\n\t\t}\n\n\t\tupdate_user_option( $user_id, 'default_password_nag', true, true ); // Set up the Password change nag.\n \n if(isset($paml_options['userdefine_password'])){\n $data['user_login'] = $user_login;\n $data['user_password'] = $user_pass;\n $user_login = wp_signon( $data, false );\n }\n \n $user = get_userdata( $user_id );\n // The blogname option is escaped with esc_html on the way into the database in sanitize_option\n // we want to reverse this for the plain text arena of emails.\n $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);\n\n $message = sprintf(__('New user registration on your site %s:', 'pressapps'), $blogname) . \"\\r\\n\\r\\n\";\n $message .= sprintf(__('Username: %s', 'pressapps'), $user->user_login) . \"\\r\\n\\r\\n\";\n $message .= sprintf(__('Email: %s', 'pressapps'), $user->user_email) . \"\\r\\n\";\n\n @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration', 'pressapps'), $blogname), $message);\n\n if ( empty($user_pass) )\n return;\n\n $message = sprintf(__('Username: %s', 'pressapps'), $user->user_login) . \"\\r\\n\";\n $message .= sprintf(__('Password: %s', 'pressapps'), $user_pass) . \"\\r\\n\";\n $message .= wp_login_url() . \"\\r\\n\";\n\n \n \n $email_detail = array(\n 'subject' => sprintf(__('[%s] Your username and password', 'pressapps'), $blogname),\n 'body' => $message,\n );\n \n \n $pattern = array('#\\%username\\%#','#\\%password\\%#','#\\%loginlink\\%#');\n $replacement = array($user->user_login,$user_pass,wp_login_url());\n $subject = trim($paml_options['reg_email_subject']);\n $body = trim($paml_options['reg_email_template']);\n \n if(!empty($subject))\n $email_detail['subject'] = @preg_replace($pattern,$replacement, $subject);\n \n if(!empty($body))\n $email_detail['body'] = @preg_replace($pattern,$replacement, $body);\n \n \n @wp_mail($user->user_email,$email_detail['subject'] , $email_detail['body']);\n \n //@todo\n\t\t//wp_new_user_notification( $user_id, $user_pass );\n\n\t\treturn $user_id;\n\t}", "public function process_new_wp_reg ($userID) { \n\t\tglobal $phpbbForum;\n\t\t\n\t\tstatic $justCreatedUser = -1;\n\n\t\t/*\n\t\t * if we've already created a user in this session, \n\t\t * it is likely an error from a plugin calling the user_register hook \n\t\t * after wp_insert_user has already called it. The Social Login plugin does this\n\t\t * \n\t\t * At any rate, it is pointless to check twice\n\t\t */\n\t\tif($justCreatedUser === $userID) {\n\t\t\t\treturn;\n\t\t}\n\n\t\t// some registration plugins don't init WP and call the action hook directly. This is enough to get us a phpBB env\n\t\t$this->init_plugin();\n\t\t\t\n\t\t// neeed some user add / delete functions\n\t\tif ( ! defined('WP_ADMIN') ) {\n\t\t\trequire_once(ABSPATH . 'wp-admin/includes/user.php');\n\t\t}\n\n\n\t\tif ($this->get_setting('integrateLogin')) {\n\t\t\t\n\t\t\t$errors = new WP_Error();\n\t\t\t$user = get_userdata($userID);\n\n\t\t\t$result = wpu_validate_new_user($user->user_login, $user->user_email , $errors);\n\n\t\t\tif($result !== false) { \n\t\t\t\t// An error occurred validating the new WP user, remove the user.\n\t\t\t\t\n\t\t\t\twp_delete_user($userID, 0);\n\t\t\t\t$message = '<h1>' . __('Error:', 'wp-united') . '</h1>';\n\t\t\t\t$message .= '<p>' . implode('</p><p>', $errors->get_error_messages()) . '</p><p>';\n\t\t\t\t$message .= __('Please go back and try again, or contact an administrator if you keep seeing this error.', 'wp-united') . '</p>';\n\t\t\t\twp_die($message);\n\t\t\t\t\n\t\t\t\texit();\n\t\t\t} else { \n\t\t\t\t// create new integrated user in phpBB to match\n\t\t\t\t$phpbbID = wpu_create_phpbb_user($userID);\n\t\t\t\t$justCreatedUser = $userID;\n\t\t\t\twpu_sync_profiles($user, $phpbbForum->get_userdata('', $phpbbID), 'sync');\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public function ocenture_insert() {\r\n\r\n Logger::log(\"inserting user manually into ocenture\");\r\n require_once( OCENTURE_PLUGIN_DIR . 'lib/Ocenture.php' );\r\n\r\n $ocenture = new Ocenture_Client($this->clientId);\r\n\r\n $params = [\r\n 'args' => [\r\n 'ProductCode' => 'YP83815',\r\n 'ClientMemberID' => 'R26107633',\r\n 'FirstName' => 'Francoise ',\r\n 'LastName' => 'Rannis Arjaans',\r\n 'Address' => '801 W Whittier Blvd',\r\n 'City' => 'La Habra',\r\n 'State' => 'CA',\r\n 'Zipcode' => '90631-3742',\r\n 'Phone' => '(562) 883-3000',\r\n 'Email' => '[email protected]',\r\n 'Gender' => 'Female',\r\n 'RepID' => '101269477',\r\n ]\r\n ];\r\n \r\n Logger::log($params);\r\n $result = $ocenture->createAccount($params);\r\n //if ($result->Status == 'Account Created') \r\n {\r\n $params['args']['ocenture'] = $result;\r\n $this->addUser($params['args']); \r\n }\r\n Logger::log($result);\r\n \r\n }", "function woo_supportpress_install() {\n\t\n\tglobal $wp_rewrite;\n\t\t\n\twoo_supportpress_install_pages();\n\twoo_supportpress_install_default_taxonomies();\n\twoo_supportpress_install_tables();\n\t\n\t/* Reg option */\n\tupdate_option('users_can_register', 1);\n\t\n\t/* Default notification settings */\n\t$admin_user = get_user_by_email( get_option('admin_email') );\n\tif ($admin_user->ID>0) :\n\t\tadd_user_meta($admin_id, 'new_ticket_notification', 'yes');\n\t\tadd_user_meta($admin_id, 'new_message_notification', 'yes');\n\t\tadd_user_meta($admin_id, 'watched_item_notification', 'yes');\n\tendif;\n\t\n\t$wp_rewrite->flush_rules();\n}", "public function register(){\n\t\t//Better to be implemented through db table\n\t\t$userRole = array('Job Seeker'=>'Job Seeker', 'Employer'=>'Employer');\n\t\t$this->set('userRole',$userRole);\n\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\t\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash(__('You are now registered and may login'));\n\t\t\t\treturn $this->redirect(array('controller'=>'jobs','action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Unable to create new user'));\n\n\t\t\t}\n\t\t}\n\t}", "function wp_user_settings()\n {\n }", "public function register_user($data) \n\t{\n\t\t$user = array(\n\t\t\t'login' => $data['inputPseudo'],\n\t\t\t'mail' => $data['inputEmail'],\n\t\t\t'password' => md5($this->hash_key . $data['inputPassword']),\n\t\t\t'user_group' => 3,\n\t\t);\n\t\t$result = $this->user->create($user);\n\t\treturn $result;\n\t}", "public function createUserFromSocialite($user);", "public function check_insta_user() {\n \n }", "function register_user($username, $email, $password){\n global $connection;\n\n $password = password_hash($password, PASSWORD_BCRYPT, array('cost' => 10));\n\n $query = \"INSERT INTO users(user_name, user_email, user_password, user_role) \";\n $query .= \"VALUES('{$username}', '{$email}', '{$password}', 'Subscriber') \";\n $register_query = mysqli_query($connection, $query);\n\n confirm($register_query);\n}", "public function logInRegisterPage();", "function wp_password_change_notification($user)\n {\n }", "function new_user($firstName,$lastName,$email,$password){\t\n $salt = generate_salt();\n $encPassword = encrypt_password($password,$salt);\n\n //$user = create_user_object($firstName,$lastName,$email,$encPassword,$salt,$userType);\n save_user_info($firstName,$lastName,$email,$encPassword,$salt);\n \n return true;\n}", "public static function register_mutation() {\n\t\tregister_graphql_mutation(\n\t\t\t'createUser',\n\t\t\t[\n\t\t\t\t'inputFields' => array_merge(\n\t\t\t\t\t[\n\t\t\t\t\t\t'username' => [\n\t\t\t\t\t\t\t'type' => [\n\t\t\t\t\t\t\t\t'non_null' => 'String',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t// translators: the placeholder is the name of the type of post object being updated\n\t\t\t\t\t\t\t'description' => __( 'A string that contains the user\\'s username for logging in.', 'wp-graphql' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\tself::get_input_fields()\n\t\t\t\t),\n\t\t\t\t'outputFields' => self::get_output_fields(),\n\t\t\t\t'mutateAndGetPayload' => self::mutate_and_get_payload(),\n\t\t\t]\n\t\t);\n\t}" ]
[ "0.6712727", "0.65420777", "0.6436557", "0.63906527", "0.6331135", "0.6331101", "0.63111013", "0.63081783", "0.6228033", "0.61851543", "0.6169087", "0.6152797", "0.6145179", "0.61308134", "0.6096465", "0.6089725", "0.6088785", "0.60845447", "0.60621464", "0.6053979", "0.60467166", "0.6041991", "0.6041083", "0.6019552", "0.6016582", "0.59835017", "0.5979118", "0.597328", "0.5971308", "0.5968425", "0.59638596", "0.5961885", "0.5954469", "0.5928077", "0.5922064", "0.59215635", "0.59188336", "0.5895466", "0.5893753", "0.5884523", "0.58620113", "0.58548415", "0.58391106", "0.5837312", "0.5831597", "0.5827093", "0.5816913", "0.58094454", "0.57997495", "0.5797118", "0.5794833", "0.57946336", "0.5783038", "0.5767854", "0.57658726", "0.5752327", "0.5750413", "0.5749045", "0.57478523", "0.5747664", "0.5738205", "0.57322925", "0.57255745", "0.5717505", "0.57083404", "0.57080716", "0.5689172", "0.56840384", "0.56840193", "0.56801265", "0.5672787", "0.5668375", "0.56631625", "0.5661256", "0.56610703", "0.56610703", "0.56610703", "0.56610703", "0.5658048", "0.5657117", "0.5653043", "0.5647558", "0.5643719", "0.5623711", "0.5614365", "0.561416", "0.56107897", "0.56087613", "0.56073976", "0.56008196", "0.5599529", "0.5596499", "0.5588145", "0.5583434", "0.55777043", "0.5577481", "0.5574919", "0.557431", "0.55735147", "0.5570166" ]
0.78215736
0
Initialization Autoloader, Session, Auth, Locale,
protected function _initAutoload() { $_startTime = microtime(1); //------- Define the autoloader parameters ------------ // Define basic prefix and the base path to the resources for the default module $autoloader = new Zend_Application_Module_Autoloader( array('namespace' => 'Default', 'basePath' => dirname(__FILE__))); // Add resource loader for admin module $resourceLoader = new Zend_Loader_Autoloader_Resource(array( 'basePath' => APPLICATION_PATH . '/modules/admin', 'namespace' => 'Admin', 'resourceTypes' => array( 'form' => array( 'path' => 'forms/', 'namespace' => 'Form', ) ), )); //------- Create an application directory ------------ Default_Plugin_SysBox::createAppPaths(); //--------- Remember the configuration to register --------- $config = $this->_options; Zend_Registry::set('config', $config); //------- Copy users upload dir ------------ Default_Plugin_SysBox::copyUsersUploadDir(); //----------------- Set session --------------- // Start session Zend_Session::start(); // Install option in order to prevent re-execution // Zend_Session::start() when calling (new Zend_Session_Namespace) Zend_Session::setOptions(array('strict' => true)); // Obtain an instance session object for the appropriate namespace $Zend_Auth = new Zend_Session_Namespace('Zend_Auth'); // Save to Registry Zend_Registry::set("Zend_Auth", $Zend_Auth); // Add a new type of resource controllers for plug-ins //$autoloader->addResourceType('cplugins', 'controllers/plugins', 'Controller_Plugins'); //---- Configuring user authentication ----- $auth = Zend_Auth::getInstance(); $auth->setStorage(new Zend_Auth_Storage_Session()); //------ Registering plugins --------- // Start 'FrontController' $this->bootstrap('FrontController'); $front = Zend_Controller_Front::getInstance(); // The plugin checks the user's access to resources $front->registerPlugin( new Default_Plugin_AclManager($auth)); //------------ Configure language translation ------------- $translate = new Zend_Translate('array', APPLICATION_PATH . '/languages/ru/My_Messages.php', 'ru'); $translate->addTranslation( APPLICATION_PATH . '/languages/ru/Zend_Validate.php', 'ru'); $translate->addTranslation( APPLICATION_PATH . '/languages/ru/My_Validate.php', 'ru'); $translate->addTranslation( APPLICATION_PATH . '/languages/uk/My_Messages.php', 'uk'); $translate->addTranslation( APPLICATION_PATH . '/languages/uk/Zend_Validate.php', 'uk'); $translate->addTranslation( APPLICATION_PATH . '/languages/uk/My_Validate.php', 'uk'); $translate->addTranslation( APPLICATION_PATH . '/languages/en/My_Messages.php', 'en'); $translate->addTranslation( APPLICATION_PATH . '/languages/en/Zend_Validate.php', 'en'); $translate->addTranslation( APPLICATION_PATH . '/languages/en/My_Validate.php', 'en'); //------------ Configure language translation modules ------------- $translate->addTranslation( APPLICATION_PATH . '/modules/hr/languages/ru/My_Messages.php', 'ru'); $translate->addTranslation( APPLICATION_PATH . '/modules/hr/languages/uk/My_Messages.php', 'uk'); $translate->addTranslation( APPLICATION_PATH . '/modules/hr/languages/en/My_Messages.php', 'en'); // Set the default translation language if (!isset($Zend_Auth->translate_locale)) { $Zend_Auth->translate_locale = $config['user']['locale']; } else { $locale = $Zend_Auth->translate_locale; $newLocal = Default_Plugin_SysBox::isUpdateTranslateLocale($locale); if (!$newLocal === FALSE) { $Zend_Auth->translate_locale = $newLocal; } } $translate->setLocale($Zend_Auth->translate_locale); // Save to Registry Zend_Registry::set('Zend_Translate', $translate); //------------ Configure site localization ------------- // Get type localization $paramLocal = Default_Plugin_SysBox::getLocalParam( $Zend_Auth->translate_locale); // Set localization $locale = new Zend_Locale($paramLocal); // Set timezone date_default_timezone_set($config['user']['timezone']); // Save to Registry Zend_Registry::set('Zend_Locale', $locale); //------------ Set the color scheme of the site ------------- if (!isset($Zend_Auth->user_scheme)) { $Zend_Auth->user_scheme = $config['user']['scheme']; } else { $scheme = $Zend_Auth->user_scheme; $newScheme = Default_Plugin_SysBox::getUserScheme($scheme); if ($newScheme !== $scheme) { $Zend_Auth->user_scheme = $newScheme; } } //---- Defining script execution time ---- $infoProfiler = Default_Plugin_SysBox::Translate("Время выполнения") . " Bootstrap_initAutoload(): "; Default_Plugin_SysBox::profilerTime2Registry($_startTime, $infoProfiler); return $autoloader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function init(){\r\n\t\t//Create the session authentication controller and internal data storage\r\n\t\tif(!static::$auth){\r\n\t\t\tstatic::$auth = new Authenticator();\r\n\t\t\tstatic::$data = new Internal();\r\n\t\t}\r\n\t\t\r\n\t\t//Initialize supplied modules\r\n\t\tforeach(func_get_args() as $arg){\r\n\t\t\tif($arg instanceof ISessionStorage){\r\n\t\t\t\tstatic::$data = $arg;\r\n\t\t\t}elseif($arg instanceof ISessionExtra){\r\n\t\t\t\tstatic::$extra[get_class($arg)] = $arg;\r\n\t\t\t}elseif($arg instanceof IAuthenticator){\r\n\t\t\t\tstatic::$auth->setAuthenticator($arg);\r\n\t\t\t}elseif($arg instanceof ISessionSource){\r\n\t\t\t\tstatic::$auth->setSource($arg);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "public static function init() {\n\t\t\tself::initErrorHandler();\n\t\t\tself::loadAppConfig();\n\t\t\tself::initDatabase();\n\t\t\tHttpCore::initSession();\n\t\t\tAuth::init();\n\t\t\tself::$baseUrl = HttpCore::getBaseUrl();\n\t\t\tself::loadRoutes();\n\t\t\tself::loadWidgets();\n\t\t}", "public static function _init()\n {\n \\Module::load('authentication');\n }", "public function init()\n {\n \t$this->auth=Zend_Auth::getInstance();\n\n\t\tif($this->auth->hasIdentity()){\n\n\t\t\t$this->authIdentity=$this->auth->getIdentity();\n\n\t\t}\n\n\t\t$this->registry=Zend_Registry::getInstance();\n }", "public function initialize()\n {\n parent::initialize();\n\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Auth', ['authenticate' =>\n ['ADmad/JwtAuth.Jwt' => [\n 'parameter' => 'token',\n 'userModel' => 'Sessions',\n 'fields' => [\n 'username' => 'username'\n ],\n 'scope' => ['Sessions.status' => 1],\n 'queryDatasource' => true\n ]\n ],'storage' => 'Memory',\n 'checkAuthIn' => 'Controller.initialize',\n 'loginAction' => false,\n 'unauthorizedRedirect' => false]);\n $this->loadComponent('Paginator');\n $this->loadComponent('BryanCrowe/ApiPagination.ApiPagination',[\n 'visible' => [\n 'page',\n 'current',\n 'count',\n 'perPage',\n 'prevPage',\n 'nextPage'\n ]\n ]);\n }", "public function initialize() \n {\n $this->setEngine(RequestEngine::class);\n $this->setStorage(SessionStorage::class);\n }", "public function initialize()\n {\n parent::initialize();\n\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie', [\n 'expires' => Configure::read('Config.CookieExpires'),\n 'httpOnly' => true\n ]);\n $this->loadComponent('Common');\n $this->loadComponent('Auth', array(\n 'loginRedirect' => false,\n 'logoutRedirect' => false,\n 'loginAction' => array(\n 'controller' => 'customers',\n 'action' => 'login',\n 'plugin' => null\n ),\n 'sessionKey' => 'Auth.ChoTreo'\n ));\n }", "public static function init()\n\t{\n\t\tself::$config = Kohana::$config->load('core')->as_array();\n\t\tself::$log = new Fusion_Log;\n\n\t\ttry\n\t\t{\n\t\t\t// Get the current active/logged in user\n\t\t\tself::$user = Sentry::getUser();\n\t\t}\n\t\tcatch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n\t\t{\n\t\t\t// User wasn't found, should only happen if the user was deleted\n\t\t\t// when they were already logged in or had a \"remember me\" cookie set\n\t\t\t// and they were deleted.\n\t\t\tself::$user = null;\n\t\t}\n\n\t\tself::$permissions = Permissions::instance();\n\t\tself::$mail = new Mail;\n\t\tself::$assets = new Assets;\n\t}", "public static function init()\n {\n self::$browsers = new Browser_Manager();\n self::$users = new User_Manager();\n self::$routes = new Routing_Manager();\n self::$pages = new Page_Manager();\n self::$themes = new Theme_Manager();\n self::$debug = new Debug_Manager();\n\n // disable debugging if we are unit testing\n if (defined('UNIT_TEST') && UNIT_TEST)\n {\n self::$debug->setEnabled(false);\n }\n\n\t\t// with the general environment loaded, we can now load\n\t\t// the modules that are app-specific\n self::$request = new App_Request();\n self::$response = new App_Response();\n self::$conditions = new App_Conditions();\n }", "public function init()\n\t{\n\t\t$this->loader->init();\n\t\t$this->routing->init();\n\t}", "function init()\n\t{\n\t\tglobal $Options, $User_Options;\n\t\t$Options\t= $this->options\t=\t$this->get( NULL , NULL , TRUE );\n\t\t// Only when aauth is enabled\n\t\tif( Modules::is_active( 'aauth' ) )\n\t\t{\n\t\t\t$User_Options = $this->user_options = $this->get( NULL , $this->events->apply_filters( 'user_id' , 0 ) );\n\t\t}\n\t\t\n\t\t\n\t\t/**\n\t\t * If language is set on dashboard\n\t\t * @since 3.0.5\n\t\t**/\n\t\tif( riake( 'site_language', $Options ) ) {\n\t\t\tget_instance()->config->set_item( 'site_language', $Options[ 'site_language' ] );\n\t\t}\n\n\t\t/** \n\t \t * Load Language\n\t\t**/\n\t\t\n\t\t$this->lang->load( 'system' );\t\n\t}", "public function init() {\n\t //UNTUK SETTING GLOBAL BASE PATH\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->auth = Zend_Auth::getInstance();\t \n\t\t$this->view->baseData = $registry->get('baseData');\n\t\t$this->view->basePath = $registry->get('basepath');\n\t\t$this->view->procPath = $registry->get('procpath');\t \n\t\t$this->sso_serv = Sso_User_Service::getInstance();\t\n\t\t$this->penduduk_serv = Data_Penduduk_Service::getInstance();\n\t\t$this->menu_serv = Menu_Service::getInstance();\n\n\t\t$ssouserpengguna = new Zend_Session_Namespace('ssouserpengguna');\n\t\t$ssouserpassword= new Zend_Session_Namespace('ssouserpassword');\n\t\t$ssouserKodeInstansi= new Zend_Session_Namespace('ssouserKodeInstansi');\n\t\t$ssouserlevel = new Zend_Session_Namespace('ssouserlevel');\n\t\t\n\t\t$this->pengguna =$ssouserpengguna->pengguna;\t\t\t\n\t\t$this->password =$ssouserpassword->password;\n\t\t$this->KodeInstansi =$ssouserKodeInstansi->KodeInstansi;\n\t\t$this->level =$ssouserlevel->level;\n }", "public function init() {\n\t //UNTUK SETTING GLOBAL BASE PATH\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->auth = Zend_Auth::getInstance();\t \n\t\t$this->view->baseData = $registry->get('baseData');\n\t\t$this->view->basePath = $registry->get('basepath');\n\t\t$this->view->procPath = $registry->get('procpath');\t \n\t\t$this->sso_serv = Sso_User_Service::getInstance();\n\t\t$this->penduduk_serv = Data_Penduduk_Service::getInstance();\n\t\t$this->menu_serv = Menu_Service::getInstance();\n\t\t\n\t\t$ssouserpengguna = new Zend_Session_Namespace('ssouserpengguna');\n\t\t$ssouserpassword= new Zend_Session_Namespace('ssouserpassword');\n\t\t$ssouserKodeInstansi= new Zend_Session_Namespace('ssouserKodeInstansi');\n\t\t$ssouserlevel = new Zend_Session_Namespace('ssouserlevel');\n\t\t\n\t\t$this->pengguna =$ssouserpengguna->pengguna;\t\t\t\n\t\t$this->password =$ssouserpassword->password;\n\t\t$this->KodeInstansi =$ssouserKodeInstansi->KodeInstansi;\n\t\t$this->level =$ssouserlevel->level;\n }", "public function init() {\n\t //UNTUK SETTING GLOBAL BASE PATH\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->auth = Zend_Auth::getInstance();\t \n\t\t$this->view->baseData = $registry->get('baseData');\n\t\t$this->view->basePath = $registry->get('basepath');\n\t\t$this->view->procPath = $registry->get('procpath');\t \n\t\t$this->sso_serv = Sso_User_Service::getInstance();\n\t\t$this->penduduk_serv = Data_Penduduk_Service::getInstance();\n\t\t$this->menu_serv = Menu_Service::getInstance();\n\t\t\n\t\t$ssouserpengguna = new Zend_Session_Namespace('ssouserpengguna');\n\t\t$ssouserpassword= new Zend_Session_Namespace('ssouserpassword');\n\t\t$ssouserKodeInstansi= new Zend_Session_Namespace('ssouserKodeInstansi');\n\t\t$ssouserlevel = new Zend_Session_Namespace('ssouserlevel');\n\t\t\n\t\t$this->pengguna =$ssouserpengguna->pengguna;\t\t\t\n\t\t$this->password =$ssouserpassword->password;\n\t\t$this->KodeInstansi =$ssouserKodeInstansi->KodeInstansi;\n\t\t$this->level =$ssouserlevel->level;\n }", "protected function _init() {\n parent::_init();\n\n $session = $this->_config['classes']['session'];\n $this->_session = new $session();\n\n $this->_http_get = $this->sanitize($this->_config['http_get']);\n $this->_http_post = $this->sanitize($this->_config['http_post']);\n\n if ( !$this->_is_valid_request($this->_http_get)\n || !$this->_is_valid_request($this->_http_post) ) {\n $this->handle_CSRF();\n $this->_token = null;\n }\n\n if ( is_null($this->_token) ) {\n $this->_token = Auth::create_token();\n }\n\n if ( $this->_session->is_logged_in() ) {\n $user = $this->_config['classes']['user'];\n $this->_user = new $user(array('id' => $this->_session->get_user_id()));\n $this->_template = $this->_user->get_template();\n }\n }", "public static function init()\n {\n if ($DefaultLocale = Application::$Configuration->Get('DefaultLocale')) {\n Localization::$CurrentLocale = $DefaultLocale;\n }\n if ($locale = Application::$Request['lng']) {\n Localization::$CurrentLocale = $locale;\n Application::$Session['locale'] = $locale;\n } elseif ($locale = Application::$Session['locale']) {\n Localization::$CurrentLocale = $locale;\n }\n // Loading locale strings\n $localeDir = Application::$Configuration->ProjectPath . 'Localization/' . Localization::$CurrentLocale;\n if (is_dir($localeDir)) {\n $localeDirHndl = opendir($localeDir);\n while ($localeFile = readdir($localeDirHndl)) {\n if (!in_array($localeFile, array('.', '..'))) {\n require_once($localeDir . '/' . $localeFile);\n }\n }\n }\n }", "public function __construct()\n {\n \\BackendUser::getInstance();\n \\Config::getInstance();\n \\Session::getInstance();\n \\Database::getInstance();\n\n \\BackendUser::getInstance()->authenticate();\n\n \\System::loadLanguageFile('default');\n \\Backend::setStaticUrls();\n }", "public function init() {\n $session = $this->getFrontController()->getPlugin('Application_Plugin_Util')->getSession();\n \n }", "public function init()\n {\n $this->session = $this->di->get(\"session\");\n $this->message = $this->session->getOnce(self::FLASH_MESSAGE);\n $this->class = $this->session->getOnce(self::FLASH_CLASS);\n }", "public function loadInit() {}", "public function init() {\n\t\t$this -> oSettings = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', 'production');\n\t\t$this -> oAccount = Application_Model_Session::getInstance('ACCOUNT');\n\n\t\tif (!isset($this -> oAccount -> userdata['UID'])) {\n\t\t\theader('Location:' . $this -> oSettings -> website -> site -> basehref);\n\t\t\texit ;\n\t\t}\n\t\t$this -> oAccounts = new Application_Model_Account($this -> oSettings);\n\t\t$this -> oNameSpace = new Application_Model_Namespaces($this -> oSettings);\n\t}", "public function init() {\n\t //UNTUK SETTING GLOBAL BASE PATH\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->auth = Zend_Auth::getInstance();\t \n\t\t$this->view->baseData = $registry->get('baseData');\n\t\t$this->view->basePath = $registry->get('basepath');\n\t\t$this->view->procPath = $registry->get('procpath');\t \n\t\t$this->sso_serv = Sso_User_Service::getInstance();\n\t\t$this->menu_serv = Menu_Service::getInstance();\t\t\n\t\t$this->kegiatan_serv = Kegiatan_Service::getInstance();\t\t\n\t\t\n\t\t$ssouserpengguna = new Zend_Session_Namespace('ssouserpengguna');\n\t\t$ssouserpassword= new Zend_Session_Namespace('ssouserpassword');\n\t\t$ssouserKodeInstansi= new Zend_Session_Namespace('ssouserKodeInstansi');\n\t\t$ssouserlevel = new Zend_Session_Namespace('ssouserlevel');\n\t\t\n\t\t$this->pengguna =$ssouserpengguna->pengguna;\t\t\t\n\t\t$this->password =$ssouserpassword->password;\n\t\t$this->KodeInstansi =$ssouserKodeInstansi->KodeInstansi;\n\t\t$this->level =$ssouserlevel->level;\n }", "private function __construct()\n {\n // Overwrite _config from config.ini\n if ($_config = \\Phalcon\\DI::getDefault()->getShared('config')->auth) {\n foreach ($_config as $key => $value) {\n $this->_config[$key] = $value;\n }\n }\n\n $this->_cookies = \\Phalcon\\DI::getDefault()->getShared('cookies');\n $this->_session = \\Phalcon\\DI::getDefault()->getShared('session');\n $this->_security = \\Phalcon\\DI::getDefault()->getShared('security');\n }", "public function __construct ()\n {\n // check if a locale is present in the session\n // otherwise use default\n /*\n if(Config::get('gettext::config.gettext_type') === 'gettext'):\n $session_locale = Session::get('gettext_locale', null);\n $locale = (is_null($session_locale)) ? Config::get(\"gettext::config.default_locale\") : $session_locale;\n Session::forget('gettext_locale');\n\n // check if an encoding is present in the session\n $session_encoding = Session::get('gettext_encoding', null);\n $encoding = (is_null($session_encoding)) ? Config::get(\"gettext::config.default_encoding\") : $session_encoding;\n Session::forget('gettext_encoding');\n\n // set the encoding and locale\n $this->setEncoding($encoding)->setLocale($locale);\n\n // determine and set textdomain\n $textdomain = Config::get(\"gettext::config.textdomain\");\n $path = Config::get(\"gettext::config.path_to_mo\");\n $this->setTextDomain($textdomain, $path);\n endif;\n */\n $session_locale = Session::get('user.lang', null);\n $locale = (is_null($session_locale)) ? Config::get(\"gettext::config.default_locale\") : $session_locale;\n Session::put('user.lang', $locale);\n DEFINE('LOCALE',$locale);\n\n $this->loadGettextLib($locale);\n\n }", "public function init()\r\n {\r\n\t\t//$this -> _helper -> layout -> disableLayout();\r\n\t\t\r\n\t\t$auth = Zend_Auth::getInstance();\r\n\t\tif (!$auth->hasIdentity()) {\r\n\t\t\t$this->_redirect('/admin/login/auth');\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\t$this->translate = Zend_Registry::get('Zend_Translate');\r\n\t\t$this->flashMessenger = $this->_helper->getHelper('FlashMessenger');\r\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "public static function init() {\n\t\t\t\n\t\t\t/* Run session */\n\t\t\tsession_start();\n\t\t\t\n\t\t}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "public function init()\r\n {\r\n $this->admin = Shopware()->Modules()->Admin();\r\n $this->basket = Shopware()->Modules()->Basket();\r\n $this->session = Shopware()->Session();\r\n $this->db = Shopware()->Db();\r\n $this->moduleManager = Shopware()->Modules();\r\n $this->eventManager = Shopware()->Events();\r\n }", "function _initialize()\n {\n\n //initalize Loader\n $auto_load=array(\"io\",\"segment\",\"router\");\n \n foreach($auto_load as $library)\n {\n $this->$library=& load_class($library);\n }\n //load loader class\n $this->load =& load_class('Loader');\n \n //call auto load from config file\n $this->load->_auto_load();\n }", "public function init()\n {\n \t$authSession = new Zend_Session_Namespace('auth');\n\t\tif (isset($authSession->user)) {\n\t\t\t/**\n\t\t\t * @todo write this into session\n\t\t\t */\n\t\t\t$this->view->auth = $authSession->user;\n\t\t\t$this->view->role = $authSession->role;\n\t\t} else {\n\t\t\t$this->_redirect('login/index');\n\t\t}\n\t\t\n\t\t$aclSession = new Zend_Session_Namespace('acl');\n\t\tif (isset($aclSession->acl)) {\n\t\t\t$this->view->acl = $aclSession->acl;\n\t\t}\n\t\t\n\t\t//initialize models\n\t\t//user\n//\t\tif (!isset($this->userModel)) {\n//\t\t\t$this->_userModel = new Application_Model_User();\n//\t\t}\n\t\t\n\t\t//publication\n\t\tif(!isset($this->publicationModel)) {\n\t\t\t$this->_publicationModel = new Application_Model_Publication();\n\t\t}\n\t\t\n\t\t//publisher\n \tif(!isset($this->_publisherModel)) {\n\t\t\t$this->_publisherModel = new Application_Model_Publisher();\n\t\t}\n\t\t\n\t\t//@author micha\n\t\tif(!isset($this->_authorModel)) {\n\t\t\t$this->_authorModel = new Application_Model_Author();\n\t\t}\n }", "public static function _init() {\n // this is called upon loading the class\n }", "public function _init() {}", "protected function init()\n {\n $this->urlParams = array();\n $this->methodArguments = array();\n $this->lang = self::LANG_POLISH;\n $this->basePath = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.self::BASE_FOLDER.DIRECTORY_SEPARATOR;\n $this->loadConfig();\n }", "public static function initRequest() {\n spl_autoload_register(function ($class) {\n require_once '/Users/Anders/Sites/tasty/classes/App/' . \\str_replace('\\\\', '/', $class) . '.php';\n });\n\n session_start();\n }", "protected function _init() {\n\t\t$this->user = SessionUser::user();\n\n\t\t// Might come in handy sometimes: direct access to the DBAL:\n\t\t$this->db = $GLOBALS['db'];\n\n\t\t// Initialize Output/Views (used in 90% of controller actions):\n\t\t$this->tpl = new Output($this);\n\t\t$this->tpl->viewLayout = '_layout';\n\t\t$this->tpl->assign('app', $this);\n\t}", "public function __construct()\n {\n // validate compatibiliry with the system\n $this->_validate_compatibility();\n\n // load config file\n $this->config->load('auth');\n\n // load language file for messages\n $this->lang->load('auth', 'english');\n\n // load authentication model\n $this->load->model('auth_model');\n\n // load required libraries\n $this->load->library(['session', 'user_agent', 'encryption']);\n\n // load required helpers\n $this->load->helper(['cookie', 'string', 'auth']);\n\n // log message to debugger\n log_message('debug', 'Authentication library initialized.');\n }", "public function init() {\n\t //UNTUK SETTING GLOBAL BASE PATH\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->auth = Zend_Auth::getInstance();\t \n\t\t$this->view->baseData = $registry->get('baseData');\n\t\t$this->view->basePath = $registry->get('basepath');\n\t\t$this->view->procPath = $registry->get('procpath');\t \n\t\t$this->sso_serv = Sso_User_Service::getInstance();\n\t\t$this->pengguna_serv = Pengguna_Service::getInstance();\n\t\n\t\t$ssousergroup = new Zend_Session_Namespace('ssousergroup');\n\t\t$ssouser_id = new Zend_Session_Namespace('ssouser_id');\n\t\t$ssouser_idpswd = new Zend_Session_Namespace('ssouser_idpswd');\n\t\t\n\t\t$ssogroup = new Zend_Session_Namespace('ssogroup');\n\t\t$this->group_user =$ssogroup->n_level;\n\t\t\n\t\t$this->user_paswd =$ssouser_idpswd->user_paswd;\t\t\t\n\t\t$this->user_id =$ssouser_id->user_id;\n\t\t$this->group_id =$ssousergroup->group_id;\n\n }", "public static function _init()\n\t{\n\t\tLang::load('pagination', true);\n\t\tConfig::load('hybrid', 'hybrid');\n\t}", "public function init()\n {\n\t\tif(!Zend_Auth::getInstance()->hasIdentity())\n {\n $this->_redirect('registration/unregistered');\n }\t\n\t\tZend_Loader::loadClass('Menu',APPLICATION_PATH.'/views/helpers');\n\t\tZend_Loader::loadClass('Users',APPLICATION_PATH.'/models');\n\t\tZend_Loader::loadClass('EditProfile',APPLICATION_PATH.'/forms');\n\t\tZend_Loader::loadClass('Password',APPLICATION_PATH.'/forms');\n\t\tZend_Loader::loadClass('Profile',APPLICATION_PATH.'/models');\n\t\tZend_Loader::loadClass('ThemeForm',APPLICATION_PATH.'/forms');\n\t\tZend_Loader::loadClass('Themes',APPLICATION_PATH.'/models');\n\t\t$this->view->title = \"Universtiyifo\";\n\t\t$this->view->headTitle($this->view->title);\n\t\t$menu = new Menu();\n\t\t$this->view->menu = $menu->menuList('custom');\n }", "public function _init(){}", "private function init()\n\t{\n\t\tif (!$this->CI->session->userdata(AUTH_AFFILIATION_ARRAY))\n\t\t{\n\t\t\t$this->CI->session->set_userdata(AUTH_AFFILIATION_ARRAY, array());\n\t\t}\n\t\t\n\t\tif (!$this->CI->session->userdata(AUTH_FUNCTION_ARRAY))\n\t\t{\n\t\t\t$this->CI->session->set_userdata(AUTH_FUNCTION_ARRAY, array(AUTH_FUNCTION_DEFAULT_ATTRIBUTE));\n\t\t}\n\t\t\n\t\t// Copy to the local variable to avoid repeat access!\n\t\t$this->functions = $this->CI->session->userdata(AUTH_FUNCTION_ARRAY);\n\t\t$this->affiliations = $this->CI->session->userdata(AUTH_AFFILIATION_ARRAY);\n\t}", "public function __construct() {\r\n $this->session = ci('load')->library('session')->session;\r\n $this->authentication = ci('load')->model('social/authentication_m')->authentication_m;\r\n }", "public function init()\n {\n // Control usuario autenticado\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n $this->_redirect('/default/login/login');\n }\n \n // Setear Layout Principal\n $this->_helper->layout->setLayout('layout');\n \n // Definir home de usuario\n $this->setHomePage();\n \n // Inicializacion de Contextos\n $this->getContextSwitch()\n ->setAutoJsonSerialization(false)\n ->initContext();\n }", "private function __construct()\n\t{\n App::session();\n \n App::setting();\n \n\t\t//get and create constant for project db driver\n\t\tLoader::loadClass('Common_DB_Model');\n \n\t\tApp::request();\n \n\t\tApp::user();\n\t}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function __construct() {\n\t\tif (session_status() == PHP_SESSION_NONE) {\n\t\t\tsession_start();\n\t\t}\n\t\t\n\t\tif(!isset($_SESSION['LANGUAGE'])){\n\t\t\t$_SESSION['LANGUAGE'] = self::DEFAULT_LANGUAGE;\n\t\t}\n\t\tob_start();\n\t}", "public function init()\n {\n //$this->_helper->acl->allow(null);\n $this->_application = new Zend_Session_Namespace('PHPReview');\n $usuario = new Application_Model_UsuarioMapper();\n $this->view->totalUsuarios = $usuario->getQuantidade();\n }", "public function init() {\n\n // Set required classes for import.\n $this->setImport(array(\n $this->id . '.components.*',\n $this->id . '.components.behaviors.*',\n $this->id . '.components.dataproviders.*',\n $this->id . '.controllers.*',\n $this->id . '.models.*',\n ));\n\n // Set the required components.\n $this->setComponents(array(\n 'authorizer' => array(\n 'class' => 'RAuthorizer',\n 'superuserName' => $this->superuserName,\n ),\n 'generator' => array(\n 'class' => 'RGenerator',\n ),\n ));\n }", "public static function init() {\n session_start();\n if ( isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true ) {\n self::$loggedin = true;\n }\n \n if ( isset($_GET['action']) && $_GET['action'] == 'guest' ) {\n self::setGuest();\n }\n \n if ( isset($_GET['action']) && $_GET['action'] == 'register' ) {\n self::register();\n }\n if ( isset($_GET['action']) && $_GET['action'] == 'login' ) {\n self::login();\n }\n if ( isset($_GET['action']) && $_GET['action'] == 'password' ) {\n self::password();\n }\n \n }", "protected function initAuth()\n {\n /** @var Auth $auth */\n Auth::getInstance()->setStorage();\n }", "public function initialize()\n {\n $autoloader = $this->registerAutoloader();\n $this->registerPlugins($autoloader);\n }", "public function initialize()\n {\n parent::initialize();\n\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Auth', [\n 'authorize' => 'Controller',\n 'loginAction' => [\n 'controller' => 'Users',\n 'action' => 'login',\n ],\n 'loginRedirect' => [\n 'controller' => 'Users',\n 'action' => 'index/',\n ],\n 'logoutRedirect' => [\n 'controller' => 'Booking',\n 'action' => 'index',\n ],\n 'authError' => 'Enregistrez-vous ou Connectez-vous',\n 'authenticate' => [\n 'Form' => [\n 'fields' => ['username' => 'Email', 'password' => 'Password']\n ]\n ]\n ]\n );\n\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n //$this->loadComponent('Security');\n //$this->loadComponent('Csrf');\n }", "public function init(){}", "public function init(){}", "protected function init() {\n }", "protected function init() {\n }", "public static function init() {\n }", "public static function init() {\n }", "public static function init() {\n }", "public function init()\n {\n // Register the loader method\n spl_autoload_register(array(__CLASS__, '_loadClasses'));\n }", "public function init()\n {\n if (!$_SESSION[$this->cookie_prefix . '_user']) {\n $email = '';\n $password = '';\n \n if ($_COOKIE[$this->cookie_prefix . '_email'] and $_COOKIE[$this->cookie_prefix . '_password']) {\n $email = $_COOKIE[$this->cookie_prefix . '_email'];\n $password = $_COOKIE[$this->cookie_prefix . '_password'];\n } elseif ($_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']) { //check for basic authentication\n $email = $_SERVER['PHP_AUTH_USER'];\n $password = md5($this->secret_phrase . $_SERVER['PHP_AUTH_PW']);\n }/* elseif ($_GET['auth_user'] and $_GET['auth_pw']) {\n $email = $_GET['auth_user'];\n $password = md5($this->secret_phrase . $_GET['auth_pw']);\n }*/\n \n if ($email and $password and table_exists($this->table)) {\n $result = sql_query('SELECT * FROM ' . $this->table . \" WHERE\n \t\t\t\temail='\" . escape($email) . \"'\n \t\t\t\", 1);\n \n if ($result && $password == md5($this->secret_phrase . $result['password'])) {\n $_SESSION[$this->cookie_prefix . '_email'] = $result['email'];\n $_SESSION[$this->cookie_prefix . '_password'] = $result['password'];\n }\n }\n }\n\n //check if logged in\n if ($_SESSION[$this->cookie_prefix . '_user'] and time() < $_SESSION[$this->cookie_prefix . '_expires']) {\n $this->user = $_SESSION[$this->cookie_prefix . '_user'];\n } elseif ($_SESSION[$this->cookie_prefix . '_email'] and $_SESSION[$this->cookie_prefix . '_password'] and table_exists($this->table)) {\n $this->load();\n }\n\n if ($_GET['u']) {\n $_SESSION['request'] = $_GET['u'];\n }\n }", "public function initialize() {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Auth');\n $userdata = $this->Auth->user();\n $this->set('loggeduser', $userdata);\n \n }", "public function __construct()\n {\n $this->_makeSureThereIsALanguageID();\n if (intval(Session::get('languageID')) === self::DUTCH_LANGUAGE_ID) {\n Config::set('languageID', 1);\n Config::set('languageCode', 'nl');\n Config::set('languageName', 'Dutch');\n setlocale(LC_ALL, 'nl_NL');\n setlocale(LC_MONETARY, 'de_DE');\n loadFile(RESOURCES_PATH . '/language/dutch/dutch_translations.php');\n } elseif (intval(Session::get('languageID')) === self::ENGLISH_LANGUAGE_ID) {\n Config::set('languageID', 2);\n Config::set('languageCode', 'en');\n Config::set('languageName', 'English');\n setlocale(LC_ALL, 'en_US.UTF-8');\n setlocale(LC_MONETARY, 'en_US');\n loadFile(RESOURCES_PATH . '/language/english/english_translations.php');\n }\n }", "protected function init() {\n\t}", "protected function init() {\n\t}", "public function __construct()\n {\t\n @include(SHIN_Core::isConfigExists('auth.php'));\n\t\t\n $this->_config_mapper($auth);\n\t\t\n\t\tif($auth['keeping_logic'] == 'db')\n\t\t{\n\t\t\t// db style\n\t\t\tSHIN_Core::loadModel(array('sys_session_model', 'session_model'));\n\t\t\t$this->sessionModel = SHIN_Core::$_models['session_model']->get_instance();\n\t\t\t$this->sessionModel->init($this->sh_Options['sess_expiration']/60, $this->sh_Options['sess_time_to_update']/60);\n\t\t}\n\t\t\n\t\tConsole::logSpeed('SHIN_Auth begin work, Time taken to get to line: '.__FILE__.'::'.__LINE__);\n\t\tConsole::logMemory($this, 'SHIN_Auth. Size of class: ');\t\t \n }", "protected function initializeSession() {}", "protected function Init()\n\t{\n\t\t// TODO: add app-wide bootsrap code\n\t\t\n\t\t// EXAMPLE: require authentication to access the app\n\t\t/*\n\t\tif ( !in_array($this->GetRouter()->GetUri(),array('login','loginform','logout')) )\n\t\t{\n\t\t\trequire_once(\"App/ExampleUser.php\");\n\t\t\t$this->RequirePermission(ExampleUser::$PERMISSION_ADMIN,'SecureExample.LoginForm');\n\t\t}\n\t\t//*/\n\t\t\n\t\t//Dados da configuracao do sistema\t\t\n\t\ttry {\n\t\t\t$configuracao = $this->Phreezer->Get('Configuracao',1);\n\t\t\t$this->Assign('Configuracao',$configuracao);\n\t\t\t$this->Configuracao = $configuracao;\n\t\t\t\n\t\t} catch(Exception $ex){\n\t\t\t$c = new Configuracao($this->Phreezer);\n\t\t\t$this->Assign('Configuracao',$c);\n\t\t\tthrow new Exception(\"O banco de dados do sistema ainda não foi configurado, ou foi configurado incorretamente. Entre em contato com o administrador do servidor ou o desenvolvedor do sistema. Código de erro #0x42CFG\");\n\t\t}\n\t}", "public static function init(){\n \n }" ]
[ "0.76214373", "0.7471684", "0.7435028", "0.7388418", "0.73335475", "0.73180526", "0.7315239", "0.7273038", "0.72028035", "0.7171584", "0.71348524", "0.71252626", "0.71223485", "0.71142596", "0.71142596", "0.7109477", "0.7108074", "0.7102531", "0.70797855", "0.70636505", "0.70528877", "0.70403814", "0.7038482", "0.7032526", "0.70295835", "0.7026039", "0.7007931", "0.7007931", "0.7007931", "0.7007931", "0.70075554", "0.70071465", "0.70071465", "0.70071465", "0.70071465", "0.70071465", "0.70071465", "0.7006927", "0.7006927", "0.700437", "0.6992586", "0.69892883", "0.6971428", "0.6923614", "0.69114923", "0.69060695", "0.6901021", "0.6883539", "0.6880742", "0.68799734", "0.6868335", "0.6868234", "0.6866076", "0.68641645", "0.6857124", "0.6851326", "0.6839829", "0.6839829", "0.6839829", "0.6839829", "0.6839829", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.6839406", "0.68270004", "0.68268573", "0.6814581", "0.68066776", "0.67996895", "0.6796482", "0.67792344", "0.677762", "0.677762", "0.6774404", "0.6774404", "0.67725176", "0.67725176", "0.67725176", "0.67709255", "0.6769954", "0.67674845", "0.67650515", "0.676062", "0.676062", "0.67558235", "0.6748643", "0.6745162", "0.67355907" ]
0.690544
46
Initialization Log, Search, KCFinder
protected function _initLog() { $params = array(); //------------------ $_startTime = microtime(1); //Получим конфигурацию $config = $this->_options; //----- Create Zend_Log object ----- $columnMapping = array( 'ts' => 'timestamp', 'msg' => 'message', 'pr' => 'priority', 'pr_name' => 'priorityName'); $countMsg = $config['logging']['log']['max_rows']; $countEx = $config['logging']['exeption']['max_rows']; $countStat = $config['logging']['statistics']['max_rows']; // Get DB $db = Zend_Registry::get('db'); // Set params $params['db'] = $db; $params['columnMap'] = $columnMapping; // Create writer for DB $params['table'] = 'log_msg'; $params['max_rows'] = $countMsg; $writerMsg = new Default_Model_Log($params); $params['table'] = 'log_error'; $params['max_rows'] = $countEx; $writerEx = new Default_Model_Log($params); $params['table'] = 'log_stat'; $params['max_rows'] = $countStat; $writerStat = new Default_Model_Log($params); // Create logers $logMsg = new Zend_Log($writerMsg); $logEx = new Zend_Log($writerEx); $logStat = new Zend_Log($writerStat); // Adding new priorities for the $logMsg $logMsg->addPriority('LOGIN_OK', 8); $logMsg->addPriority('LOGIN_ERR', 9); $logMsg->addPriority('LOGOUT', 10); $logMsg->addPriority('REG_OK', 11); $logMsg->addPriority('REG_ERR', 12); $logMsg->addPriority('DETAILS_OK', 13); $logMsg->addPriority('FETCHPASS_COMPLETE_OK', 14); $logMsg->addPriority('FETCHPASS_COMPLETE_ERR', 15); $logMsg->addPriority('FETCHPASS_CONFIRM_OK', 16); $logMsg->addPriority('FETCHPASS_CONFIRM_ERR', 17); $logMsg->addPriority('MAIL_OK', 18); $logMsg->addPriority('MAIL_ERR', 19); $logMsg->addPriority('DB_SAVE_ERR', 20); $logMsg->addPriority('DB_DELETE_ERR', 21); $logMsg->addPriority('POST_EDIT', 22); $logMsg->addPriority('POST_SET_STATUS', 23); $logMsg->addPriority('ADMIN_POST_EDIT', 24); $logMsg->addPriority('ADMIN_ROW_UPDATE', 25); $logMsg->addPriority('ADMIN_ROW_INSERT', 26); $logMsg->addPriority('ADMIN_ROW_DELETE', 27); $logMsg->addPriority('MY_MSG', 28); // Adding new priorities for the $logStat $logStat->addPriority('LOGIN_OK', 8); $logStat->addPriority('LOGIN_ERR', 9); $logStat->addPriority('MAIL_OK', 10); $logStat->addPriority('FETCHPASS_COMPLETE_OK', 11); $logStat->addPriority('FETCHPASS_COMPLETE_ERR', 12); $logStat->addPriority('FETCHPASS_CONFIRM_OK', 13); $logStat->addPriority('FETCHPASS_CONFIRM_ERR', 14); $logStat->addPriority('POST_OPEN', 15); $logStat->addPriority('VIDEO_PLAY', 16); $logStat->addPriority('AUDIO_PLAY', 17); $emailParams = $config['logging']['email']; if ($emailParams['send']) { $mail = Default_Plugin_SysBox::createMail($emailParams); $writer = new Zend_Log_Writer_Mail($mail); $my_request = Default_Plugin_SysBox::getUrlRequest(); if (!$emailParams['subject']) $writer->setSubjectPrependText('Errors request - ' . $my_request); $writer->addFilter(Zend_Log::EMERG); $writer->addFilter(Zend_Log::ALERT); $writer->addFilter(Zend_Log::CRIT); $writer->addFilter(Zend_Log::ERR); $logger->addWriter($writer); } // Save to Registry Zend_Registry::set("Zend_Log", $logMsg); Zend_Registry::set("Zend_LogEx", $logEx); Zend_Registry::set("Zend_LogStat", $logStat); // Remember in the session array of search results $Zend_Auth = Zend_Registry::get("Zend_Auth"); if (!$Zend_Auth->search) { $Zend_Auth->search = array(); } //------------ Configure default search ------------- // Establish a query analyzer in the coding Utf8 Zend_Search_Lucene_Analysis_Analyzer::setDefault( new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive()); //------ Initialization file manager ------------- Default_Plugin_SysBox::iniKCFinder(); //---- Defining script execution time ---- $infoProfiler = Default_Plugin_SysBox::Translate("Время выполнения") . " Bootstrap_initLog(): "; Default_Plugin_SysBox::profilerTime2Registry($_startTime, $infoProfiler); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function callInitializeSearchWordDataInTsfe() {}", "public function init()\n {\n $this->config = Yii::app()->params['CaseSearch'];\n $dependencies = array(\n 'OECaseSearch.models.*',\n 'OECaseSearch.components.*',\n );\n foreach ($this->config['parameters'] as $module => $paramList)\n {\n if ($module !== 'core')\n {\n $dependencies = array_merge($dependencies, array(\n \"$module.models.*\",\n ));\n }\n }\n $this->setImport($dependencies);\n\n // Initialise the search provider/s.\n foreach ($this->config['providers'] as $providerID => $searchProvider)\n {\n $this->searchProviders[$providerID] = new $searchProvider($providerID);\n }\n }", "protected function _construct()\n {\n $this->_init('magebees_finder', 'finder_id');\n }", "public function __Construct() {\r\n\t\tprint(\"Searching in \" . self::FULL_URL . \"<br/>\");\r\n\t\t$this->tree = file_get_contents(self::FULL_URL);\r\n\t}", "public function init()\n {\n $searchables = ShopSearch::get_searchable_classes();\n\n // Add each class to the index\n foreach ($searchables as $class) {\n $this->addClass($class);\n }\n\n // add the fields they've specifically asked for\n $fields = $this->getFulltextSpec();\n foreach ($fields as $def) {\n $this->addFulltextField($def['field'], $def['type'], $def['params']);\n }\n\n // add the filters they've asked for\n $filters = $this->getFilterSpec();\n foreach ($filters as $filterName => $def) {\n // NOTE: I'm pulling the guts out of this function so we can access Solr's full name\n // for the field (SiteTree_Title for Title) and build the fieldMap in one step instead\n // of two.\n //$this->addFilterField($def['field'], $def['type'], $def['params']);\n $singleFilter = $this->fieldData($def['field'], $def['type'], $def['params']);\n $this->filterFields = array_merge($this->filterFields, $singleFilter);\n foreach ($singleFilter as $solrName => $solrDef) {\n if ($def['field'] == $solrDef['field']) {\n $this->fieldMap[$filterName] = $solrName;\n }\n }\n }\n\n//\t\tDebug::dump($this->filterFields);\n\n // Add spellcheck fields\n//\t\t$spellFields = $cfg->get('ShopSearch', 'spellcheck_dictionary_source');\n//\t\tif (empty($spellFields) || !is_array($spellFields)) {\n//\t\t\t$spellFields = array();\n//\t\t\t$ftFields = $this->getFulltextFields();\n//\t\t\tforeach\t($ftFields as $name => $fieldDef) {\n//\t\t\t\t$spellFields[] = $name;\n//\t\t\t}\n//\t\t}\n//\n//\t\tforeach ($spellFields as $f) {\n//\t\t\t$this->addCopyField($f, '_spellcheckContent');\n//\t\t}\n\n // Technically, filter and sort fields are the same in Solr/Lucene\n//\t\t$this->addSortField('ViewCount');\n//\t\t$this->addSortField('LastEdited', 'SSDatetime');\n\n // Aggregate fields for spelling checks\n//\t\t$this->addCopyField('Title', 'spellcheckData');\n//\t\t$this->addCopyField('Content', 'spellcheckData');\n\n//\t\t$this->addFullTextField('Category', 'Int', array(\n//\t\t\t'multi_valued' => true,\n//\t\t\t'stored' => true,\n//\t\t\t'lookup_chain' => array(\n//\t\t\t\t'call' => 'method',\n//\t\t\t\t'method' => 'getAllProductCategoryIDs',\n//\t\t\t)\n//\t\t));\n\n // I can't get this to work. Need a way to create the Category field that get used\n//\t\t$this->addFilterField('Category', 'Int');\n//\t\t$this->addFilterField('Parent.ID');\n//\t\t$this->addFilterField('ProductCategories.ID');\n//\t\t$this->addCopyField('SiteTree_Parent_ID', 'Category');\n//\t\t$this->addCopyField('Product_ProductCategories_ID', 'Category');\n\n // These will be added in a pull request to shop module. If they're not present they'll be ignored\n//\t\t$this->addFilterField('AllCategoryIDs', 'Int', array('multiValued' => 'true'));\n//\t\t$this->addFilterField('AllRecursiveCategoryIDs', 'Int', array('multiValued' => 'true'));\n\n // This will cause only live pages to be indexed. There are two ways to do\n // this. See fulltextsearch/docs/en/index.md for more information.\n // Not sure if this is really the way to go or not, but for now this is it.\n $this->excludeVariantState(array('SearchVariantVersioned' => 'Stage'));\n }", "private function init()\n {\n // #41776, dwildt, 1-\n// $this->pObj->objFltr3x->get_tableFields( );\n // #52486, 131005, dwildt, 2+\n // Init radialsearch filter and object\n $this->init_radialsearch();\n\n // RETURN: if there isn't any filter array\n if ( !$this->init_boolIsFilter() )\n {\n return;\n }\n // RETURN: if there isn't any filter array\n // Evaluate TREEVIEW filter\n // #41753, 121012, dwildt, 1+\n $this->eval_treeview();\n\n // #41776, dwildt, 2+\n // Set the array consolidation and the ts property SELECT\n $this->init_consolidationAndSelect();\n\n // Init localisation\n $this->init_localisation();\n\n // Init calendar area\n $this->init_calendarArea();\n\n // Init class var $andWhereFilter\n $this->init_andWhereFilter();\n\n // Set class var markerArray\n $this->set_markerArray();\n\n // Init the data of the cObj\n $this->cObjData_init();\n\n return;\n }", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 1);\n $this->order = 'create_time desc';\n }", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 0);\n $this->order = 'create_time desc';\n }", "public function __construct()\n {\n $this->config = config('fullsearch');\n\n $this->results = collect([]);\n\n $this->models = collect($this->config['models']);\n }", "protected function _initLog()\n {\n }", "public function __construct() {\n Log::useFiles(storage_path().'/logs/search.log');\n }", "private function initialize() {\n // Lecture de la config du batch\n $this->load_config();\n $GLOBALS['config'] = $this->config;\n // Initialisation du logger\n if (strcasecmp(\"DEBUG\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::DEBUG;\n }\n else if(strcasecmp(\"INFO\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::INFO;\n }\n else if(strcasecmp(\"WARN\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::WARN;\n }\n else if(strcasecmp(\"ERROR\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::ERROR;\n }\n else if(strcasecmp(\"FATAL\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::FATAL;\n }\n else if(strcasecmp(\"OFF\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::OFF;\n }\n $this->log = new KLogger ( $this->config->log_file , $debug_const );\n $GLOBALS['logger'] = $this->log;\n $this->check_conf();\n $this->log->LogDebug(\"Init...OK\");\n\n }", "public function init() {\n\n $this->jobs = new Hb_Jobs();\n if ($this->_request->getActionName() == 'view') {\n\n $this->_request->setActionName('index');\n }\n\n $this->searchParams = $this->_request->getParams();\n $this->view->searchParams = $this->searchParams;\n\n $this->view->actionName = $this->_request->getActionName();\n }", "public function init()\n {\n $this->rootPageUid = $this->filterConfig->getSettings('rootPageUid');\n $this->respectEnableFields = $this->filterConfig->getSettings('respectEnableFields');\n $this->respectDeletedField = $this->filterConfig->getSettings('respectDeletedField');\n }", "public function __construct() {\n $this->setAdvSearch(true);\n }", "public function lookups()\n {\n }", "public function init()\n {\n $this->loadDefaultWhere();\n }", "public function init()\n\t\t{\n\t\n\t\t}", "protected function _init(){\n\t\t//Hook called at the beginning of self::run();\n\t}", "public function _init() {\r\n\r\n }", "public function init() {\n\t\tparent::init();\n\n\t\t// use the search layout\n\t\t$this->setLayout('search');\n\n\t\t// load models\n\t\t$this->Search = new Search();\n\t\t$this->Location = new Location();\n\t\t$this->Category = new Category();\n\t\t$this->Ats_Job = new Ats_Job();\n\n // ajax context switching\n $this->_helper->ajaxContext()\n ->addActionContext('job', 'json')\n ->addActionContext('category', 'json')\n ->addActionContext('location', 'json')\n ->initContext();\n\t}", "public function init() {\r\n\r\n\t\t}", "public function __construct() {\n $this->init(); \n $this->log = new FunnelLog('konnektive');\n }", "public function init() {\r\n }", "public function init()\n {\n \t\n }", "public function init()\n {\n \t\n }", "protected function _init()\r\n\t{\r\n\t}", "public function initialize() : void\n {\n // Use to initialise member variables.\n $this->filter = new MyTextFilter();\n $this->app->page->add(\"textfilter/navbar\", [], \"main\");\n }", "public static function run(){\n // Loads from an Alert\n \n $alert = AlertManager::load(67);\n $test = new Search();\n \n // the actual Query\n $query = $alert ->getQuery();\n \n dpm(SearchLabel::toLabel($query));\n $test -> addFromQuery($query);\n $num = $test ->getCount();\n \n dpm($num);\n $nodes = $test ->getNodes();\n dpm($nodes);\n }", "public function init() {\r\n\t}", "public function _init() {}", "public function init() {\n\t\tglobal $wpdb;\n\n\t\t$this->incrementor = new Incrementor();\n\n\t\t$this->file_locator = new File_Locator();\n\n\t\t$this->block_recognizer = new Block_Recognizer();\n\n\t\t$this->dependencies = new Dependencies();\n\n\t\t// @todo Pass options for verbosity, which filters to wrap, whether to output annotations that have no output, etc.\n\t\t$this->output_annotator = new Output_Annotator(\n\t\t\t$this->dependencies,\n\t\t\t$this->incrementor,\n\t\t\t$this->block_recognizer,\n\t\t\t[\n\t\t\t\t'can_show_queries_callback' => function() {\n\t\t\t\t\treturn current_user_can( $this->show_queries_cap );\n\t\t\t\t},\n\t\t\t]\n\t\t);\n\n\t\t$this->database = new Database( $wpdb );\n\n\t\t$this->hook_wrapper = new Hook_Wrapper();\n\n\t\t$this->invocation_watcher = new Invocation_Watcher(\n\t\t\t$this->file_locator,\n\t\t\t$this->output_annotator,\n\t\t\t$this->dependencies,\n\t\t\t$this->database,\n\t\t\t$this->incrementor,\n\t\t\t$this->hook_wrapper\n\t\t);\n\n\t\t$this->output_annotator->set_invocation_watcher( $this->invocation_watcher );\n\n\t\t$this->server_timing_headers = new Server_Timing_Headers( $this->invocation_watcher );\n\t}", "public function __construct() {\n $this->content = new Search();\n $this->contentdb = new Content();\n $this->managerStat = new ManagerStat('dsn_stat');\n $this->redisClient = new RedisClient(Configuration::get('redis_db_search'));\n $this->redisClientF = new RedisClient(Configuration::get('redis_db_user'));\n $this->filter = new Filter();\n $this->analyser = new AnalyseRequest();\n $this->urlService = Configuration::get('middleware_json_rpc', null);\n }", "public function run()\r\r\n\t{\r\r\n\t\t$arrPages = array();\r\r\n\t\t$strCache = md5('search_index' . session_id());\r\r\n\r\r\n\t\t// Get cache file\r\r\n\t\tif (file_exists(TL_ROOT . '/system/tmp/' . $strCache))\r\r\n\t\t{\r\r\n\t\t\t$objFile = new File('system/tmp/' . $strCache);\r\r\n\r\r\n\t\t\tif ($objFile->mtime < time() + 3600)\r\r\n\t\t\t{\r\r\n\t\t\t\t$arrPages = deserialize($objFile->getContent());\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\r\r\n\t\t// Get all searchable pages\r\r\n\t\tif (count($arrPages) < 1)\r\r\n\t\t{\r\r\n\t\t\t$arrPages = $this->getSearchablePages();\r\r\n\r\r\n\t\t\t// HOOK: take additional pages\r\r\n\t\t\tif (array_key_exists('getSearchablePages', $GLOBALS['TL_HOOKS']) && is_array($GLOBALS['TL_HOOKS']['getSearchablePages']))\r\r\n\t\t\t{\r\r\n\t\t\t\tforeach ($GLOBALS['TL_HOOKS']['getSearchablePages'] as $callback)\r\r\n\t\t\t\t{\r\r\n\t\t\t\t\t$this->import($callback[0]);\r\r\n\t\t\t\t\t$arrPages = $this->$callback[0]->$callback[1]($arrPages);\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\t$objFile = new File('system/tmp/' . $strCache);\r\r\n\t\t\t$objFile->write(serialize($arrPages));\r\r\n\t\t\t$objFile->close();\r\r\n\t\t}\r\r\n\r\r\n\t\t$intStart = $this->Input->get('start') ? $this->Input->get('start') : 0;\r\r\n\t\t$intPages = $this->Input->get('ppc') ? $this->Input->get('ppc') : 10;\r\r\n\r\r\n\t\t// Rebuild search index\r\r\n\t\tif ($intPages && count($arrPages))\r\r\n\t\t{\r\r\n\t\t\t$this->import('Search');\r\r\n\r\r\n\t\t\tif ($intStart < 1)\r\r\n\t\t\t{\r\r\n\t\t\t\t$this->Database->execute(\"TRUNCATE TABLE tl_search\");\r\r\n\t\t\t\t$this->Database->execute(\"TRUNCATE TABLE tl_search_index\");\r\r\n\t\t\t\t$this->Database->execute(\"TRUNCATE TABLE tl_cache\");\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\techo '<div style=\"font-family:Verdana, sans-serif; font-size:11px; line-height:16px; margin-bottom:12px;\">';\r\r\n\r\r\n\t\t\tfor ($i=$intStart; $i<$intStart+$intPages && $i<count($arrPages); $i++)\r\r\n\t\t\t{\r\r\n\t\t\t\techo 'File <strong>' . $arrPages[$i] . '</strong> has been indexed<br />';\r\r\n\r\r\n\t\t\t\t$objRequest = new Request();\r\r\n\t\t\t\t$objRequest->send($this->Environment->base . $arrPages[$i]);\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\techo '<div style=\"margin-top:12px;\">';\r\r\n\r\r\n\t\t\t// Redirect to the next cycle\r\r\n\t\t\tif ($i < (count($arrPages) - 1))\r\r\n\t\t\t{\r\r\n\t\t\t\t$url = $this->Environment->base . 'typolight/indexer.php?start=' . ($intStart + $intPages) . '&ppc=' . $intPages;\r\r\n\r\r\n\t\t\t\techo '<script type=\"text/javascript\">setTimeout(\\'window.location=\"' . $url . '\"\\', 1000);</script>';\r\r\n\t\t\t\techo '<a href=\"' . $url . '\">Please click here to proceed if you are not using JavaScript</a>';\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\t// Redirect back home\r\r\n\t\t\telse\r\r\n\t\t\t{\r\r\n\t\t\t\t$url = $this->Environment->base . 'typolight/main.php?do=maintenance';\r\r\n\r\r\n\t\t\t\t// Delete temporary file\r\r\n\t\t\t\t$objFile = new File('system/tmp/' . $strCache);\r\r\n\t\t\t\t$objFile->delete();\r\r\n\t\t\t\t$objFile->close();\r\r\n\r\r\n\t\t\t\techo '<script type=\"text/javascript\">setTimeout(\\'window.location=\"' . $url . '\"\\', 1000);</script>';\r\r\n\t\t\t\techo '<a href=\"' . $url . '\">Please click here to proceed if you are not using JavaScript</a>';\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\techo '</div></div>';\r\r\n\t\t}\r\r\n\t}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\n\t}", "function get_initial_results()\n{\n\tinclude('global_vars_insert.php');\n\n\t////////////////////////////////////////////\n\t/////\tBING INITIAL SEARCH DATA \n\t////////////////////////////////////////////\n\t\n\tinclude('bing_search_initial.php');\n\n ////////////////////////////////////////////\n\t/////\tENTIREWEB INITIAL SEARCH DATA \n\t////////////////////////////////////////////\n \n\tinclude('entireweb_search_initial.php');\n\n\t////////////////////////////////////////////\n\t/////\tBLEKKO INITIAL SEARCH REQUEST \n\t//////////////////////////////////////////// \n\t\n\tinclude('blekko_search_initial.php');\n\t\n\t////////////////////////////////////////////\n\t/////\tCURL MULTI-SESSION DATA \n\t////////////////////////////////////////////\n\n\tinclude('curl.php');\n}", "private function init()\n\t{\n\t\treturn;\n\t}", "public function init() {\n\t\t\n\t}", "public function init ()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public function init()\r\n {\r\n }", "public static function init(){\n \n }", "public static function initialize()\n\t{\n\t}", "public static function init ()\n {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}" ]
[ "0.65426546", "0.6306111", "0.62781453", "0.6263513", "0.62610847", "0.6255045", "0.6186079", "0.6176711", "0.6172693", "0.6154681", "0.6095916", "0.6017251", "0.60157186", "0.5964769", "0.59422773", "0.5882697", "0.58608097", "0.58091754", "0.57889235", "0.57745826", "0.57631415", "0.5756366", "0.57445884", "0.57384497", "0.5728697", "0.5728697", "0.57198286", "0.5718457", "0.57148653", "0.5711873", "0.57104266", "0.5708163", "0.57046664", "0.5704531", "0.5697461", "0.5697461", "0.5697461", "0.5697461", "0.5697461", "0.5697174", "0.5696396", "0.5696396", "0.5696298", "0.5696298", "0.5696298", "0.56961006", "0.56961006", "0.56961006", "0.56961006", "0.56961006", "0.56961006", "0.56961006", "0.56961006", "0.56961006", "0.5683319", "0.5680991", "0.56770897", "0.56748813", "0.5674676", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5673156", "0.5671541", "0.5671025", "0.5670593", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.56689394", "0.5668887", "0.5668887", "0.5668887", "0.5668887" ]
0.0
-1
Writes a given $tree to a new spreadsheet
public static function writeTree(array $tree, string $heading = null, float $prefightOffset = null, bool $isConsolation = false, bool $hasPreFights = false): Spreadsheet { $spreadsheet = new Spreadsheet(); self::setHeading($spreadsheet, $heading); if ($prefightOffset === null) { $prefightOffset = self::calculateOffsetOfPrefights($tree, $isConsolation, $hasPreFights); } $fightHeightExponent = 0; // leave some margin for the heading $topMargin = 3; $lastFightHeightInCells = 2; // iterate over columns of (fighting) tree for ($c = 0; $c < count($tree); $c++) { // calculate fight height $fightHeightExponent += 1; if ($isConsolation) { if ($c === 0) { $fightHeightExponent += 1; } if ($c > 1) { if (count($tree[$c - 1]) === count($tree[$c])) { $fightHeightExponent -= 1; } } } $fightHeightInCells = pow(2, $fightHeightExponent) + 1; $spreadsheet->getActiveSheet()->getColumnDimensionByColumn($c + 1)->setWidth(20); // add top margin to align tree if (!$isConsolation) { $add = pow(2, $c + 1) - pow(2, $c); } else { $add = $lastFightHeightInCells; } $topMargin += floor($add / 2); $row = $topMargin; if ($c === 0) { $row += $prefightOffset; } // iterate over fights of this particular column (with index) $c foreach ($tree[$c] as $fight) { self::writeFightOfTree($spreadsheet, $c + 1, $row, $fight, $fightHeightInCells); // increase $row by height of fight $row += $fightHeightInCells; // increase $row by space between fights $row += $fightHeightInCells - 2; if ($c === 0 && $isConsolation && isset($tree[$c + 1]) && count($tree[$c]) === count($tree[$c + 1]) && !$hasPreFights) { $row += $fightHeightInCells * 2 - 2; } } $lastFightHeightInCells = $fightHeightInCells; } return $spreadsheet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_tree()\n\t{\n\t\tforeach ($this->class_tree as $tree)\n\t\t{\n\t\t\tif (isset($tree['change_flag']))\n\t\t\t{\n\t\t\t\tswitch ($tree['change_flag'])\n\t\t\t\t{\n\t\t\t\t case 'INSERT' :\n\t\t\t\t\t$this->add_new_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t case 'UPDATE' :\n\t\t\t\t\t$this->save_edited_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t default :\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function createTourLogSheet($name, $data, &$workBook, $writeStats){\n\t$file = 0;\n\t$excel = 1;\n\t$cols = array('Tour ID', 'Date/Time', 'Majors', 'Student', 'Parent', 'People', 'School', 'Year', 'City', 'State', 'Email', 'Phone', 'Tour Status', 'Comments from Family', 'Comments from Ambassadors');\n\t$entries = array('id', 'tourTime', 'majorsOfInterest', 'studentName', 'parentName', 'numPeople', 'school', 'yearInSchool', 'city', 'state', 'email', 'phone', 'status', 'tourComments', 'ambComments');\n\n\t$tourDayCounts = array_fill(0, 7, 0);\n\t$tourWeekCounts = array_fill(0, 53, 0);\n\t$tourDateCounts = array_fill(0, 53, null);\n\t$weekStrings = array();\n\t$numSemesterTours = count($data);\n\t$timeStringLength = 0;\n\tif($excel)\n\t\t$tourSheet = & $workBook->add_worksheet($name. ' Tours');\n\tif($file)\n\t\tfwrite($f, \"\\nWorksheet: $name Tours\\n\");\n\t$numCols = count($cols);\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colName = $cols[$col];\n\t\t$colRef = $entries[$col];\n\t\t$maxWidth = getTextWidth($colName);\n\t\tif($excel)\n\t\t\t$tourSheet->write_string(0, $col, $colName);\n\t\tif($file)\n\t\t\tfwrite($f, \"Row: 0, Col: $col, $colRef: $colName, width:$maxWidth\\t\");\n\n\t\tfor($tour = 0; $tour < $numSemesterTours; $tour++){\n\t\t\t$text = $data[$tour][$colRef];\n\t\t\t$width = getTextWidth($text);\n\t\t\tif($width > $maxWidth){\n\t\t\t\t$maxWidth = $width;\n\t\t\t}\n\n\t\t\tif($excel){\n\t\t\t\tif(is_numeric($text)){\n\t\t\t\t\t$tourSheet->write_number($tour + 1, $col, intval($text));\n\t\t\t\t} else {\n\t\t\t\t\t$tourSheet->write_string($tour + 1, $col, $text);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($file)\n\t\t\t\tfwrite($f, \"Row: $tour, Col: $col, val: $text, width: $width\\t\");\n\n\t\t\t/*\n\t\t\t //formats do not work at the moment\n\t\t\t if($col == 0){\n\t\t\t\t$tourSheet->set_row($tour + 1, NULL, $formatOffset + ($tour % 2));\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t\tif($file)\n\t\t\tfwrite($f, \"\\n\");\n\t\tif($excel)\n\t\t\t$tourSheet->set_column($col, $col, $maxWidth * (2.0/3.0));\n\t}\n\n\tfor($tour = 0; $tour < $numSemesterTours; $tour++){\n\t\tif($file)\n\t\t\tfwrite($f, \"Week 03: \".$tourWeekCounts[\"03\"].\"\\n\");\n\t\t//and now we add each tour to the stats\n\t\t$timestamp = strtotime($data[$tour]['tourTime']);\n\t\tif($file)\n\t\t\tfwrite($f, \"timestamp: $timestamp Time:\".$tour['tourTime'].\" Week: \".date('W', $timestamp).\"\\n\");\n\t\tif(($timestamp == false) || ($timestamp == -1)) continue;\n\t\t$tourDOW = intval(date('w', $timestamp));\n\t\t$tourDayCounts[\"$tourDOW\"] += 1;\n\t\t$tourWeek = intval(date('W', $timestamp));\n\t\t$tourWeekCounts[\"$tourWeek\"] += 1;\n\t\tif($tourDateCounts[\"$tourWeek\"] == null){\n\t\t\t$tourDateCounts[\"$tourWeek\"] = array_fill(0,7,0);\n\t\t}\n\t\t$tourDateCounts[\"$tourWeek\"][\"$tourDOW\"] += 1;\n\n\t\t//and create the date string for this week if it doesn't exist already\n\t\tif(!array_key_exists($tourWeek, $weekStrings)){\n\t\t\t$timeInfo = getdate($timestamp);\n\t\t\t$sunTimestamp = mktime(0,0,0, $timeInfo['mon'], $timeInfo['mday'] - $tourDOW, $timeInfo['year']);\n\t\t\t$satTimestamp = mktime(0,0,0, $timeInfo['mon'], $timeInfo['mday'] - $tourDOW + 6, $timeInfo['year']);\n\t\t\tif(date('M', $sunTimestamp) == date('M', $satTimestamp)){\n\t\t\t\t$timeStr = date('M j', $sunTimestamp) . ' - ' . date('j', $satTimestamp);\n\t\t\t} else {\n\t\t\t\t$timeStr = date('M j', $sunTimestamp) . ' - ' . date('M j', $satTimestamp);\n\t\t\t}\n\t\t\t$weekStrings[\"$tourWeek\"] = $timeStr;\n\t\t\t$tsl = getTextWidth($timeStr);\n\t\t\tif($tsl > $timeStringLength) $timeStringLength = $tsl;\n\t\t}\n\t}\n\n\tif(!$writeStats) return;\n\n\tif($excel)\n\t\t$statsSheet = &$workBook->add_worksheet($name.' Stats');\n\n\t//fill the column headers and set the the column widths\n\t$statsSheet->set_column(0, 0, $timeStringLength * (2.0/3.0));\n\t$statsSheet->write_string(0, 1, \"Monday\");\n\t$statsSheet->set_column(1, 1, getTextWidth(\"Monday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 2, \"Tuesday\");\n\t$statsSheet->set_column(2, 2, getTextWidth(\"Tuesday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 3, \"Wednesday\");\n\t$statsSheet->set_column(3, 3, getTextWidth(\"Wednesday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 4, \"Thursday\");\n\t$statsSheet->set_column(4, 4, getTextWidth(\"Thursday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 5, \"Friday\");\n\t$statsSheet->set_column(5, 5, getTextWidth(\"Friday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 6, \"Total\");\n\t$statsSheet->set_column(6, 6, getTextWidth(\"Total\") * (2.0/3.0));\n\n\t//then start populating all the data from the tours\n\t$numWeeks = count($tourDateCounts);\n\t$displayWeek = 0;\n\t//write the counts for each week\n\tfor($week = 0; $week < $numWeeks; $week++){\n\t\tif($file){\n\t\t\tfwrite($f, \"Week $week, Tours \".$tourWeekCounts[$week].\"\\n\");\n\t\t\tfor($i = 0; $i < 7; $i++){\n\t\t\t\tfwrite($f, \"Day $i, Tours \".$tourDateCounts[$week][$i].\"\\n\");\n\t\t\t}\n\t\t}\n\t\tif($tourWeekCounts[$week] == 0) continue;\n\t\t$statsSheet->write_string($displayWeek+1, 0, $weekStrings[$week]);\n\t\tfor($day = 1; $day < 6; $day++){\n\t\t\tif($excel)\n\t\t\t\t$statsSheet->write_number($displayWeek + 1, $day, $tourDateCounts[$week][$day]);\n\t\t\tif($file)\n\t\t\t\tfwrite($f, \"Week $week, Day $day, Tours \".$tourDateCounts[$week][$day].\"\\n\");\n\t\t}\n\t\t//write the totals for each week\n\t\tif($excel)\n\t\t\t$statsSheet->write_number($displayWeek + 1, 6, $tourWeekCounts[$week]);\n\t\tif($file)\n\t\t\tfwrite($f, \"Week $week, Total Tours \".$tourWeekCounts[$week].\"\\n\");\n\t\t$displayWeek++;\n\t}\n\t//then write the totals for the semester\n\tfor($day = 1; $day < 6; $day++){\n\t\tif($excel)\n\t\t\t$statsSheet->write_number($displayWeek + 1, $day, $tourDayCounts[$day]);\n\t\tif($file)\n\t\t\tfwrite($f, \"Day $day, Total Tours \".$tourDayCounts[$day].\"\\n\");\n\t}\n\n\tif($excel)\n\t\t$statsSheet->write_number($displayWeek + 1, 6, $numSemesterTours);\n\tif($file)\n\t\tfwrite($f, \"Total Tours: $numSemesterTours\\n\");\n\n\tunset($tourDayCounts);\n\tunset($tourWeekCounts);\n\tunset($tourDateCounts);\n\tunset($weekStrings);\n}", "function writePageTree() {\n if (count($pages) == 0)\n throw new IOException(\"The document has no pages.\");\n $leaf = 1;\n $tParents = parents;\n $tPages = pages;\n $nextParents = array();\n while (TRUE) {\n $leaf *= $leafSize;\n $stdCount = $leafSize;\n $rightCount = count($tPages) % $leafSize;\n if ($rightCount == 0)\n $rightCount = $leafSize;\n for ($p = 0; $p < count($tParents); ++$p) {\n $count = 0;\n $thisLeaf = $leaf;\n if ($p == count($tParents) - 1) {\n $count = $rightCount;\n $thisLeaf = count($pages) % $leaf;\n if ($thisLeaf == 0)\n $thisLeaf = $leaf;\n }\n else\n $count = $stdCount;\n $top = new PdfDictionary(PdfName::$PAGES);\n $top->put(PdfName::COUNT, new PdfNumber($thisLeaf));\n $kids = new PdfArray();\n $internal = $kids->getArrayList();\n $arraySublist = array();\n for ($k = $p * $stdCount; $k <= $p * $stdCount + $count; $k++)\n {\n array_push($arraySublist, $tPages[$k]);\n }\n $internal = array_merge($internal, $arraySublist);\n $top->put(PdfName::$KIDS, $kids);\n if (count($tParents) > 1) {\n if (($p % $leafSize) == 0)\n array_push($nextParents, $writer->getPdfIndirectReference());\n $top->put(PdfName::$PARENT, $nextParents[$p / $leafSize]);\n }\n $writer->addToBody($top, $tParents[$p]);\n }\n if (count($tParents) == 1) {\n $topParent = $tParents[0];\n return $topParent;\n }\n $tPages = $tParents;\n $tParents = $nextParents;\n $nextParents = array();\n }\n }", "public function write(): string\n {\n\n $msg = \"\";\n foreach ($this->tree as $tree) {\n $msg .= $tree[0]::toHl7($tree) . chr(13); //carriage return\n }\n return $msg;\n }", "function putInTree()\n\t{\n//echo \"st:putInTree\";\n\t\t// chapters should be behind pages in the tree\n\t\t// so if target is first node, the target is substituted with\n\t\t// the last child of type pg\n\t\tif ($_GET[\"target\"] == IL_FIRST_NODE)\n\t\t{\n\t\t\t$tree = new ilTree($this->content_object->getId());\n\t\t\t$tree->setTableNames('lm_tree','lm_data');\n\t\t\t$tree->setTreeTablePK(\"lm_id\");\n\n\t\t\t// determine parent node id\n\t\t\t$parent_id = (!empty($_GET[\"obj_id\"]))\n\t\t\t\t? $_GET[\"obj_id\"]\n\t\t\t\t: $tree->getRootId();\n\t\t\t// determine last child of type pg\n\t\t\t$childs =& $tree->getChildsByType($parent_id, \"pg\");\n\t\t\tif (count($childs) != 0)\n\t\t\t{\n\t\t\t\t$_GET[\"target\"] = $childs[count($childs) - 1][\"obj_id\"];\n\t\t\t}\n\t\t}\n\t\tif (empty($_GET[\"target\"]))\n\t\t{\n\t\t\t$_GET[\"target\"] = IL_LAST_NODE;\n\t\t}\n\n\t\tparent::putInTree();\n\t}", "private function write_data_to_db()\r\n {\r\n $dic_depth = 1;\r\n \r\n for ($dic_depth = 1; $dic_depth < 6; $dic_depth++)\r\n {\r\n foreach ($this->directory_array[$dic_depth] as $id => $dic_node)\r\n {\r\n // create node is not existed, get id when existed\r\n $ret = $this->add_testsuite_node_to_db($dic_depth, $dic_node);\r\n \r\n // create testcase under testsuite\r\n if ($ret)\r\n {\r\n $this->add_testcase_nodes_to_db($dic_depth, $dic_node);\r\n }\r\n }\r\n }\r\n }", "public function close(): void\n {\n $phpSheet = $this->phpSheet;\n\n // Storing selected cells and active sheet because it changes while parsing cells with formulas.\n $selectedCells = $this->phpSheet->getSelectedCells();\n $activeSheetIndex = $this->phpSheet->getParentOrThrow()->getActiveSheetIndex();\n\n // Write BOF record\n $this->storeBof(0x0010);\n\n // Write PRINTHEADERS\n $this->writePrintHeaders();\n\n // Write PRINTGRIDLINES\n $this->writePrintGridlines();\n\n // Write GRIDSET\n $this->writeGridset();\n\n // Calculate column widths\n $phpSheet->calculateColumnWidths();\n\n // Column dimensions\n if (($defaultWidth = $phpSheet->getDefaultColumnDimension()->getWidth()) < 0) {\n $defaultWidth = \\PhpOffice\\PhpSpreadsheet\\Shared\\Font::getDefaultColumnWidthByFont($phpSheet->getParentOrThrow()->getDefaultStyle()->getFont());\n }\n\n $columnDimensions = $phpSheet->getColumnDimensions();\n $maxCol = $this->lastColumnIndex - 1;\n for ($i = 0; $i <= $maxCol; ++$i) {\n $hidden = 0;\n $level = 0;\n $xfIndex = 15; // there are 15 cell style Xfs\n\n $width = $defaultWidth;\n\n $columnLetter = Coordinate::stringFromColumnIndex($i + 1);\n if (isset($columnDimensions[$columnLetter])) {\n $columnDimension = $columnDimensions[$columnLetter];\n if ($columnDimension->getWidth() >= 0) {\n $width = $columnDimension->getWidth();\n }\n $hidden = $columnDimension->getVisible() ? 0 : 1;\n $level = $columnDimension->getOutlineLevel();\n $xfIndex = $columnDimension->getXfIndex() + 15; // there are 15 cell style Xfs\n }\n\n // Components of columnInfo:\n // $firstcol first column on the range\n // $lastcol last column on the range\n // $width width to set\n // $xfIndex The optional cell style Xf index to apply to the columns\n // $hidden The optional hidden atribute\n // $level The optional outline level\n $this->columnInfo[] = [$i, $i, $width, $xfIndex, $hidden, $level];\n }\n\n // Write GUTS\n $this->writeGuts();\n\n // Write DEFAULTROWHEIGHT\n $this->writeDefaultRowHeight();\n // Write WSBOOL\n $this->writeWsbool();\n // Write horizontal and vertical page breaks\n $this->writeBreaks();\n // Write page header\n $this->writeHeader();\n // Write page footer\n $this->writeFooter();\n // Write page horizontal centering\n $this->writeHcenter();\n // Write page vertical centering\n $this->writeVcenter();\n // Write left margin\n $this->writeMarginLeft();\n // Write right margin\n $this->writeMarginRight();\n // Write top margin\n $this->writeMarginTop();\n // Write bottom margin\n $this->writeMarginBottom();\n // Write page setup\n $this->writeSetup();\n // Write sheet protection\n $this->writeProtect();\n // Write SCENPROTECT\n $this->writeScenProtect();\n // Write OBJECTPROTECT\n $this->writeObjectProtect();\n // Write sheet password\n $this->writePassword();\n // Write DEFCOLWIDTH record\n $this->writeDefcol();\n\n // Write the COLINFO records if they exist\n if (!empty($this->columnInfo)) {\n $colcount = count($this->columnInfo);\n for ($i = 0; $i < $colcount; ++$i) {\n $this->writeColinfo($this->columnInfo[$i]);\n }\n }\n $autoFilterRange = $phpSheet->getAutoFilter()->getRange();\n if (!empty($autoFilterRange)) {\n // Write AUTOFILTERINFO\n $this->writeAutoFilterInfo();\n }\n\n // Write sheet dimensions\n $this->writeDimensions();\n\n // Row dimensions\n foreach ($phpSheet->getRowDimensions() as $rowDimension) {\n $xfIndex = $rowDimension->getXfIndex() + 15; // there are 15 cellXfs\n $this->writeRow(\n $rowDimension->getRowIndex() - 1,\n (int) $rowDimension->getRowHeight(),\n $xfIndex,\n !$rowDimension->getVisible(),\n $rowDimension->getOutlineLevel()\n );\n }\n\n // Write Cells\n foreach ($phpSheet->getCellCollection()->getSortedCoordinates() as $coordinate) {\n /** @var Cell $cell */\n $cell = $phpSheet->getCellCollection()->get($coordinate);\n $row = $cell->getRow() - 1;\n $column = Coordinate::columnIndexFromString($cell->getColumn()) - 1;\n\n // Don't break Excel break the code!\n if ($row > 65535 || $column > 255) {\n throw new WriterException('Rows or columns overflow! Excel5 has limit to 65535 rows and 255 columns. Use XLSX instead.');\n }\n\n // Write cell value\n $xfIndex = $cell->getXfIndex() + 15; // there are 15 cell style Xfs\n\n $cVal = $cell->getValue();\n if ($cVal instanceof RichText) {\n $arrcRun = [];\n $str_pos = 0;\n $elements = $cVal->getRichTextElements();\n foreach ($elements as $element) {\n // FONT Index\n $str_fontidx = 0;\n if ($element instanceof Run) {\n $getFont = $element->getFont();\n if ($getFont !== null) {\n $str_fontidx = $this->fontHashIndex[$getFont->getHashCode()];\n }\n }\n $arrcRun[] = ['strlen' => $str_pos, 'fontidx' => $str_fontidx];\n // Position FROM\n $str_pos += StringHelper::countCharacters($element->getText(), 'UTF-8');\n }\n $this->writeRichTextString($row, $column, $cVal->getPlainText(), $xfIndex, $arrcRun);\n } else {\n switch ($cell->getDatatype()) {\n case DataType::TYPE_STRING:\n case DataType::TYPE_INLINE:\n case DataType::TYPE_NULL:\n if ($cVal === '' || $cVal === null) {\n $this->writeBlank($row, $column, $xfIndex);\n } else {\n $this->writeString($row, $column, $cVal, $xfIndex);\n }\n\n break;\n case DataType::TYPE_NUMERIC:\n $this->writeNumber($row, $column, $cVal, $xfIndex);\n\n break;\n case DataType::TYPE_FORMULA:\n $calculatedValue = $this->preCalculateFormulas ?\n $cell->getCalculatedValue() : null;\n if (self::WRITE_FORMULA_EXCEPTION == $this->writeFormula($row, $column, $cVal, $xfIndex, $calculatedValue)) {\n if ($calculatedValue === null) {\n $calculatedValue = $cell->getCalculatedValue();\n }\n $calctype = gettype($calculatedValue);\n switch ($calctype) {\n case 'integer':\n case 'double':\n $this->writeNumber($row, $column, (float) $calculatedValue, $xfIndex);\n\n break;\n case 'string':\n $this->writeString($row, $column, $calculatedValue, $xfIndex);\n\n break;\n case 'boolean':\n $this->writeBoolErr($row, $column, (int) $calculatedValue, 0, $xfIndex);\n\n break;\n default:\n $this->writeString($row, $column, $cVal, $xfIndex);\n }\n }\n\n break;\n case DataType::TYPE_BOOL:\n $this->writeBoolErr($row, $column, $cVal, 0, $xfIndex);\n\n break;\n case DataType::TYPE_ERROR:\n $this->writeBoolErr($row, $column, ErrorCode::error($cVal), 1, $xfIndex);\n\n break;\n }\n }\n }\n\n // Append\n $this->writeMsoDrawing();\n\n // Restoring active sheet.\n $this->phpSheet->getParentOrThrow()->setActiveSheetIndex($activeSheetIndex);\n\n // Write WINDOW2 record\n $this->writeWindow2();\n\n // Write PLV record\n $this->writePageLayoutView();\n\n // Write ZOOM record\n $this->writeZoom();\n if ($phpSheet->getFreezePane()) {\n $this->writePanes();\n }\n\n // Restoring selected cells.\n $this->phpSheet->setSelectedCells($selectedCells);\n\n // Write SELECTION record\n $this->writeSelection();\n\n // Write MergedCellsTable Record\n $this->writeMergedCells();\n\n // Hyperlinks\n $phpParent = $phpSheet->getParent();\n $hyperlinkbase = ($phpParent === null) ? '' : $phpParent->getProperties()->getHyperlinkBase();\n foreach ($phpSheet->getHyperLinkCollection() as $coordinate => $hyperlink) {\n [$column, $row] = Coordinate::indexesFromString($coordinate);\n\n $url = $hyperlink->getUrl();\n\n if (strpos($url, 'sheet://') !== false) {\n // internal to current workbook\n $url = str_replace('sheet://', 'internal:', $url);\n } elseif (preg_match('/^(http:|https:|ftp:|mailto:)/', $url)) {\n // URL\n } elseif (!empty($hyperlinkbase) && preg_match('~^([A-Za-z]:)?[/\\\\\\\\]~', $url) !== 1) {\n $url = \"$hyperlinkbase$url\";\n if (preg_match('/^(http:|https:|ftp:|mailto:)/', $url) !== 1) {\n $url = 'external:' . $url;\n }\n } else {\n // external (local file)\n $url = 'external:' . $url;\n }\n\n $this->writeUrl($row - 1, $column - 1, $url);\n }\n\n $this->writeDataValidity();\n $this->writeSheetLayout();\n\n // Write SHEETPROTECTION record\n $this->writeSheetProtection();\n $this->writeRangeProtection();\n\n // Write Conditional Formatting Rules and Styles\n $this->writeConditionalFormatting();\n\n $this->storeEof();\n }", "public function menu_tree_output($tree)\n {\n return menu_tree_output($tree);\n }", "abstract public function tree_encoder();", "public function write(Spreadsheet $spreadsheet) {\n\t\t$writer = $this->getWriter($spreadsheet);\n\t\t$success = $writer->save($this->getFilepath());\n\t\treturn true;\n\t}", "private function saveToXml(){\n\t\n\t\t//XML-Object\n\t\t$xml = new LegosXmlWriter();\t\n\t\n\t\t// Name Worksheet\n\t\t$xml->setWorksheetName( \"Mission $this->missionId\" );\n\t\n\t\t// Write data\n\t\t$xml->writeData ( \"Mission No. $this->missionId\", 1, 1 );\n\t\t\n\t\t$xml->writeData ( \"DCM TIME + unloading, loading\", 2, 1 );\n\t\t$xml->writeData ( $this->dcmTime, 2, 2 );\n\t\t\n\t\t$xml->writeData ( \"PCM Start\", 3, 1 );\n\t\t$xml->writeData ( $this->pcmStart, 3, 2 );\n\t\t\n\t\t$xml->writeData ( \"PCM End\", 4, 1 );\n\t\t$xml->writeData ( $this->pcmEnd, 4, 2 );\n\t\t\n\t\t$xml->writeData ( \"PCM TIME\", 5, 1 );\n\t\t$xml->writeData ( $this->pcmTime, 5, 2 );\n\t\t\n\t\t$xml->writeData ( \"Total Mission Time \", 6, 1 );\n\t\t$xml->writeData ( $this->totalTime, 6, 2 );\n\t\t\n\t\t$xml->writeData ( \"Pushback Start\", 7, 1 );\n\t\t$xml->writeData ( $this->pushbackStart, 7, 2 );\n\t\t\n\t\t$xml->writeData ( \"Pushback End\", 8, 1 );\n\t\t$xml->writeData ( $this->pushbackEnd, 8, 2 );\n\t\t\n\t\t$xml->writeData ( \"Pushback TIME\", 9, 1 );\n\t\t$xml->writeData ( $this->pushbackTime, 9, 2 );\n\t\n\t\t$exportFilename = \"Export_Mission_$this->missionId \" . date ( 'Y-m-d h:i:s' ) . '.xls';\n\t\n\t\tfile_put_contents( sfConfig::get( 'app_export_path' ). \"/\". $exportFilename, $xml->getFile());\n\t\n\t\treturn $exportFilename;\n\t\n\t}", "public function writeTree(Tx_PtExtbase_Tree_TreeInterface $tree)\n {\n $this->traverseTreeDfs($tree);\n $nodeArray = $this->arrayWriterVisitor->getNodeArray();\n return $nodeArray;\n }", "public function asXml(&$sheets, $sourceCharset = 'utf-8') {\r\n $doc = new SimpleXMLElement(\r\n'<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"\r\n xmlns:o=\"urn:schemas-microsoft-com:office:office\"\r\n xmlns:x=\"urn:schemas-microsoft-com:office:excel\"\r\n xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"\r\n xmlns:html=\"http://www.w3.org/TR/REC-html40\"></Workbook>'\r\n);\r\n\r\n \r\n $convArgs = array(\r\n 'sourceCharset' => &$sourceCharset,\r\n 'iconv' => ($sourceCharset == 'utf-8' ? false : true)\r\n );\r\n\r\n $indexOfSheet = 0;\r\n foreach ($sheets as $sheet) :\r\n //<Worksheet ss:Name=\"Sheet1\">\r\n //<Table>\r\n $worksheetNode = $doc->addChild('Worksheet');\r\n //$worksheetNode->addAttribute('ss:Name', 'sheet1');//BUG?\r\n $worksheetNode['ss:Name'] = 'sheet' . (++$indexOfSheet);\r\n\r\n $worksheetNode->Table = '';//add a child with value '' by setter\r\n //$tableNode = $worksheetNode->addChild('Table');/add a child by addChild()\r\n\r\n if ( !array_key_exists(0, $sheet[0]) ) {\r\n //an associative array, write header fields.\r\n $rowNode = $worksheetNode->Table->addChild('Row');\r\n foreach(array_keys($sheet[0]) as $fieldName) {\r\n $cellNode = $rowNode->addChild('Cell');\r\n $cellNode->Data = self::convCellData($convArgs, $fieldName);\r\n $cellNode->Data['ss:Type'] = 'String';\r\n }\r\n }\r\n\r\n foreach ($sheet as $row) :\r\n //<Row>\r\n $rowNode = $worksheetNode->Table->addChild('Row');\r\n foreach ($row as $col) :\r\n //<Cell><Data ss:Type=\"Number\">1</Data></Cell>\r\n $cellNode = $rowNode->addChild('Cell');\r\n $cellNode->Data = self::convCellData($convArgs, $col);\r\n $cellNode->Data['ss:Type'] = (\r\n (!is_string($col) or (is_numeric($col) and $col[0] != '0'))\r\n ? 'Number'\r\n : 'String'\r\n );\r\n endforeach;//$row as $col\r\n endforeach;//$sheet as $row\r\n endforeach;//$sheets as $sheet\r\n return $doc->asXML();\r\n }", "function exportFOPageObjects(&$a_xml_writer)\n\t{\n\t\tglobal $ilBench;\n\n\t\t$this->tree = new ilTree($this->getLmId());\n\t\t$this->tree->setTableNames('lm_tree', 'lm_data');\n\t\t$this->tree->setTreeTablePK(\"lm_id\");\n\n\t\t$childs = $this->tree->getChilds($this->getId());\n\t\tforeach ($childs as $child)\n\t\t{\n\t\t\tif($child[\"type\"] != \"pg\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// export xml to writer object\n\t\t\t//$ilBench->start(\"ContentObjectExport\", \"exportStructureObject_exportPageObjectAlias\");\n\n\t\t\t$page_obj = new ilLMPageObject($this->getContentObject(), $child[\"obj_id\"]);\n\t\t\t$page_obj->exportFO($a_xml_writer);\n\n\t\t\t//$ilBench->stop(\"ContentObjectExport\", \"exportStructureObject_exportPageObjectAlias\");\n\t\t}\n\t}", "private function writeGridset(): void\n {\n $record = 0x0082; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $fGridSet = !$this->phpSheet->getPrintGridlines(); // Boolean flag\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $fGridSet);\n $this->append($header . $data);\n }", "abstract protected function getWriter(Spreadsheet $spreadsheet);", "function wp_print_theme_file_tree($tree, $level = 2, $size = 1, $index = 1)\n {\n }", "function writeDom($dom, $file_name){\n @$dom->validate();\n if(!$handle=fopen(dirname(__FILE__).\"/\".$file_name, 'w')){\n exit(\"Cannot open $filename\");\n }\n\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = false;\n if (fwrite($handle, $dom->saveXML()) === FALSE) {\n fclose($handle);\n exit(\"Cannot write to $file_name\");\n }\n}", "function crea_riga_sheet($writer, $titoloSheet, $utente_compilazione, $utente_valutato, $risposte) {\n $row = [$utente_compilazione, $utente_valutato];\n for($i = 0; $i < count($risposte); $i++){\n $row[] = $risposte[$i]->get_desc_risposta();\n $row[] = $risposte[$i]->prodotto;\n $row[] = $risposte[$i]->note;\n }\n $row = array_map(function($x){return ($x != null) ? $x : \"-\";}, $row);\n $writer->writeSheetRow($titoloSheet, $row);\n }", "public function toTree()\n {\n throw new RuntimeException('This repository does not support \"toTree\" method.');\n }", "private function write_csv($array) //public function write_address_book($addresses_array) //code to write $addresses_array to file $this->filenam\n {\n if(is_writeable($this->filename)){\n $handle = fopen($this->filename, 'w');\n foreach($addresses_array as $subArray){\n fputcsv($handle, $subArray); \n }\n }\n fclose($handle);\n }", "public function createHierarchy(){\n\t\tmysqli_query($this->db, \"TRUNCATE TABLE hierarchy\");\n\t\t\n\t\t$insert_sql = \"INSERT INTO hierarchy VALUES\";\n\t\tforeach ($this->structure as $key => $value) {\n\t\t\t$position = $value['number'] + 1;\n\t\t\t$rows[] = \"('', '{$key}', '{$position}')\";\n\t\t}\n\t\t$insert_sql = $insert_sql.implode(\",\", $rows);\n\t\tmysqli_query($this->db, $insert_sql);\n\t}", "public function save($path) {\n $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');\n $objWriter->save($path);\n }", "private function writePanes(): void\n {\n if (!$this->phpSheet->getFreezePane()) {\n // thaw panes\n return;\n }\n\n [$column, $row] = Coordinate::indexesFromString($this->phpSheet->getFreezePane());\n $x = $column - 1;\n $y = $row - 1;\n\n [$leftMostColumn, $topRow] = Coordinate::indexesFromString($this->phpSheet->getTopLeftCell() ?? '');\n //Coordinates are zero-based in xls files\n $rwTop = $topRow - 1;\n $colLeft = $leftMostColumn - 1;\n\n $record = 0x0041; // Record identifier\n $length = 0x000A; // Number of bytes to follow\n\n // Determine which pane should be active. There is also the undocumented\n // option to override this should it be necessary: may be removed later.\n $pnnAct = 0;\n if ($x != 0 && $y != 0) {\n $pnnAct = 0; // Bottom right\n }\n if ($x != 0 && $y == 0) {\n $pnnAct = 1; // Top right\n }\n if ($x == 0 && $y != 0) {\n $pnnAct = 2; // Bottom left\n }\n if ($x == 0 && $y == 0) {\n $pnnAct = 3; // Top left\n }\n\n $this->activePane = $pnnAct; // Used in writeSelection\n\n $header = pack('vv', $record, $length);\n $data = pack('vvvvv', $x, $y, $rwTop, $colLeft, $pnnAct);\n $this->append($header . $data);\n }", "function writeXMLFile($node, $filename) {\n\tglobal $gui_writedir;\n\t$previous_dir = getcwd();\n\tchdir($gui_writedir);\n\t$file = fopen($filename, 'w+');\n\t$result = fwrite($file, $node->asXML());\n\tif (!$result) {\n\t\tfclose($file);\n\t\tdie(\"Failed to write $filename\\n\");\n\t}\n\techo \"Successfully wrote $filename<br />\";\n\tfclose($file);\n\tchdir($previous_dir);\n}", "public function save( $settings=array() )\n\t{\n\t\tif ( empty($this->_spreadsheet) )\n\t\t\t$this->create();\n\n\t\t//Used for saving sheets\n\t\trequire self::VENDOR_PACKAGE.'IOFactory.php';\n\n $way = '/var/www/svarog/data/www/vfmpei.141592.org/Download/meteo/';\n\n\t\t$settings = array_merge(array(\n\t\t\t'format'\t\t=> 'Excel2007',\n\t\t\t'path'\t\t\t=> $way,\n\t\t\t'name'\t\t\t=> 'NewSpreadsheet'\n\n\t\t), $settings);\n\n $href = $settings['name'] . '_'.time().'.xlsx';\n\t\t//Generate full path\n\t\t$settings['fullpath'] = $settings['path'] . $href;\n\n\t\t$Writer = PHPExcel_IOFactory::createWriter($this->_spreadsheet, $settings['format']);\n\t\t// If you want to output e.g. a PDF file, simply do:\n\t\t//$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'PDF');\n\t\t$Writer->save( $settings['fullpath'] );\n\n\t\treturn $href;\n\t}", "function saveFolderXML(){\n\t\t\t$folders = new SimpleXMLElement(\"<folders></folders>\");\n\t\t\tforeach ($this -> folderMap as $id => $fname){\n\t\t\t\t\n\t\t\t\t$folder = $folders->addChild('folder');\n\t\t\t\t$folder->addAttribute('id', $id);\n\t\t\t\t$folder->addAttribute('name', $fname);\n\t\t\t}\n\t\t\t$fh = fopen($_SERVER['DOCUMENT_ROOT'].\"/\".$this -> rootFolder.\"/folderList.xml\", 'w');\n\t\t\tfwrite($fh, $folders -> asXML());\n\t\t\tfclose($fh);\n\t\t}", "public function export($data)\n {\n $data = array($this->root => $data);\n\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>';\n $this->recurse($data, 0);\n echo PHP_EOL;\n }", "private function writeXML($array){\n\t\tif(!class_exists('XML_Serializer')){\n\t\t\t\trequire_once('XML/Serializer.php');\n\t\t}\n\n\t\t\t$options = array(\n\t\t\t\tXML_SERIALIZER_OPTION_INDENT => \"\\t\", // indent with tabs\n\t\t\t\tXML_SERIALIZER_OPTION_RETURN_RESULT => true,\n\t\t\t\tXML_SERIALIZER_OPTION_LINEBREAKS => \"\\n\", // use UNIX line breaks\n\t\t\t\tXML_SERIALIZER_OPTION_ROOT_NAME => 'data',// root tag\n\t\t\t\tXML_SERIALIZER_OPTION_DEFAULT_TAG => 'item' // tag for values \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // with numeric keys\n\t\t );\n\t\t \n\t\t\t$serializer = new XML_Serializer($options);\n \t\treturn \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\".\"\\n\".$serializer->serialize($array);\n\t}", "function writeHTML()\n\t{\n\t\tglobal $_activeTree;\n\t\t\n\t\t$_activeTree= $this;\n\t\t\n\t\t$this->writeScript();\n\t\t$width = is_numeric($this->width) ? \"{$this->width}px\" : $this->width;\n\t\t$height = is_numeric($this->height) ? \"{$this->height}px\" : $this->height;\n\t\t\n\t\tif ($this->selectMode == \"single\")\n\t\t{\n?>\n<input type='hidden' name='<?echo $this->id ?>' id='<?echo $this->id?>' value='<?echo $this->value ?>'/>\n<? \n\t\t}\n?><table id=\"<?echo $this->id?>_table\" class=\"<? echo $this->style?>\" cellpadding=\"0\" cellspacing=\"0\" <? if ($this->width) echo \"style='width:{$width}'\"; ?>>\n\t\t <? \n\t\t if ($this->title)\n\t\t {\n\t\t ?>\t\t \n\t\t <tr>\n\t\t <th><? echo $this->title?></th>\n\t\t </tr>\n\t\t <?\n\t\t }\n\t\t ?>\n\t\t <tr>\n\t\t <td>\n\t\t <div style=\"padding: 0; margin: 0; width: 100%;<? if ($this->height > 0) { ?> height: <?echo $this->height?>px;<? } ?><?if ($this->scroll) echo \"overflow: auto\"?>\">\n<?\n\t\t$this->writeNodes();\n?>\n\t\t </div>\n\t\t </td>\n\t\t </tr>\n\t\t</table>\n<?\n\t\t$_activeTree = null;\n\t}", "public function write($xml);", "public function writeXmlContents($writer)\n {\n parent::writeXmlContents($writer);\n if ($this->father) {\n $writer->startElementNs('fs', 'father', null);\n $this->father->writeXmlContents($writer);\n $writer->endElement();\n }\n if ($this->mother) {\n $writer->startElementNs('fs', 'mother', null);\n $this->mother->writeXmlContents($writer);\n $writer->endElement();\n }\n if ($this->child) {\n $writer->startElementNs('fs', 'child', null);\n $this->child->writeXmlContents($writer);\n $writer->endElement();\n }\n if ($this->fatherFacts) {\n foreach ($this->fatherFacts as $i => $x) {\n $writer->startElementNs('fs', 'fatherFact', null);\n $x->writeXmlContents($writer);\n $writer->endElement();\n }\n }\n if ($this->motherFacts) {\n foreach ($this->motherFacts as $i => $x) {\n $writer->startElementNs('fs', 'motherFact', null);\n $x->writeXmlContents($writer);\n $writer->endElement();\n }\n }\n }", "public function save(){\n return parent::writeFile( $this->outputFile, $this->template);\n }", "function exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)\n\t{\n\t\t$this->tree = new ilTree($this->getLmId());\n\t\t$this->tree->setTableNames('lm_tree', 'lm_data');\n\t\t$this->tree->setTreeTablePK(\"lm_id\");\n\n\t\t$childs = $this->tree->getChilds($this->getId());\n\t\tforeach ($childs as $child)\n\t\t{\n\t\t\tif($child[\"type\"] != \"st\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// export xml to writer object\n\t\t\t$structure_obj = new ilStructureObject($this->getContentObject(),\n\t\t\t\t$child[\"obj_id\"]);\n\t\t\t$structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);\n\t\t\tunset($structure_obj);\n\t\t}\n\t}", "function ooffice_write_domaine( $domaine ) {\r\nglobal $odt;\r\n \r\n\t\tif ($domaine){\r\n $code = $domaine->code_domaine;\r\n $description_domaine = $domaine->description_domaine;\r\n $ref_referentiel = $domaine->ref_referentiel;\r\n\t\t\t$num_domaine = $domaine->num_domaine;\r\n\t\t\t$nb_competences = $domaine->nb_competences;\r\n \t\t\t$odt->SetFont('Arial','B',10); \r\n \t $odt->Write(0,recode_utf8_vers_latin1(trim(get_string('domaine','referentiel').\" : \".stripslashes($code))));\r\n $odt->Ln(1);\r\n $odt->SetFont('Arial','',10); \r\n \t $odt->Write(0, recode_utf8_vers_latin1(trim(stripslashes($description_domaine))));\r\n \t \t$odt->Ln(1);\r\n\t\t\t$odt->Ln(1);\r\n\t\t\t// LISTE DES COMPETENCES DE CE DOMAINE\r\n\t\t\t$records_competences = referentiel_get_competences($domaine->id);\r\n\t\t\tif ($records_competences){\r\n\t\t\t\tforeach ($records_competences as $record_c){\r\n ooffice_write_competence( $record_c );\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n}", "abstract public function addNewSheet();", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "function exportDataToExcel($table_details,$file_name,$worksheet_name)\n\n\t{\n\t// Creating a workbook\n\t$workbook = new Spreadsheet_Excel_Writer();\n\t\n\t// sending HTTP headers\n\t$workbook->send(\"$file_name\".'xls');\n\t\n\t// Creating a worksheet\n\t$worksheet =& $workbook->addWorksheet(\"'$worksheet_name'\");\n\t\n\t\n\t\tif ($table_details)\n\t\t\t{\n\t\t\t\t$colcount=0; //for setting the footer colspan\n\t\t\t\tforeach($table_details[0] as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t$worksheet->write(0,$colcount ,$key );\n\t\t\t\t\t$colcount++;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t$i=0;\n\t\t\t$cnt=count($table_details);\n\t\t\t\n\t\t\tfor($j=0; $j<$cnt; $j++)\n\t\t\t\t{\n\t\n\t\t\t\t$cell=0;\n\t\t\t\tforeach($table_details[$j] as $key=>$value)\n\t\t\t\t\t{\n\t\n\t\t\t\t\t$worksheet->write($j+1,$cell ,$value );\n\t\t\t\t\t$cell++;\n\t\t\t\t\t}\n\t\n\t\t\t\t}\n\t$workbook->close();\n\t}", "private function writeMergedCells(): void\n {\n $mergeCells = $this->phpSheet->getMergeCells();\n $countMergeCells = count($mergeCells);\n\n if ($countMergeCells == 0) {\n return;\n }\n\n // maximum allowed number of merged cells per record\n $maxCountMergeCellsPerRecord = 1027;\n\n // record identifier\n $record = 0x00E5;\n\n // counter for total number of merged cells treated so far by the writer\n $i = 0;\n\n // counter for number of merged cells written in record currently being written\n $j = 0;\n\n // initialize record data\n $recordData = '';\n\n // loop through the merged cells\n foreach ($mergeCells as $mergeCell) {\n ++$i;\n ++$j;\n\n // extract the row and column indexes\n $range = Coordinate::splitRange($mergeCell);\n [$first, $last] = $range[0];\n [$firstColumn, $firstRow] = Coordinate::indexesFromString($first);\n [$lastColumn, $lastRow] = Coordinate::indexesFromString($last);\n\n $recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, $firstColumn - 1, $lastColumn - 1);\n\n // flush record if we have reached limit for number of merged cells, or reached final merged cell\n if ($j == $maxCountMergeCellsPerRecord || $i == $countMergeCells) {\n $recordData = pack('v', $j) . $recordData;\n $length = strlen($recordData);\n $header = pack('vv', $record, $length);\n $this->append($header . $recordData);\n\n // initialize for next record, if any\n $recordData = '';\n $j = 0;\n }\n }\n }", "function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }", "public function writeExcel($arr_data,$filename){\n\t$excel = new PHPExcel;\n $list = $excel->setActiveSheetIndex(0);\n $rowcounter = 1;\n foreach($arr_data as $key=>$d){\n $chr = \"A\";\n foreach($d as $d1){\n $list->setCellValue($chr.$rowcounter,$d1);\n $chr++;\n }\n $rowcounter++;\n }\n\tif(pathinfo($filename, PATHINFO_EXTENSION) == \"xls\"){\n $writer = new PHPExcel_Writer_Excel5($excel);\n\t}else if(pathinfo($filename, PATHINFO_EXTENSION) == \"xlsx\"){\n\t $writer = new PHPExcel_Writer_Excel2007($excel);\n\t}else{\n\t\techo \"File is Neither XLS Nor XLSX \";\n\t}\n $writer->save($filename);\n }", "protected function _writeFileBody() {}", "function write_address_book($addresses_array)\n {\n return $this->write($addresses_array);\n }", "public function basic2(){\n // Create new Spreadsheet object\n $spreadsheet = new Spreadsheet();\n\n // Set document properties\n\n $spreadsheet->getProperties()->setCreator('Maarten Balliauw')\n ->setLastModifiedBy('Maarten Balliauw')\n ->setTitle('Office 2007 XLSX Test Document')\n ->setSubject('Office 2007 XLSX Test Document')\n ->setDescription('Test document for Office 2007 XLSX, generated using PHP classes.')\n ->setKeywords('office 2007 openxml php')\n ->setCategory('Test result file');\n\n// Add some data\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A1', 'Hello')\n ->setCellValue('B2', 'world!')\n ->setCellValue('C1', 'Hello')\n ->setCellValue('D2', 'world!');\n\n// Miscellaneous glyphs, UTF-8\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A4', 'Miscellaneous glyphs')\n ->setCellValue('A5', 'éàèùâêîôûëïüÿäöüç');\n\n// Rename worksheet\n $spreadsheet->getActiveSheet()->setTitle('Simple');\n\n// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n $spreadsheet->setActiveSheetIndex(0);\n\n// Redirect output to a client’s web browser (Ods)\n header('Content-Type: application/vnd.oasis.opendocument.spreadsheet');\n header('Content-Disposition: attachment;filename=\"01simple.ods\"');\n header('Cache-Control: max-age=0');\n// If you're serving to IE 9, then the following may be needed\n header('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n header('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header('Pragma: public'); // HTTP/1.0\n\n $writer = IOFactory::createWriter($spreadsheet, 'Ods');\n $writer->save('php://output');\n exit;\n\n }", "public function saveOrder($tree = [], $parentId = 0)\n {\n throw new RuntimeException('This repository does not support \"saveOrder\" method.');\n }", "function master_xml_export()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\n\t\t$entry = array();\n\n\t\t//-----------------------------------------\n\t\t// Get XML class\n\t\t//-----------------------------------------\n\n\t\trequire_once( KERNEL_PATH.'class_xml.php' );\n\n\t\t$xml = new class_xml();\n\n\t\t$xml->doc_type = $this->ipsclass->vars['gb_char_set'];\n\n\t\t$xml->xml_set_root( 'export', array( 'exported' => time() ) );\n\n\t\t//-----------------------------------------\n\t\t// Set group\n\t\t//-----------------------------------------\n\n\t\t$xml->xml_add_group( 'group' );\n\n\t\t//-----------------------------------------\n\t\t// Get templates...\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"com_section != 'bugtracker'\" ) );\n\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$content = array();\n\n\t\t\t//-----------------------------------------\n\t\t\t// Sort the fields...\n\t\t\t//-----------------------------------------\n\n\t\t\tforeach( $r as $k => $v )\n\t\t\t{\n\t\t\t\t$content[] = $xml->xml_build_simple_tag( $k, $v );\n\t\t\t}\n\n\t\t\t$entry[] = $xml->xml_build_entry( 'row', $content );\n\t\t}\n\n\t\t$xml->xml_add_entry_to_group( 'group', $entry );\n\n\t\t$xml->xml_format_document();\n\n\t\t$doc = $xml->xml_document;\n\n\t\t//-----------------------------------------\n\t\t// Print to browser\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->admin->show_download( $doc, 'components.xml', '', 0 );\n\t}", "function build_tree_table( $tree_id )\n\t{\n\t\n\t\t$fields = array(\n\t\t\t'node_id' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t => '8',\n\t\t\t\t'unsigned'\t\t => TRUE,\n\t\t\t\t'auto_increment' => TRUE,\n\t\t\t\t'null' => FALSE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t'lft' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint' => '8',\n\t\t\t\t'unsigned' =>\tTRUE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'rgt' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t=> '8',\n\t\t\t\t'unsigned'\t=>\tTRUE\n\t\t\t),\n\n\t\t\t'depth' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t=> '8',\n\t\t\t\t'unsigned'\t=>\tTRUE\n\t\t\t),\n\n\t\t\t'parent' => array(\n\t\t\t\t'type' => 'mediumint',\n\t\t\t\t'constraint'\t=> '8',\n\t\t\t\t'unsigned'\t=>\tTRUE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'moved'\t=> array(\n\t\t\t\t'type' => 'tinyint',\n\t\t\t\t'constraint'\t=> '1',\n\t\t\t\t'null' => FALSE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t'label'\t=> array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '255'\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'entry_id' => array(\n\t\t\t\t'type' => 'int',\n\t\t\t\t'constraint' => '10', \n\t\t\t\t'null' => TRUE),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'template_path' => array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '255'\n\t\t\t),\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'custom_url' => array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '250', \n\t\t\t\t'null' => TRUE\n\t\t\t),\n\n\t\t\t'type' => array(\n\t\t\t\t'type' => 'varchar', \n\t\t\t\t'constraint' => '250', \n\t\t\t\t'null' => TRUE\n\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t'field_data' => array(\n\t\t\t\t'type' => 'text'\n\t\t\t)\t\t\t\n\t\t);\n\t\t\t\n\t\tee()->load->dbforge();\n\t\tee()->dbforge->add_field( $fields );\n\t\tee()->dbforge->add_key( 'node_id', TRUE );\n\t\tee()->dbforge->create_table( 'taxonomy_tree_'.$tree_id );\n\t\t\n\t\tunset($fields);\n\t\t\t\t\n\t}", "function _factoryDocument($node_id, $plan_category_id, $output_type = 'p') {\n $this->load->library('PHPExcel');\n $sheet = $this->phpexcel->setActiveSheetIndex(0);\n $sheet->setTitle('Results');\n $planTable = Doctrine_Core::getTable('Plan');\n $plans = $planTable->retrieveByNodeExport($node_id);\n\n $sheet->setCellValue('A1', $this->translateTag('General', 'version'))\n ->setCellValue('B1', $this->translateTag('General', 'description'))\n ->setCellValue('C1', $this->translateTag('General', 'category'))\n ->setCellValue('D1', $this->translateTag('General', 'charger'))\n ->setCellValue('E1', $this->translateTag('General', 'creation'))\n ->setCellValue('F1', $this->translateTag('General', 'commentary'));\n\n\n $rcount = 1;\n\n foreach ($plans as $plan) {\n $rcount++;\n $sheet->setCellValueExplicit('A' . $rcount, $plan->plan_version, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('B' . $rcount, $plan->plan_description, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('C' . $rcount, $plan->PlanCategory->plan_category_name, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('D' . $rcount, $plan->User->user_name, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('E' . $rcount, $plan->plan_datetime, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('F' . $rcount, $plan->plan_comments, PHPExcel_Cell_DataType::TYPE_STRING);\n }\n\n $sheet->getStyle('A1:F1')->getFont()->applyFromArray(array(\n 'bold' => true\n ));\n\n $sheet->getStyle('A1:F1')->getFill()->applyFromArray(array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => array(\n 'rgb' => 'd9e5f4'\n )\n ));\n\n $sheet->getStyle('A1:F' . $rcount)->getBorders()->applyFromArray(array(\n 'allborders' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array(\n 'rgb' => '808080'\n )\n )\n ));\n\n if ($output_type == 'e') {\n $sheet->getColumnDimension('A')->setAutoSize(true);\n $sheet->getColumnDimension('B')->setAutoSize(true);\n $sheet->getColumnDimension('C')->setAutoSize(true);\n $sheet->getColumnDimension('D')->setAutoSize(true);\n $sheet->getColumnDimension('E')->setAutoSize(true);\n $sheet->getColumnDimension('F')->setAutoSize(true);\n\n $objWriter = PHPExcel_IOFactory::createWriter($this->phpexcel, 'Excel5');\n $extension = '.xls';\n } else {\n $sheet->getColumnDimension('A')->setWidth(20);\n $sheet->getColumnDimension('B')->setWidth(20);\n $sheet->getColumnDimension('C')->setWidth(30);\n $sheet->getColumnDimension('D')->setWidth(25);\n $sheet->getColumnDimension('E')->setWidth(35);\n $sheet->getColumnDimension('F')->setWidth(25);\n\n $this->phpexcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);\n $objWriter = PHPExcel_IOFactory::createWriter($this->phpexcel, 'PDF');\n $extension = '.pdf';\n }\n $file_name = $this->input->post('file_name') . $extension;\n $objWriter->save($this->app->getTempFileDir($file_name));\n\n\n $this->syslog->register('export_list_plan', array(\n $file_name\n )); // registering log\n\n return $file_name;\n }", "function writeHTML()\n\t{\n\t\tglobal $_activeTree;\n\t\t\n\t\t$c = count($this->children);\n\n\t\tif ($this->link)\n\t\t{\n\t\t\t$title = \"<a href='{$this->link}' target='{$this->target}'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = \"<a href='#' onclick='\";\n\t\t\t\n\t\t\tif ($_activeTree->onSelect)\n\t\t\t{\n\t\t\t\t$title .= \"{$_activeTree->onSelect}(\\\"{$this->value}\\\");\";\n\t\t\t}\n\t\t\t\n\t\t\t$title .= \"; return false'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\t\n\t\tif ($c == 0 && !$this->onDemand)\n\t\t{\n\t\t\t// Leaf node\n\t\t\techo \"<div class='{$this->leafStyle}'>\";\n\n\t\t\tif (isset($this->value) && $this->value !== \"\" && $_activeTree->selectMode != 'navigation')\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\"<? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n\t\t\n\t\t\techo \"$title</div>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->open)\n\t\t\t{\n\t\t\t\t$style = $this->openStyle;\n\t\t\t\t$display = \"block\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$style = $this->closedStyle;\n\t\t\t\t$display = \"none\";\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif ($this->onDemand)\n\t\t\t{\n\t\t\t\t$cmd = \"Tree.loadOnDemand('{$this->id}', '{$this->onDemand}');\";\n\t\t\t\t\n\t\t\t\tif ($this->open)\n\t\t\t\t{\n?>\n<script type=\"text/javascript\">\n\twindow.addEvent('domready', function() {Tree.loadOnDemand('<?echo $this->id?>', '<?echo $this->onDemand?>');});\n</script>\n<?\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$cmd = \"\";\n\t\t\t}\n\t\t\t\n\t\t\t$cmd .= \"Tree.toggleFolder('{$this->id}', '{$this->openStyle}', '{$this->closedStyle}');\";\n?>\n\t\t<div id='<?echo $this->id?>' class='<?echo $style?>' onclick=\"<?echo $cmd ?>\">\n<?\n\t\t\tif (isset($this->value) && $this->value !== \"\")\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\" <? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n?>\n\t\t<?echo $title?></div>\n\t\t<div id='<?echo $this->id?>_contents' style='padding-left: <?echo $_activeTree->indent ?>; display: <? echo $display?>'>\n\t\t\t\n<?\t\t\t\n\t\t\tfor($i = 0; $i < $c; ++$i)\n\t\t\t{\n\t\t\t\t$this->children[$i]->writeHTML();\n\t\t\t}\n?>\n\t\t</div>\n<?\n\t\t}\n\t}", "private function write_csv($array)\n {\n if (is_writable($this->filename)) \n {\n $handle = fopen($this->filename, \"w\");\n foreach($array as $entries) \n {\n fputcsv($handle, $entries);\n }\n fclose($handle);\n }\n }", "public function addNewSheet();", "public function saveActiveSheetChanges() {\n\n $file = $this->getExtractedFile();\n\n $file->addFromString( $this->activeSheet->sheet->attributes->path, $this->activeSheet->sheet->contents->asXML() );\n }", "private function _getHtmlTree($tree)\n {\n //obudowujemy sztucznym rootem\n $html = '<ul><li id=\"0\" data-jstree=\\'{\"type\":\"root\", \"opened\":true, \"selected\":false}\\'>' . self::ROOT;\n $html = $this->_generateTree(['children' => $tree], $html);\n $html .= '</li></ul>';\n return $html;\n }", "function build_tree($pages){\n\t\tforeach ($pages as $page){\n\t\t\t$this->add_node($page);\n\t\t}\n\t\t$this->add_children();\n\t\n\t}", "function _splurgh_do_node($map,$node,$chain,&$fulltable,$nest)\n{\n\t$fulltable[$node]=1;\n\n\t$title=$map[$node]['title'];\n\t$children=$map[$node]['children'];\n\n\t$out=strval($node).'!'.str_replace('[','&#91;',str_replace(']','&#93;',str_replace(',','&#44;',$title))).',';\n\tif (count($children)>0)\n\t{\n\t\t$out.='[';\n\t\tforeach ($children as $child)\n\t\t{\n\t\t\tif ((!array_key_exists($child,$fulltable)) && (array_key_exists($child,$map)))\n\t\t\t\t$out.=_splurgh_do_node($map,$child,$chain.strval($node).'~',$fulltable,$nest+1);\n\t\t}\n\t\t$out.='],';\n\t}\n\n\treturn $out;\n}", "function attendance_exporttotableed($data, $filename, $format) {\n global $CFG;\n\n if ($format === 'excel') {\n require_once(\"$CFG->libdir/excellib.class.php\");\n $filename .= \".xls\";\n $workbook = new MoodleExcelWorkbook(\"-\");\n } else {\n require_once(\"$CFG->libdir/odslib.class.php\");\n $filename .= \".ods\";\n $workbook = new MoodleODSWorkbook(\"-\");\n }\n // Sending HTTP headers.\n $workbook->send($filename);\n // Creating the first worksheet.\n $myxls = $workbook->add_worksheet(get_string('modulenameplural', 'attendance'));\n // Format types.\n $formatbc = $workbook->add_format();\n $formatbc->set_bold(1);\n\n $myxls->write(0, 0, get_string('course'), $formatbc);\n $myxls->write(0, 1, $data->course);\n $myxls->write(1, 0, get_string('group'), $formatbc);\n $myxls->write(1, 1, $data->group);\n\n $i = 3;\n $j = 0;\n foreach ($data->tabhead as $cell) {\n // Merge cells if the heading would be empty (remarks column).\n if (empty($cell)) {\n $myxls->merge_cells($i, $j - 1, $i, $j);\n } else {\n $myxls->write($i, $j, $cell, $formatbc);\n }\n $j++;\n }\n $i++;\n $j = 0;\n foreach ($data->table as $row) {\n foreach ($row as $cell) {\n $myxls->write($i, $j++, $cell);\n }\n $i++;\n $j = 0;\n }\n $workbook->close();\n}", "function tree2sql() {\n\t\t$table = $this->packageInfo['table'];\n\t\twhile(list($tableNum,$tableData) = @each($table)) {\n\t\t\tunset($sql);\n\t\t\t$cols = $tableData['column'];\n\t\t\t$thistablename = $tableData['attributes']['name'];\n\t\t\twhile(list($colNum,$col) = @each($cols)) {\n\t\t\t\t$_string = \"\";\n\t\t\t\t$len = \"\";\n\t\t\t\textract($col);\n\t\t\t\t$_string .= \"$field $type \";\n\t\t\t\tif ($len) { $_string .= \"($len) \"; }\n\t\t\t\tif ($null) { $_string .=\" NULL \"; } else { $_string .= \" NOT NULL \"; }\n\t\t\t\t$_string .= \" default '$default' \";\n\t\t\t\tif ($extra) { $_string .= \" $extra \"; }\n\t\t\t\t$sql[] = $_string;\n\t\t\t}\n\t\t\t$idx = $tableData['indexes'];\n\t\t\t$col = \"\";\n\t\t\twhile(list($num,$indx) = @each($idx)) {\n\t\t\t\twhile(list($numpos,$cols) = each($indx['index'])) {\n\t\t\t\t\textract($indx['attributes'][$numpos]);\n\t\t\t\t\t$col[$name]= @implode(\",\",$cols['columns']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sqlindex = \"\";\n\t\t\t$sqlindexes = \"\";\n\t\t\twhile(list($key,$val) = @each($col)) {\n\t\t\t\tif (strtoupper($key)=='PRIMARY') { $key = \" PRIMARY KEY \"; } else { $key = \" KEY $key \"; }\n\t\t\t\t$sqlindex[] = \"$key ($val)\";\n\t\t\t}\n\t\t\t$sqlindexes = @implode(\",\",$sqlindex);\n\t\t\tif ($sqlindexes) { $sqlindexes =\" , $sqlindexes\"; }\n\t\t\t$finalsql[] = \"drop table if exists $thistablename\";\n\t\t\t$finalsql[] = \" create table $thistablename ( \".@implode(\",\",$sql).\" $sqlindexes ) \";\n\n\t\t\t$rows = $tableData['data'][$tableNum]['row'];\n\t\t\twhile(list($rownum,$rowdata) = @each($rows)) { \n\t\t\t\t$keys = \"\";\n\t\t\t\t$vals = \"\";\n\t\t\t\twhile(list($k,$v) = each($rowdata)) { \n\t\t\t\t\t$keys[]=$k;\n\t\t\t\t\t$vals[]=$v;\n\t\t\t\t}\n\t\t\t\t$datasql[] = \"insert into $thistablename (\".implode(\",\",$keys).\") values ('\".implode(\"','\",$vals).\"')\";\n\t\t\t}\n\t\t}\n\t\t$this->datasql = $datasql;\n\t\t$this->sql = $finalsql;\n\t\treturn $finalsql;\n\t}", "function BuildRecursiveTree(&$data, $node_id, &$xmlWriter){\n for ($i=0; $i<count($data);$i++){\n if (is_array($data[$i])) {\n if($data[$i][$this->parent_field_name] == $node_id){\n // drawing node\n $xmlWriter->WriteStartElement(\"node\");\n $xmlWriter->WriteAttributeString(\"id\", $data[$i][$this->key_field_name]);\n $xmlWriter->WriteElementString(\"caption\", addslashes($data[$i][$this->caption_field_name]));\n $xmlWriter->WriteElementString(\"url\", $data[$i][$this->url_name]);\n // drawing sub-nodes\n $xmlWriter->WriteStartElement(\"sub_node_list\");\n $this->BuildRecursiveTree($data, $data[$i][$this->key_field_name], $xmlWriter);\n $xmlWriter->WriteEndElement();\n $xmlWriter->WriteEndElement();\n\n }\n }\n }\n }", "function _lock_tree_table()\n\t{\n\t\tee()->db->query(\"LOCK TABLE \" .$this->tree_table . \" WRITE\");\n\t}", "public function export_data_anggota_keluarga()\n {\n $spreadsheet = new Spreadsheet();\n $currentData = $this->AnggotaKeluargaModel->findAll();\n // tulis header/nama kolom \n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A1', 'No. KK')\n ->setCellValue('B1', 'No. KTP')\n ->setCellValue('C1', 'Nama')\n ->setCellValue('D1', 'Tempat Lahir')\n ->setCellValue('E1', 'Tanggal Lahir')\n ->setCellValue('F1', 'Jenis Kelamin')\n ->setCellValue('G1', 'Status Perkawinan')\n ->setCellValue('H1', 'Pendidikan')\n ->setCellValue('I1', 'Pekerjaan')\n ->setCellValue('J1', 'Catatan');\n\n $column = 2;\n // tulis data mobil ke cell\n foreach ($currentData as $data) {\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A' . $column, $data['noKK'])\n ->setCellValue('B' . $column, $data['noKTP'])\n ->setCellValue('C' . $column, $data['nama'])\n ->setCellValue('D' . $column, $data['tempatLahir'])\n ->setCellValue('E' . $column, $data['tanggalLahir'])\n ->setCellValue('F' . $column, $data['jenisKelamin'])\n ->setCellValue('G' . $column, $data['statusPerkawinan'])\n ->setCellValue('H' . $column, $data['pendidikan'])\n ->setCellValue('I' . $column, $data['pekerjaan'])\n ->setCellValue('J' . $column, $data['catatan']);\n $column++;\n }\n // tulis dalam format .xlsx\n $writer = new Xlsx($spreadsheet);\n $fileName = 'Data Anggota Keluarga';\n\n // Redirect hasil generate xlsx ke web client\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=' . $fileName . '.xlsx');\n header('Cache-Control: max-age=0');\n\n $writer->save('php://output');\n }", "function save_layout_xml($sxe) {\n\t\n\tif (empty($_POST['page_title']))\n $_POST['page_title'] = \"\";\n if (empty($_POST['cs_layout']))\n $_POST['cs_layout'] = \"\";\n if (empty($_POST['cs_sidebar_left']))\n $_POST['cs_sidebar_left'] = \"\";\n if (empty($_POST['cs_sidebar_right']))\n $_POST['cs_sidebar_right'] = \"\";\n\t$sxe->addChild('page_title', $_POST['page_title']);\n\t$sidebar_layout = $sxe->addChild('sidebar_layout');\n\t\t$sidebar_layout->addChild('cs_layout', $_POST[\"cs_layout\"]);\n\t\tif ($_POST[\"cs_layout\"] == \"left\") {\n\t\t\t$sidebar_layout->addChild('cs_sidebar_left', $_POST['cs_sidebar_left']);\n\t\t} else if ($_POST[\"cs_layout\"] == \"right\") {\n\t\t\t$sidebar_layout->addChild('cs_sidebar_right', $_POST['cs_sidebar_right']);\n\t\t}else if ($_POST[\"cs_layout\"] == \"both_right\" or $_POST[\"cs_layout\"] == \"both_left\" or $_POST[\"cs_layout\"] == \"both\") {\n\t\t\t$sidebar_layout->addChild('cs_sidebar_left', $_POST['cs_sidebar_left']);\n\t\t\t$sidebar_layout->addChild('cs_sidebar_right', $_POST['cs_sidebar_right']);\n\t\t}\n return $sxe;\n}", "function print_tree(tree $t, $with_id=false) {\n // $root = tree_to_treenode($t);\n print_treenode($t, null, 0, $with_id);\n}", "function createSpreadsheet(){\n\t\t\n\t\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', TRUE);\n\t\tini_set('display_startup_errors', TRUE);\n\t\n\t\tdefine('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');\n\t\n\t\t/** Include PHPExcel */\n\t\t//require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';\n\t\t\n\t\trequire_once $GLOBALS['ROOT_PATH'].'Classes/PHPExcel.php';\n\t\n\t\n\t\tPHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() );\n\t\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = new PHPExcel();\n\t\t$currentMonth = date('Y-m');\n\t\t$title = $this->getHhName() . ' ' . $currentMonth;\n\t\t\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"HhManagement\")\n\t\t->setLastModifiedBy(\"HhManagement\")\n\t\t->setTitle($title)\n\t\t->setSubject($currentMonth);\n\t\n\t\t//default styles\n\t\t$objPHPExcel->getDefaultStyle()->getFont()->setName('Calibri');\n\t\t$objPHPExcel->getDefaultStyle()->getFont()->setSize(12);\n\t\n\t\n\t\t//styles....\n\t\n\t\t//fonts\n\t\t//font red bold italic centered\n\t\t$fontRedBoldItalicCenter = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'alignment' => array (\n\t\t\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font red bold\n\t\t$fontRedBold = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font red\n\t\t$fontRed = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Green\n\t\t$fontGreen = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => '0008B448',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Bold Italic\n\t\t$fontBoldItalic = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Bold Italic Centered\n\t\t$fontBoldItalicCenter = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t),\n\t\t\t\t'alignment' => array (\n\t\t\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n\t\t\t\t)\n\t\t);\n\t\n\t\t//background fillings\n\t\t//fill red\n\t\t$fillRed = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill yellow\n\t\t$fillYellow = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF2E500',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill green\n\t\t$fillGreen = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FF92D050',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill gray\n\t\t$fillGray = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFD9D9D9',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill cream\n\t\t$fillCream = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFC4BD97',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//sets the heading for the first table\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B1','Equal AMT');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C1','Ind. bills');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D1','To rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D1')->applyFromArray($fillCream);\n\t\n\t\t$numberOfMembers = $this->getNumberOfMembers();\n\t\t$monthTotal = $this->getMonthTotal();\n\t\t$rent = $this->getHhRent();\n\t\t$col = 65;//starts at column A\n\t\t$row = 2;//the table starts at row 2\n\t\n\t\t//array used to associate the bills with the respective user\n\t\t$array =[];\n\t\n\t\t//sets the members names fair amount and value\n\t\t$members = $this->getMembers();\n\t\tforeach ($members as $member) {\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$cellName = chr($col) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellName,$name);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellName)->applyFromArray($fontBoldItalic);\n\t\n\t\t\t$cellInd = chr($col+2) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellInd,'0.0');\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->applyFromArray($fillRed);\n\t\n\t\t\t$cellFair = chr($col+1) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->applyFromArray($fontRed);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->applyFromArray($fillGray);\n\t\n\t\t\t$cellRent = chr($col+3) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellRent,'=SUM('. $cellFair .'-'. $cellInd .')');\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellRent)->applyFromArray($fontGreen);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellRent)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->applyFromArray($fillYellow);\n\t\n\t\t\t$array[$name]['cell'] = $cellInd;\n\t\t\t$row++;\n\t\t}\n\t\n\t\t//inserts the sum of the fair amounts to compare to the one below\n\t\t$endCell = chr($col+1) . ($row-1);\n\t\t$cell = chr($col+1) . $row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM(B2:'.$endCell.')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRed);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\n\t\t//insert the rent check values\n\t\t$cell = chr($col+2) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalic);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\t$cell = chr($col+3) . $row;\n\t\t$endCell = chr($col+3) .($row-1);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM(D2:'.$endCell.')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBold);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\n\t\t//inserts the bill and amount labels\n\t\t$row += 2;\n\t\t$cellMergeEnd = chr($col+1) . $row;\n\t\t$cell = chr($col) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'House bills');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->mergeCells($cell.':'.$cellMergeEnd);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillRed);\n\t\n\t\t$cell = chr($col) . $row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Bill');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGreen);\n\t\n\t\t$cell = chr($col+1) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Amount');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGreen);\n\t\n\t\n\t\t//inserts the bills\n\t\t$startCell = chr($col+1) . $row;\n\t\tforeach ($members as $member) {\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$col = 65;\n\t\t\t$bills = $member->getBills();\n\t\t\t$array[$name]['bills'] = [];\n\t\t\tforeach ($bills as $bill) {\n\t\t\t\t$desc = $bill->getBillDescription();\n\t\t\t\t$amount = $bill->getBillAmount();\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue(chr($col) . $row,$desc);\n\t\t\t\t$amountCell = chr($col+1) . $row++;\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($amountCell,$amount);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle($amountCell)->getNumberFormat()\n\t\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t\tarray_push($array[$name]['bills'], $amountCell);\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\t$col = 65;\n\t\n\t\t//inserts rent\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\n\t\t$cell = chr($col+1) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,$rent);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\t$endCell = chr($col+1) . ($row-1);\n\t\n\t\t//inserts the total of bills\n\t\t$col = 65;\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Total H-B');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillCream);\n\t\n\t\t$cell = chr($col+1) .$row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell, '=SUM('. $startCell .':'. $endCell .')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillCream);\n\t\n\t\t//inserts the fair amount\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Fair Amount if ' . $numberOfMembers);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\t$cell = chr($col+1) .$row;\n\t\t$objPHPExcel->getActiveSheet()\n\t\t->setCellValue($cell,'='. chr($col+1) .($row-1) . '/' . $numberOfMembers);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\t$fairAmountCell = chr($col+1) . $row;\n\t\n\t\t$row = 2;\n\t\tforeach ($members as $member) {\n\t\t\t$col = 66;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue(chr($col) . $row++,'='. $fairAmountCell);\n\t\t}\n\t\n\t\t//inserts the individual bills\n\t\tforeach ($array as $value){\n\t\t\t$cell = $value['cell'];\n\t\t\t$sumOfBills = '';\n\t\t\t\t\n\t\t\tif (isset($value['bills'])) {\n\t\t\t\t$bills = $value['bills'];\n\t\t\t\t$counter = 1;\n\t\t\t\tforeach ($bills as $bill){\n\t\t\t\t\tif ($counter == 1){\n\t\t\t\t\t\t$sumOfBills .= $bill;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sumOfBills .= '+' . $bill;\n\t\t\t\t\t}\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM('. $sumOfBills . ')');\n\t\t}\n\t\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);\n\t\n\t\t// Rename worksheet\n\t\t$objPHPExcel->getActiveSheet()->setTitle($title);\n\t\n\t\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->setPreCalculateFormulas(true);\n\t\t//$objWriter->save(str_replace('.php', '.xlsx', __FILE__));\n\t\t$objWriter->save(str_replace('.php', '.xlsx', $GLOBALS['ROOT_PATH']. 'spreadsheets/'. $title .'.php'));\n\t\n\t\treturn $title . '.xlsx';\n\t}", "public function unique_folder_tree( $tree ) {\n\n\t\tfor ( $i = 0; $i < count( $tree ); $i ++ ) {\n\n\t\t\t$duplicate = null;\n\n\t\t\tfor ( $ii = $i + 1; $ii < count( $tree ); $ii ++ ) {\n\t\t\t\tif ( strcmp( $tree[ $ii ]['id'], $tree[ $i ]['id'] ) === 0 ) {\n\t\t\t\t\t$duplicate = $ii;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! is_null( $duplicate ) ) {\n\t\t\t\tarray_splice( $tree, $duplicate, 1 );\n\t\t\t}\n\n\t\t}\n\n\t\treturn $tree;\n\n\t}", "function Save($xml_root, $file_path) \n\t{\n\t\t$this->__xml = fopen($file_path, \"w\");\n\t\tfwrite($this->__xml, \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\r\\n\");\n\t\t$this->__SaveChild($xml_root, 0);\n\t\tfclose($this->__xml);\n\t}", "public function report_data_user($kode_role)\n{\nif($kode_role != 'ALL'){\n$user = $this->Muser->report_data_userbyrole($kode_role);\n}else{\n$user = $this->Muser->report_data_user();\n}\n// Create new Spreadsheet object\n$spreadsheet = new Spreadsheet();\n\n//auto width cell\nforeach(range('A','H') as $columnID) {\n $spreadsheet->getActiveSheet()->getColumnDimension($columnID)\n ->setAutoSize(true);\n}\n\n// Set document properties\n$spreadsheet->getProperties()->setCreator('STMIK BANDUNG')\n->setLastModifiedBy('STMIK BANDUNG')\n->setTitle('Office 2007 XLSX Test Document')\n->setSubject('Office 2007 XLSX Test Document')\n->setDescription('Test document for Office 2007 XLSX, generated using PHP classes.')\n->setKeywords('office 2007 openxml php')\n->setCategory('result file');\n\n// Add some data\n$spreadsheet->setActiveSheetIndex(0)\n->setCellValue('A1', 'NO')\n->setCellValue('B1', 'NIDN')\n->setCellValue('C1', 'NAMA')\n->setCellValue('D1', 'EMAIL')\n->setCellValue('E1', 'PRODI')\n->setCellValue('F1', 'NO TELEPON')\n->setCellValue('G1', 'JENIS KELAMIN')\n->setCellValue('H1', 'HAK AKSES')\n\n;\n\n// Miscellaneous glyphs, UTF-8\n$i=2; $no=1; foreach($user as $data) {\n\n$spreadsheet->setActiveSheetIndex(0)\n->setCellValue('A'.$i, $no)\n->setCellValue('B'.$i, $data->nidn)\n->setCellValue('C'.$i, $data->name)\n->setCellValue('D'.$i, $data->email)\n->setCellValue('E'.$i, $data->prodi)\n->setCellValue('F'.$i, $data->no_telp)\n->setCellValue('G'.$i, $data->gender)\n->setCellValue('H'.$i, $data->role)\n\n;\n$i++;\n$no++;\n}\n\n\n// Rename worksheet\n$spreadsheet->getActiveSheet()->setTitle('Report Data User '.date('d-m-Y H'));\n\n// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n$spreadsheet->setActiveSheetIndex(0);\n\n// Redirect output to a client’s web browser (Xlsx)\nheader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\nheader('Content-Disposition: attachment;filename=\"Report Data User.xlsx\"');\nheader('Cache-Control: max-age=0');\n// If you're serving to IE 9, then the following may be needed\nheader('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\nheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\nheader('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\nheader('Cache-Control: cache, must-revalidate'); // HTTP/1.1\nheader('Pragma: public'); // HTTP/1.0\n\n$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n$writer->save('php://output');\nexit;\n}", "private function writeGuts(): void\n {\n $record = 0x0080; // Record identifier\n $length = 0x0008; // Bytes to follow\n\n $dxRwGut = 0x0000; // Size of row gutter\n $dxColGut = 0x0000; // Size of col gutter\n\n // determine maximum row outline level\n $maxRowOutlineLevel = 0;\n foreach ($this->phpSheet->getRowDimensions() as $rowDimension) {\n $maxRowOutlineLevel = max($maxRowOutlineLevel, $rowDimension->getOutlineLevel());\n }\n\n $col_level = 0;\n\n // Calculate the maximum column outline level. The equivalent calculation\n // for the row outline level is carried out in writeRow().\n $colcount = count($this->columnInfo);\n for ($i = 0; $i < $colcount; ++$i) {\n $col_level = max($this->columnInfo[$i][5], $col_level);\n }\n\n // Set the limits for the outline levels (0 <= x <= 7).\n $col_level = max(0, min($col_level, 7));\n\n // The displayed level is one greater than the max outline levels\n if ($maxRowOutlineLevel) {\n ++$maxRowOutlineLevel;\n }\n if ($col_level) {\n ++$col_level;\n }\n\n $header = pack('vv', $record, $length);\n $data = pack('vvvv', $dxRwGut, $dxColGut, $maxRowOutlineLevel, $col_level);\n\n $this->append($header . $data);\n }", "public function reactSortableTreeSave($data)\n {\n\n $json = json_decode($data, true);\n $data = $json['treeData'];\n $currentId = $json['currentId'];\n $found = false;\n $counter = 0;\n $str = '';\n $this->reactSortableTreeJsonSave($data, 1, $currentId, $str, $counter, $found);\n\n if ($found === false) $currentId = 0; //happens when several pages are deleted including the currentPage;\n $numBytes = @file_put_contents($this->mpFileName, \"MeMpAd.\" . ($currentId) . \"\\0\\0\" . $str);\n if ($numBytes === false) {\n return json_encode([\"status\" => \"error\", \"message\" => \"could not saved data\"]);\n }\n return json_encode([\"status\" => \"ok\", \"message\" => \"Data Saved\"]);\n }", "function master_xml_export()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\n\t\t$entry = array();\n\n\t\t//-----------------------------------------\n\t\t// Get XML class\n\t\t//-----------------------------------------\n\n\t\trequire_once( KERNEL_PATH.'class_xml.php' );\n\n\t\t$xml = new class_xml();\n\n\t\t$xml->doc_type = $this->ipsclass->vars['gb_char_set'];\n\n\t\t$xml->xml_set_root( 'export', array( 'exported' => time() ) );\n\n\t\t//-----------------------------------------\n\t\t// Set group\n\t\t//-----------------------------------------\n\n\t\t$xml->xml_add_group( 'group' );\n\n\t\t//-----------------------------------------\n\t\t// Get templates...\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'groups',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'g_id ASC',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'limit' => array( 0, 6 ) ) );\n\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$content = array();\n\n\t\t\t$r['g_icon'] = '';\n\n\t\t\t//-----------------------------------------\n\t\t\t// Sort the fields...\n\t\t\t//-----------------------------------------\n\n\t\t\tforeach( $r as $k => $v )\n\t\t\t{\n\t\t\t\t$content[] = $xml->xml_build_simple_tag( $k, $v );\n\t\t\t}\n\n\t\t\t$entry[] = $xml->xml_build_entry( 'row', $content );\n\t\t}\n\n\t\t$xml->xml_add_entry_to_group( 'group', $entry );\n\n\t\t$xml->xml_format_document();\n\n\t\t$doc = $xml->xml_document;\n\n\t\t//-----------------------------------------\n\t\t// Print to browser\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->admin->show_download( $doc, 'groups.xml', '', 0 );\n\t}", "public function exportLeavesReport() {\n $this->auth->checkIfOperationIsAllowed('native_report_leaves');\n $this->lang->load('leaves', $this->language);\n $this->load->model('organization_model');\n $this->load->model('leaves_model');\n $this->load->model('types_model');\n $this->load->model('dayoffs_model');\n $this->load->library('excel');\n $data['refDate'] = date(\"Y-m-d\");\n if (isset($_GET['refDate']) && $_GET['refDate'] != NULL) {\n $data['refDate'] = date(\"Y-m-d\", $_GET['refDate']);\n }\n $data['include_children'] = filter_var($_GET['children'], FILTER_VALIDATE_BOOLEAN);\n $this->load->view('reports/leaves/export', $data);\n }", "function arrayToXML($array,$node_name,$doc)\n{\n $root = $doc->createElement($node_name);\n $root = $doc->appendChild($root);\n\n foreach($array as $key=>$value)\n {\n if (is_array($value)){\n\n $root->appendChild(arrayToXML($value,$key,$doc));\n }\n else {\n $em = $doc->createElement($key);\n $text = $doc->createTextNode($value);\n $em->appendChild($text);\n $root->appendChild($em);\n\n }\n\n }\n return $root;\n}", "private function createTree() {\n\t\t$html = $this->getSpec();\n\t\t$html .= '<div class=\"tal_clear\"></div>';\n\t\t$html .= $this->getSkills();\n\n\t\treturn $html;\n\t}", "abstract protected function _write();", "public function writeOutDefinitions()\n {\n $handle = fopen($this->filename, 'w');\n fwrite($handle, $this->__toString());\n fclose($handle);\n }", "public function basic3(){\n $spreadsheet = new Spreadsheet();\n\n// Set document properties\n $spreadsheet->getProperties()->setCreator('Maarten Balliauw')\n ->setLastModifiedBy('Maarten Balliauw')\n ->setTitle('PDF Test Document')\n ->setSubject('PDF Test Document')\n ->setDescription('Test document for PDF, generated using PHP classes.')\n ->setKeywords('pdf php')\n ->setCategory('Test result file');\n\n// Add some data\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A1', 'Hello')\n ->setCellValue('B2', 'world!')\n ->setCellValue('C1', 'Hello')\n ->setCellValue('D2', 'world!');\n\n// Miscellaneous glyphs, UTF-8\n $spreadsheet->setActiveSheetIndex(0)\n ->setCellValue('A4', 'Miscellaneous glyphs')\n ->setCellValue('A5', 'éàèùâêîôûëïüÿäöüç');\n\n// Rename worksheet\n $spreadsheet->getActiveSheet()->setTitle('Simple');\n $spreadsheet->getActiveSheet()->setShowGridLines(false);\n\n// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n $spreadsheet->setActiveSheetIndex(0);\n\n IOFactory::registerWriter('Pdf', Mpdf::class);\n\n// Redirect output to a client’s web browser (PDF)\n // Redirect output to a client’s web browser (Ods)\n header('Content-Type: application/pdf');\n header('Content-Disposition: attachment;filename=\"01simple.pdf\"');\n header('Cache-Control: max-age=0');\n// If you're serving to IE 9, then the following may be needed\n header('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n header('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header('Pragma: public'); // HTTP/1.0\n\n $writer = IOFactory::createWriter($spreadsheet, 'xlsx');\n $writer->save('php://output');\n exit;\n\n\n }", "private function writeSelection(): void\n {\n // look up the selected cell range\n $selectedCells = Coordinate::splitRange($this->phpSheet->getSelectedCells());\n $selectedCells = $selectedCells[0];\n if (count($selectedCells) == 2) {\n [$first, $last] = $selectedCells;\n } else {\n $first = $selectedCells[0];\n $last = $selectedCells[0];\n }\n\n [$colFirst, $rwFirst] = Coordinate::coordinateFromString($first);\n $colFirst = Coordinate::columnIndexFromString($colFirst) - 1; // base 0 column index\n --$rwFirst; // base 0 row index\n\n [$colLast, $rwLast] = Coordinate::coordinateFromString($last);\n $colLast = Coordinate::columnIndexFromString($colLast) - 1; // base 0 column index\n --$rwLast; // base 0 row index\n\n // make sure we are not out of bounds\n $colFirst = min($colFirst, 255);\n $colLast = min($colLast, 255);\n\n $rwFirst = min($rwFirst, 65535);\n $rwLast = min($rwLast, 65535);\n\n $record = 0x001D; // Record identifier\n $length = 0x000F; // Number of bytes to follow\n\n $pnn = $this->activePane; // Pane position\n $rwAct = $rwFirst; // Active row\n $colAct = $colFirst; // Active column\n $irefAct = 0; // Active cell ref\n $cref = 1; // Number of refs\n\n // Swap last row/col for first row/col as necessary\n if ($rwFirst > $rwLast) {\n [$rwFirst, $rwLast] = [$rwLast, $rwFirst];\n }\n\n if ($colFirst > $colLast) {\n [$colFirst, $colLast] = [$colLast, $colFirst];\n }\n\n $header = pack('vv', $record, $length);\n $data = pack('CvvvvvvCC', $pnn, $rwAct, $colAct, $irefAct, $cref, $rwFirst, $rwLast, $colFirst, $colLast);\n $this->append($header . $data);\n }", "public function export_excel()\n\t{\n\t$data = array(\n array ('Name', 'Surname'),\n array('Schwarz', 'Oliver'),\n array('Test', 'Peter')\n );\n\t\t\n\t\t//$data = $this->db->get('test')->result_array();\n\t\t$this->load->library('Excel-Generation/excel_xml');\n\t\t$this->excel_xml->addArray($data);\n\t\t$this->excel_xml->generateXML('my-test');\n\t}", "function saveGroupWorksheet($worksheetDetails, $grade_boundaries, $userid, $worksheet_inputs, $worksheet_tags) {\n try{\n $gwid = $worksheetDetails[\"gwid\"];\n $staff1 = (!$worksheetDetails[\"staff1\"] || $worksheetDetails[\"staff1\"] == \"0\") ? $userid : $worksheetDetails[\"staff1\"];\n $staff2 = (!$worksheetDetails[\"staff2\"] || $worksheetDetails[\"staff2\"] == \"0\") ? \"null\" : $worksheetDetails[\"staff2\"];\n $staff3 = (!$worksheetDetails[\"staff3\"] || $worksheetDetails[\"staff3\"] == \"0\") ? \"null\" : $worksheetDetails[\"staff3\"];\n $datedue = $worksheetDetails[\"dateDueMain\"];\n $stuNotes = array_key_exists(\"studentNotes\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"studentNotes\"]) : \"\";\n //$staffNotes = array_key_exists(\"staffNotes\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"staffNotes\"]) : \"\";\n $displayName = array_key_exists(\"displayName\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"displayName\"]) : \"\";\n $hidden = $worksheetDetails[\"hide\"] == \"true\" ? \"0\" : \"1\";\n $student_input = $worksheetDetails[\"student\"] == \"true\" ? \"1\" : \"0\";\n $enter_totals = $worksheetDetails[\"enter_totals\"] == \"true\" ? \"1\" : \"0\";\n\n $query = \"UPDATE TGROUPWORKSHEETS SET `Primary Staff ID` = $staff1, `Additional Staff ID` = $staff2, `Additional Staff ID 2` = $staff3, \"\n . \"`Date Due` = STR_TO_DATE('$datedue', '%d/%m/%Y'), `Additional Notes Student` = '$stuNotes', `DisplayName` = '$displayName' \"\n . \",`Hidden` = $hidden, `StudentInput` = $student_input, `Date Last Modified` = NOW() , `EnterTotals` = $enter_totals \"\n . \"WHERE `Group Worksheet ID` = $gwid;\";\n\n db_query_exception($query);\n updateGradeBoundaries($grade_boundaries, $gwid);\n updateWorksheetTags($worksheet_tags, $gwid);\n updateWorksheetInputs($worksheet_inputs, $gwid);\n } catch (Exception $ex) {\n $message = \"There was an error saving the details for the worksheet.\";\n log_error($message . \" Exception: \" . $ex->getMessage(), \"requests/setWorksheetResult.php\", __LINE__);\n $array = array(\n \"result\" => FALSE,\n \"message\" => $message\n );\n echo json_encode($array);\n exit();\n }\n $response = array(\"result\" => TRUE);\n echo json_encode($response);\n exit();\n}", "public function save(array $data)\n {\n $row = $this->select()\n ->where('path = ?', $data['path'])\n ->fetchRow();\n\n if (!$row) {\n $row = $this->createRow();\n } \n $row->setFromArray($data);\n \n $row->lvl = count(explode('/', $row->path));\n \n if ($row->lvl <= 2) {\n $row->type = '';\n }\n \n $row->save();\n \n return $row;\n }", "function createPages($pathToFolder, $pathToXML){\n $handle = fopen($pathToXML, 'r');\n $data = file_get_contents($pathToXML);\n $data = str_replace(' ', '', $data);\n $data = str_replace('<', '[', $data);\n $data = str_replace('>', ']', $data);\n file_put_contents($pathToXML, $data);\n $i=0;\n if ($handle)\n {\n //initializing all the variables needed to create the page and to keep in memory the strings of the old and new titles.\n $title;\n $oldTitle;\n $belongsTo=\"\";\n $contains=\"\";\n $content=\"\";\n $currentType=\"\";\n $titleLang=\"\";\n $fileOrga;\n while (!feof($handle)){\n $buffer = fgets($handle);\n \n if(!isset($fileOrga)){\n $temp = $this->checkFileOrganisation($buffer);\n if($temp!='continue'){\n $fileOrga=$temp;\n }\n }\n\n if(isset($fileOrga)){\n if($fileOrga==\"rdfWNames\"){ \n $currentType = $this->checktype($buffer);\n if($currentType=='title'){\n if(!isset($title))$title=$this->get_string_between($buffer, '#', '\"');\n if($title!=$this->get_string_between($buffer, '#', '\"')){\n $pageArray = array(0=>$title, 1=>$content, 2=>$belongsTo); \n $this->createPage($pathToFolder, $pageArray);\n $content=\"\";\n $belongsTo=\"\"; \n $title=$this->get_string_between($buffer, '#', '\"');\n }\n }\n\n if($currentType=='content'){\n $content=$content.\" contient \".$this->get_string_between($buffer, ']', '[/');\n }\n\n if($currentType=='belongsTo'){\n if($_SESSION['viki']===\"true\"){\n $belongsTo=$belongsTo.\" is a subclass from \".$_SESSION['url'].str_replace(' ', '', $this->get_string_between($buffer, '#', '\"'));\n }\n else{\n $belongsTo=$belongsTo.\" is a subclass from \".$this->get_string_between($buffer, '#', '\"');\n }\n }\n }\n \n if($fileOrga==\"rdfWONames\"){\n $currentType = $this->checktype($buffer);\n if(!$currentType!='continue'){\n if($currentType=='eoc'){\n $pageArray = array(0=>$title, 1=>$content, 2=>$belongsTo); \n $this->createPage($pathToFolder, $pageArray);\n $content=\"\";\n $belongsTo=\"\";\n $title=\"\"; \n $titleLang=\"\";\n }\n if($currentType=='title'){\n if($titleLang==\"en\" || $titleLang==\"\"){\n if(strpos($buffer, '\"fr\"')){\n $titleLang=\"fr\";\n }else{\n $titleLang==\"en\";\n }\n $title=$this->get_string_between($buffer, ']', '[/');\n }\n }\n if($currentType=='content' && !strpos(str_replace(\":\", \"\", $buffer), \"rdfresource\")){\n $content=$content.$this->get_string_between($buffer, ']', '[/').\"\\n\";\n }\n\n if($currentType=='belongsTo'){\n $belongsToTitle=$this->checkIfSubclassIsInFile($pathToXML, $this->get_string_between($buffer, '=\"', '\"/'));\n if($belongsToTitle!='fail'){\n if($_SESSION['viki']===\"true\"){\n $belongsTo=$belongsTo.\" is a subclass from\".$_SESSION['url'].str_replace(' ', '', $belongsToTitle);\n }\n else\n $belongsTo=$belongsTo.\" is a subclass from \".$belongsToTitle.\"\\n\";\n }\n if($belongsToTitle==\"fail\"){\n $tmp = $this->get_string_between($buffer, '=\"', '\"/');\n $belongsTo=$belongsTo.\" is a subclass from \".$tmp.\"\\n\";\n }\n }\n }\n }\n }\n }\n fclose($handle);\n } \n }", "protected function store()\n\t{\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\n\t\t//throw new Exception(\"Not yet implemented!\");\n\t\t\t\t//---------------------\n\n $domDoc = new DOMDocument;\n $rootElt = $domDoc->createElement('items');\n $rootNode = $domDoc->appendChild($rootElt);\n\n foreach($this->_data AS $row) {\n $rowElement = $domDoc->createElement('item');\n\n foreach($row AS $key => $value) {\n\n $element = $domDoc->createElement($key);\n $element->appendChild($domDoc->createTextNode($value));\n\n $rowElement->appendChild($element);\n }\n $rootNode->appendChild($rowElement);\n\n }\n\n $data = $domDoc->saveXML();\n\n //var_dump($data);\n\n file_put_contents($this->_origin, $data);\n\n\t\t// --------------------\n\t}", "function ooffice_write_competence( $competence ) {\r\n global $odt;\r\n \t\t if ($competence){\r\n $code = $competence->code_competence;\r\n $description_competence = $competence->description_competence;\r\n $ref_domaine = $competence->ref_domaine;\r\n $num_competence = $competence->num_competence;\r\n\t\t\t $nb_item_competences = $competence->nb_item_competences;\r\n $odt->SetFont('Arial','B',10); \r\n\t \t $odt->Write(0,recode_utf8_vers_latin1(trim(get_string('competence','referentiel').\" : \".stripslashes($code))));\r\n $odt->Ln(1);\r\n $odt->SetFont('Arial','',10); \r\n $odt->Write(0, recode_utf8_vers_latin1(trim(stripslashes($description_competence))));\r\n\t \t \t$odt->Ln(1);\r\n\t\t\t $odt->Ln(1);\r\n\t\t\t // ITEM\r\n\t\t\t $records_items = referentiel_get_item_competences($competence->id);\r\n if ($records_items){\t\t\t\t \r\n \t $odt->SetFont('Arial','B',10); \r\n\t $odt->Write(0,recode_utf8_vers_latin1(trim(get_string('items','referentiel'))));\r\n $odt->Ln(1);\r\n\r\n\t\t\t\t foreach ($records_items as $record_i){\r\n\t\t\t\t\t\tooffice_write_item( $record_i );\r\n\t\t\t\t }\r\n\t\t\t\t $odt->Ln(1);\r\n\t\t\t }\r\n }\r\n}", "function indexSuperficie1 () {\n\n $node_id = $this->input->post('node_id');\n\n $this->load->library('PHPExcel');\n $sheet = $this->phpexcel->setActiveSheetIndex(0);\n\n $sheet->setTitle('Reporte');\n $node = Doctrine_Core::getTable('Node')->find($node_id);\n\n $q = Doctrine_Query :: create ()\n ->select('n.node_id, nt.node_type_name, ' .\n 'iodo2.infra_other_data_option_name, SUM(infra_info_usable_area) as total_usable_area, ' .\n 'COUNT(n.node_id) as quantity_node')\n ->from('Node n')\n ->innerJoin('n.NodeType nt')\n ->innerJoin('n.InfraInfo ii')\n ->innerJoin('n.InfraOtherDataValue iodv2')\n ->innerJoin('iodv2.InfraOtherDataOption iodo2')\n ->where('node_parent_id = ?', $node->node_parent_id)\n ->andWhere('n.lft > ?', $node->lft)\n ->andWhere('n.rgt < ?', $node->rgt)\n ->andWhere('iodv2.infra_other_data_attribute_id = ?', 16)\n ->andWhereIn('iodv2.infra_other_data_option_id', array(453, 305, 454, 455, 456, 313, 329, 316))\n ->groupBy('iodv2.infra_other_data_option_id, n.node_type_id')\n ->orderBy('iodo2.infra_other_data_option_name, node_type_name');\n\n $results = $q->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n\n // titulos\n $sheet->setCellValue('A1', $this->translateTag('General', 'faculty'));\n $sheet->setCellValue('B1', $this->translateTag('General', 'enclosure_type'));\n $sheet->setCellValue('C1', $this->translateTag('General', 'quantity'));\n $sheet->setCellValue('D1', $this->translateTag('Infrastructure', 'living_area'));\n\n $rcont = 1;\n foreach ($results as $resutl) {\n\n $rcont++;\n $sheet->setCellValue('A' . $rcont, $resutl['iodo2_infra_other_data_option_name']);\n $sheet->setCellValue('B' . $rcont, $resutl['nt_node_type_name']);\n $sheet->setCellValue('C' . $rcont, $resutl['n_quantity_node']);\n $sheet->setCellValue('D' . $rcont, $resutl['n_total_usable_area']);\n\n }\n\n $sheet->getColumnDimension('A')->setAutoSize(true);\n $sheet->getColumnDimension('B')->setAutoSize(true);\n $sheet->getColumnDimension('C')->setAutoSize(true);\n $sheet->getColumnDimension('D')->setAutoSize(true);\n\n $sheet->getStyle('A1:D1')->getFont()->applyFromArray(array(\n 'bold' => true\n ));\n\n $sheet->getStyle('A1:D1')->getFill()->applyFromArray(array(\n 'type' => PHPExcel_Style_Fill :: FILL_SOLID ,\n 'color' => array (\n 'rgb' => 'd9e5f4'\n )\n ));\n\n $sheet->getStyle('A1:D' . $rcont)->getBorders()->applyFromArray(array(\n 'allborders' => array (\n 'style' => PHPExcel_Style_Border :: BORDER_THIN ,\n 'color' => array (\n 'rgb' => '808080'\n )\n )\n ));\n\n $objWriter = PHPExcel_IOFactory :: createWriter($this->phpexcel, 'Excel5');\n $objWriter->save ( $this->app->getTempFileDir($this->input->post('file_name') . '.xls'));\n echo '{\"success\": true, \"file\": \"' . $this->input->post ( 'file_name' ) . '.xls\"}';\n\n }", "function addSelfToDocument($domtree, $parentElement) { \n // create the root element for this class and append it to our parent\n $xmlRoot = $parentElement->appendChild($domtree->createElement('view'));\n $xmlRoot->appendChild($domtree->createElement('siteicon_url', get_option('hbo_siteicon_url')));\n $xmlRoot->appendChild($domtree->createElement('housekeepingurl', get_option('hbo_housekeeping_url')));\n $xmlRoot->appendChild($domtree->createElement('split_room_report_url', get_option('hbo_split_room_report_url')));\n $xmlRoot->appendChild($domtree->createElement('unpaid_deposit_report_url', get_option('hbo_unpaid_deposit_report_url')));\n $xmlRoot->appendChild($domtree->createElement('group_bookings_report_url', get_option('hbo_group_bookings_report_url')));\n $xmlRoot->appendChild($domtree->createElement('guest_comments_report_url', get_option('hbo_guest_comments_report_url')));\n $xmlRoot->appendChild($domtree->createElement('bedcounts_url', get_option('hbo_bedcounts_url')));\n $xmlRoot->appendChild($domtree->createElement('manual_charge_url', get_option('hbo_manual_charge_url')));\n $xmlRoot->appendChild($domtree->createElement('generate_payment_link_url', get_option('hbo_generate_payment_link_url')));\n $xmlRoot->appendChild($domtree->createElement('payment_history_url', get_option('hbo_payment_history_url')));\n $xmlRoot->appendChild($domtree->createElement('payment_history_inv_url', get_option('hbo_payment_history_inv_url')));\n $xmlRoot->appendChild($domtree->createElement('process_refunds_url', get_option('hbo_process_refunds_url')));\n $xmlRoot->appendChild($domtree->createElement('refund_history_url', get_option('hbo_refund_history_url')));\n $xmlRoot->appendChild($domtree->createElement('report_settings_url', get_option('hbo_report_settings_url')));\n $xmlRoot->appendChild($domtree->createElement('view_log_url', get_option('hbo_view_log_url')));\n $xmlRoot->appendChild($domtree->createElement('job_history_url', get_option('hbo_job_history_url')));\n $xmlRoot->appendChild($domtree->createElement('job_scheduler_url', get_option('hbo_job_scheduler_url')));\n $xmlRoot->appendChild($domtree->createElement('blacklist_url', get_option('hbo_blacklist_url')));\n $xmlRoot->appendChild($domtree->createElement('online_checkin_url', get_option('hbo_online_checkin_url')));\n $xmlRoot->appendChild($domtree->createElement('redirect_to_url', get_option('hbo_redirect_to_url')));\n $xmlRoot->appendChild($domtree->createElement('log_directory', get_option('hbo_log_directory')));\n $xmlRoot->appendChild($domtree->createElement('log_directory_url', get_option('hbo_log_directory_url')));\n $xmlRoot->appendChild($domtree->createElement('run_processor_cmd', get_option('hbo_run_processor_cmd')));\n }", "function saveOrderingAndIndentObject()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\n\t\t$this->checkPermission(\"write\");\n\n\t\t$this->object->saveOrderingAndIndentation($_POST[\"ord\"], $_POST[\"indent\"]);\n\t\tilUtil::sendSuccess($lng->txt(\"wiki_ordering_and_indent_saved\"), true);\n\t\t$ilCtrl->redirect($this, \"editImportantPages\");\n\t}", "public function insertData($tree, $depth, $parentTree)\n\t{\n\t\t$label = $tree['text'];\n\t\t$id = $tree['id'];\n\t\t$treeID = 'T' . $id;\n\t\t$icon = 1 === (int) $tree['icon'] ? '' : $tree['icon'];\n\t\tif ('' != $parentTree) {\n\t\t\t$parentTree = $parentTree . '::';\n\t\t}\n\t\t$parentTree = $parentTree . $treeID;\n\t\t$params = [\n\t\t\t'templateid' => $this->getId(),\n\t\t\t'name' => $label,\n\t\t\t'tree' => $treeID,\n\t\t\t'parentTree' => $parentTree,\n\t\t\t'depth' => $depth,\n\t\t\t'label' => $label,\n\t\t\t'state' => $tree['state'] ? \\App\\Json::encode($tree['state']) : '',\n\t\t\t'icon' => $icon\n\t\t];\n\t\tApp\\Db::getInstance()->createCommand()->insert('vtiger_trees_templates_data', $params)->execute();\n\t\tif (!empty($tree['children'])) {\n\t\t\tforeach ($tree['children'] as $treeChild) {\n\t\t\t\t$this->insertData($treeChild, $depth + 1, $parentTree);\n\t\t\t}\n\t\t}\n\t}", "public function render_tree(tree $tree) {\n $return = \\html_writer::start_tag('div', array('class' => 'profile_tree'));\n $categories = $tree->categories;\n foreach ($categories as $category) {\n $return .= $this->render($category);\n }\n $return .= \\html_writer::end_tag('div');\n return $return;\n }", "abstract public function writeTo(\\SetaPDF_Core_Document $pdfDocument);", "function createXMLfile($phonebook){\r\n\r\n/* Het handigste is om een leeg bestand generated.phonebook.xml aan te maken en de juiste rechten toe te kennen. \r\n De onderstaande regel moet aangepast worden in bijv. $filePath = 'C://DIRECTORY/ANDERE/DIRECTORY/generated.phonebook.xml'; onder windows\r\n*/\r\n\t$filePath = '/var/www/html/telefoonboek/generated.phonebook.xml'; \r\n\t\r\n\t$document = new DOMDocument(\"1.0\",\"UTF-8\");\r\n\t$root = $document->createElement('IPPhoneDirectory');\r\n $parent1 = $document->createElement('Title','Phonelist');\r\n $parent2= $document->createElement('Prompt','Prompt');\r\n \t$root->appendChild($parent1);\r\n \t$root->appendChild($parent2);\r\n\t$document->appendChild($root);\r\n\r\n\tfor($i=0; $i<count($phonebook); $i++){\r\n\r\n\t$_Name \t = $phonebook[$i]['name'];\r\n\t$_phonenumber = $phonebook[$i]['number']; \r\n\r\n\t$_Directory = $document->createElement('DirectoryEntry');\r\n $name = $document->createElement('Name', $_Name);\r\n $_Directory->appendChild($name); \r\n $phonenumber = $document->createElement('Telephone', $_phonenumber);\r\n $_Directory->appendChild($phonenumber);\r\n \t\r\n\t$root->appendChild($_Directory);\r\n\t}\r\n\r\n $document->appendChild($root);\r\n \r\n $document->save($filePath)or die(\"Error saving phonebook file. Check folder or permissions?\"); \r\n echo \"Saving changes\";\r\n// echo $document->saveXML() . \"\\n\";\r\n}", "function crea_file_xlsx($id_progetto, $pq) {\n $writer = new XLSXWriter();\n foreach ($pq as $progetto_questionario) {\n $this->crea_sheet_questionario($writer, $progetto_questionario);\n }\n $filename = $this->get_new_file($id_progetto);\n if (file_exists($filename)) unlink($filename);\n $writer->writeToFile($filename);\n return $filename;\n }", "public function svnTreeTransform($tree) {\r\n $transformedTree = array();\r\n foreach($tree as $leaf) {\r\n $children = $this->svnTreeTransform($leaf['children']);\r\n if(!empty($children)) {\r\n $transformedTree[$leaf['name']] = $children;\r\n } else {\r\n $transformedTree[] = $leaf['name'];\r\n }\r\n }\r\n return $transformedTree;\r\n }", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "private static function writeData($objPHPExcel,$columns,$row,$array,$total)\n {\n for ($i=0;$i<count($columns);$i++)\n {\n $objPHPExcel->getActiveSheet()->SetCellValue($columns[$i] . $row, $array[$i]);\n }\n\n // Write total for 4 quarters\n $objPHPExcel->getActiveSheet()->SetCellValue($columns[count($columns) - 1] . $row, $total);\n\n return true;\n }", "protected function performTransform(array $tree) {\n $manipulators = [\n ['callable' => 'menu.default_tree_manipulators:checkNodeAccess'],\n ['callable' => 'menu.default_tree_manipulators:checkAccess'],\n ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],\n ];\n return $this->menuTree->transform($tree, $manipulators);\n }", "public function report_data_college()\n{\n\n$user = $this->Muser->report_data_college();\n\n// Create new Spreadsheet object\n$spreadsheet = new Spreadsheet();\n\n//auto width cell\nforeach(range('A','I') as $columnID) {\n $spreadsheet->getActiveSheet()->getColumnDimension($columnID)\n ->setAutoSize(true);\n}\n\n// Set document properties\n$spreadsheet->getProperties()->setCreator('STMIK BANDUNG')\n->setLastModifiedBy('STMIK BANDUNG')\n->setTitle('Office 2007 XLSX Test Document')\n->setSubject('Office 2007 XLSX Test Document')\n->setDescription('Test document for Office 2007 XLSX, generated using PHP classes.')\n->setKeywords('office 2007 openxml php')\n->setCategory('result file');\n\n// Add some data\n$spreadsheet->setActiveSheetIndex(0)\n->setCellValue('A1', 'NO')\n->setCellValue('B1', 'NIM')\n->setCellValue('C1', 'NAMA')\n->setCellValue('D1', 'JURUSAN')\n->setCellValue('E1', 'ANGKATAN')\n->setCellValue('F1', 'EMAIL')\n->setCellValue('G1', 'JENIS KELAMIN')\n->setCellValue('H1', 'NO TELEPON')\n->setCellValue('I1', 'STATUS')\n\n;\n\n// Miscellaneous glyphs, UTF-8\n$i=2; $no=1; foreach($user as $data) {\n\n$spreadsheet->setActiveSheetIndex(0)\n->setCellValue('A'.$i, $no)\n->setCellValue('B'.$i, $data->nim)\n->setCellValue('C'.$i, $data->name)\n->setCellValue('D'.$i, $data->prodi)\n->setCellValue('E'.$i, $data->generation)\n->setCellValue('F'.$i, $data->email)\n->setCellValue('G'.$i, $data->gender)\n->setCellValue('H'.$i, $data->no_telp)\n->setCellValue('i'.$i, $data->status_user)\n\n;\n$i++;\n$no++;\n}\n\n\n// Rename worksheet\n$spreadsheet->getActiveSheet()->setTitle('Report Data Mahasiswa '.date('d-m-Y H'));\n\n// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n$spreadsheet->setActiveSheetIndex(0);\n\n// Redirect output to a client’s web browser (Xlsx)\nheader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\nheader('Content-Disposition: attachment;filename=\"Report Data Mahasiswa.xlsx\"');\nheader('Cache-Control: max-age=0');\n// If you're serving to IE 9, then the following may be needed\nheader('Cache-Control: max-age=1');\n\n// If you're serving to IE over SSL, then the following may be needed\nheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\nheader('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\nheader('Cache-Control: cache, must-revalidate'); // HTTP/1.1\nheader('Pragma: public'); // HTTP/1.0\n\n$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n$writer->save('php://output');\nexit;\n}", "public function testExport() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this\n\t\t->array($arrayResult)\n\t\t->hasKey(0)\n\t\t->size->isEqualTo(1)\n\n\t\t->integer($arrayResult[0]['left'])\n\t\t->isEqualTo(0)\n\n\t\t->integer($arrayResult[0]['right'])\n\t\t->isEqualTo(1)\n\n\t\t->integer($arrayResult[0]['id'])\n\t\t->isEqualTo(0)\n\t\t;\n\n\t\t$this->array($arrayResult[0])\n\t\t\t->hasKeys(array('id', 'left', 'right', 'parent'))\n\t\t\t->size->isEqualTo(4)\n\t\t;\n\t}", "function export_log_trx_pendebetan()\n\t{\n\t\t$trx_date=$this->uri->segment(3);\n\t\t$angsuran_id=$this->uri->segment(4);\n\t\t$datas = $this->model_transaction->get_log_trx_pendebetan($trx_date,$angsuran_id);\n\t\t$data_angsuran_temp = $this->model_transaction->get_mfi_angsuran_temp_by_angsuran_id($angsuran_id);\n\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = $this->phpexcel;\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setLastModifiedBy(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setTitle(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setSubject(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setDescription(\"REPORT, generated using PHP classes.\")\n\t\t\t\t\t\t\t\t\t ->setKeywords(\"REPORT\")\n\t\t\t\t\t\t\t\t\t ->setCategory(\"Test result file\");\n\t\t\t\t\t\t\t\t\t \n\t\t$objPHPExcel->setActiveSheetIndex(0); \n\t\t\n\t\t/*\n\t\t| BORDER OPTION\n\t\t*/\n\t\t$styleArray['borders']['outline']['style']=PHPExcel_Style_Border::BORDER_THIN;\n\t\t$styleArray['borders']['outline']['color']['rgb']='000000';\n\t\t/*\n\t\t| SET COLUMN WIDTH\n\t\t*/\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(15);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(30);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(20);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(20);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(20);\n\n\t\t/*\n\t\t| ROW HEADER TITLE\n\t\t*/\n\t\t$row=1;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"List Angsuran Ter Debet\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row)->getFont()->setBold(true);\n\t\t\n\t\t$row+=2;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,\"NIK\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,\"Nama\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$row,\"Jumlah Pembayaran\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$row,\"Jumlah Terdebet\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row,\"Selisih\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':E'.$row)->getFont()->setBold(true);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':A'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B'.$row.':B'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C'.$row.':C'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D'.$row.':D'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E'.$row.':E'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':E'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$row+=1;\n\t\t/*\n\t\t| ROW DATA\n\t\t*/\n\t\tfor($i=0;$i<count($datas);$i++){\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,$datas[$i]['nik']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,$datas[$i]['nama']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$row,$datas[$i]['jumlah_bayar']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$row,$datas[$i]['jumlah_angsuran']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row,($datas[$i]['jumlah_bayar']-$datas[$i]['jumlah_angsuran']));\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':E'.$row)->getFont()->setSize(11);\n\t\t\t$row++;\n\t\t}\n\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\t\theader('Content-Disposition: attachment;filename=\"ANGSURAN TER DEBET_'.$data_angsuran_temp['keterangan'].'.xlsx\"');\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('php://output');\n\t}", "public function write();", "public function write();", "public static function buildTree($arr, $pid = 0);" ]
[ "0.51819813", "0.5128529", "0.5111114", "0.5072464", "0.5047711", "0.50272876", "0.49843073", "0.4947742", "0.49133575", "0.48999193", "0.4873075", "0.4828034", "0.4792358", "0.47884977", "0.4770568", "0.4751768", "0.4707483", "0.47046813", "0.46909052", "0.46898842", "0.46844518", "0.46363506", "0.46353632", "0.45820874", "0.4577324", "0.45744607", "0.4557448", "0.45468086", "0.45083272", "0.4478699", "0.4476744", "0.4476257", "0.44757313", "0.447087", "0.44638306", "0.44507802", "0.4442637", "0.44424698", "0.44405982", "0.44312814", "0.4429738", "0.44061413", "0.43908748", "0.4389443", "0.43854064", "0.43761906", "0.43722513", "0.43637353", "0.43610564", "0.43572158", "0.43508893", "0.43446568", "0.4341685", "0.43408448", "0.43404552", "0.43365735", "0.43306342", "0.4329728", "0.43295926", "0.4323936", "0.43201116", "0.43155488", "0.42965564", "0.4295974", "0.4290924", "0.42906997", "0.42835245", "0.42829612", "0.42810762", "0.42799821", "0.42794245", "0.42765135", "0.42752904", "0.42722166", "0.42688432", "0.42669228", "0.42651767", "0.4264399", "0.42629147", "0.42616788", "0.42615592", "0.42609957", "0.42533508", "0.42397016", "0.42330137", "0.42324176", "0.42322192", "0.42283332", "0.4223677", "0.42224744", "0.4221389", "0.42202258", "0.42194924", "0.42182606", "0.42134598", "0.42133158", "0.42061946", "0.42025712", "0.42025712", "0.42021206" ]
0.60947543
0
/ Initialize action controller here
public function init() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init()\n {\n /* Initialize action controller here */\n }", "public function init()\n {\n /* Initialize action controller here */\n }", "protected function initializeController() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initAction()\n {\n }", "protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {\n\n\t}", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "public function __construct($controller,$action) {\n\t\tparent::__construct($controller, $action);\n\t\t\n\t}", "public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }", "public function __construct($controller, $action) {\n parent::__construct($controller, $action); //parent is Controller.php\n }", "protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\n }", "public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }", "public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }", "public static function init() {\n\t\tself::setup_actions();\n\t}", "protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}", "public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }", "public function init() {\n\n $this->jobs = new Hb_Jobs();\n if ($this->_request->getActionName() == 'view') {\n\n $this->_request->setActionName('index');\n }\n\n $this->searchParams = $this->_request->getParams();\n $this->view->searchParams = $this->searchParams;\n\n $this->view->actionName = $this->_request->getActionName();\n }", "protected function initializeAction()\n {\n $this->extKey = GeneralUtility::camelCaseToLowerCaseUnderscored('BwrkOnepage');\n /** @var LanguageAspect $languageAspect */\n $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');\n $this->languageUid = $languageAspect->getId();\n }", "protected function initializeAction()\n {\n parent::initializeAction();\n $this->customer = SubjectResolver::get()\n ->forClassName(Customer::class)\n ->forPropertyName('user')\n ->resolve();\n }", "public function initialize()\n {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie');\n $this->cors();\n\n $currentController = $this->request->getParam('controller');\n // pr($currentController); die();\n if($currentController == 'Tenants'){\n $currentController = 'TenantUsers';\n }\n if($currentController == 'CorporateClients'){\n $currentController = 'CorporateClientUsers';\n // pr($currentController);die();\n }\n // $currentController = $this->request->params['controller'];\n $loginAction = $this->Cookie->read('loginAction');\n if(!$loginAction){\n $loginAction = ['controller' => $currentController,'action' => 'login'];\n }\n // pr($loginAction);die;\n $this->loadComponent('Auth',[\n 'loginAction' => ['controller' => $currentController,'action' => 'login'],\n 'authenticate' => [\n 'Form' =>\n [\n 'userModel' => $currentController,\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ],\n 'authorize'=> ['Controller'],\n 'loginAction' => $loginAction,\n 'loginRedirect' => $loginAction,\n 'logoutRedirect' => $loginAction \n\n ]);\n // $this->loadComponent('Auth', [\n\n // 'unauthorizedRedirect' => false,\n // 'checkAuthIn' => 'Controller.initialize',\n\n // // If you don't have a login action in your application set\n // // 'loginAction' to false to prevent getting a MissingRouteException.\n // 'loginAction' => false\n // ]);\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n }", "public function init() {\n\t\t$this->load_actions();\n\t}", "public function init()\r\n {\r\n\r\n /* Initialize action controller here */\r\n\r\n //=====================================must add in all Controller class constructor ===================================//\r\n if(defined('SITEURL')) $this->site_url = SITEURL;\r\n if(defined('SITEASSET')) $this->site_asset = SITEASSET;\r\n $this->view->site_url = $this->site_url;\r\n $this->view->site_asset = $this->site_asset;\r\n Zend_Loader::loadClass('Signup');\r\n Zend_Loader::loadClass('User');\r\n Zend_Loader::loadClass('Request');\r\n //Zend_Loader::loadClass('mailerphp');\r\n\t\t//Zend_Loader::loadClass('Permission');\r\n\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n Zend_Loader::loadClass('LoginAuth');\r\n $this->view->ob_LoginAuth = $this->sessionAuth = new LoginAuth();\r\n\r\n $this->sessionAuth->login_user_check();\r\n\r\n $this->sessionAuth->cookie_check();\r\n $this->view->server_msg = $this->sessionAuth->msg_centre();\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n unset($_SESSION['tranzgo_session']['export_list']);\r\n $this->view->ControllerName = $this->_request->getControllerName();\r\n $this->view->page_id = ($_SESSION['tranzgo_session']['role_id']==1)?'5':'7';\r\n //______________________________________must add in all Controller class constructor _____________________________________//\r\n\r\n\r\n }", "public function __construct() {\n\t\t\t$this->init_globals();\n\t\t\t$this->init_actions();\n\t\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->resolution_summary = \"\";\n\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}", "function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->_actionModel = new Action_Model();//khoi tao class\n\t\t}", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->media_values = array(\n\t\t\t101 => Kohana::lang('ui_main.all'),\n\t\t\t102 => Kohana::lang('actionable.actionable'),\n\t\t\t103 => Kohana::lang('actionable.urgent'),\n\t\t\t104 => Kohana::lang('actionable.action_taken')\n\t\t);\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct() {\n\n list($null,$controller, $action, $id) = explode(\"/\", $_SERVER['PATH_INFO']);\n \n $this->urlValues['base'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n $this->urlValues['controller'] = $controller ? $controller : \"home\";\n $this->urlValues['action'] = $action;\n $this->urlValues['id'] = $id;\n\n $this->controllerName = strtolower($this->urlValues['controller']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['controller'])) . \"Controller\";\n\n if ($this->urlValues['action'] == \"\") {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['action'];\n }\n }", "protected function _initControllers()\n\t{\n\t\treturn;\n\t}", "public function init()\n {\n $this->vars['CRUD']['Object'] = $this;\n $this->kernel = kernel();\n\n // Dynamic initialization\n if (! $this->modelName) {\n $modelRefl = new ReflectionClass($this->modelClass);\n $this->modelName = $modelRefl->getShortName();\n }\n\n\n if (! $this->crudId) {\n $this->crudId = \\Phifty\\Inflector::getInstance()->underscore($this->modelName);;\n }\n if (! $this->templateId) {\n $this->templateId = $this->crudId;\n }\n\n // Derive options from request\n if ($request = $this->getRequest()) {\n if ($useFormControls = $request->param('_form_controls')) {\n $this->actionViewOptions['submit_btn'] = true;\n $this->actionViewOptions['_form_controls'] = true;\n }\n }\n\n $this->reflect = new ReflectionClass($this);\n $this->namespace = $ns = $this->reflect->getNamespaceName();\n\n // XXX: currently we use FooBundle\\FooBundle as the main bundle class.\n $bundleClass = \"$ns\\\\$ns\";\n if (class_exists($bundleClass)) {\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n } else {\n $bundleClass = \"$ns\\\\Application\";\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n }\n\n $this->vars['Handler'] = $this;\n $this->vars['Controller'] = $this;\n\n // anyway, we have the model classname, and the namespace, \n // we should be able to registerRecordAction automatically, so we don't have to write the code.\n if ($this->registerRecordAction) {\n $self = $this;\n $this->kernel->event->register('phifty.before_action',function() use($self) {\n $self->kernel->action->registerAction('RecordActionTemplate', array(\n 'namespace' => $self->namespace,\n 'model' => $self->modelName,\n 'types' => (array) $self->registerRecordAction\n ));\n });\n }\n\n\n $this->initPermissions();\n\n /*\n * TODO: Move this to before render CRUD page, keep init method simple\n\n if ( $this->isI18NEnabled() ) {\n $this->primaryFields[] = 'lang';\n }\n */\n $this->initNavBar();\n }", "public function _initialize()\n {\n $this->cate=CONTROLLER_NAME;\n }", "protected function initializeActionEntries() {}", "protected function initializeAction() {\n\t\t$this->feusers = $this->feusersRepository->findByUid( $GLOBALS['TSFE']->fe_user->user['uid'] ) ;\n\t\t$this->schule = $this->feusers->getSchule();\n\t\n\t\t$this->extKey = $this->request->getControllerExtensionKey();\n\t\t$this->extPath = t3lib_extMgm::extPath($this->extKey);\n\t\n\t\t$this->importClassFile = $this->extPath.'Classes/tmp/class.importtext.php';\n\t\t$this->importClass = 'ImportText';\n\t \n\t\tif ( $this->settings[pidAjaxContainerKlassenuebersicht] > 0) $this->pidAjaxContainerKlassenuebersicht = (int) $this->settings[pidAjaxContainerKlassenuebersicht];\n\t\n\t}", "public function init(){\r\n\t$this->_helper->_acl->allow('public',NULL);\r\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\r\n\t$this->_contexts = array('xml','json');\r\n\t$this->_helper->contextSwitch()\r\n\t\t->setAutoDisableLayout(true)\r\n\t\t->addActionContext('oneto50k',$this->_contexts)\r\n\t\t->addActionContext('index',$this->_contexts)\r\n\t\t->initContext();\r\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function initBaseController();", "public function init() {\n $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t\t$this->_helper->acl->allow('public',null);\n\t\t$this->_helper->contextSwitch()\n\t\t\t ->setAutoDisableLayout(true)\n\t\t\t ->addActionContext('index', array('xml','json'))\n ->initContext();\n\t}", "public function __construct()\n {\n // Call the CI_Controller constructor\n parent::__construct();\n }", "public function __construct()\n\t{\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function initAction() : object\n {\n /**\n * Show all movies.\n */\n $response = $this->app->response;\n return $response->redirect(\"cms/posts\");\n }", "protected function initializeAction() {\n\t\t$this->frontendUserRepository = t3lib_div::makeInstance('Tx_GrbFeusermanager_Domain_Repository_FrontendUserRepository');\n\t}", "public function contentControllerInit()\n\t{\n\t}", "protected function initializeAction()\n {\n parent::initializeAction();\n\n $query = GeneralUtility::_GET('q');\n if ($query !== null) {\n $this->request->setArgument('q', $query);\n }\n }", "public function __construct()\n {\n $this->setAction('index', array('idle', 'toggleEnabled', 'expunge'));\n }", "public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}", "public function init()\r\n { \r\n //date_default_timezone_set('America/Phoenix');\r\n $ajaxContext = $this->_helper->getHelper('AjaxContext');\r\n\t$ajaxContext->addActionContext('list', 'html')\r\n ->addActionContext('edit', 'html')\r\n ->addActionContext('dashboard', 'html')\r\n ->addActionContext('handler', 'html')\r\n ->initContext();\r\n $auth = Zend_Auth::getInstance();\r\n $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\r\n $type = $this->getRequest()->getParam('type');\r\n if (!$auth->hasIdentity() && $action!='handler') {\r\n //echo \"THIS IS AN ERROR: \".$action;\r\n $this->_redirect('login', array('UseBaseUrl' => true));\r\n }\r\n }", "public function __construct()\n {\n $this->model = new MainModel();\n $this->params[\"pagination\"][\"totalItemsPerPage\"] = 5;\n view()->share ('controllerName', $this->controllerName);//đặt controllerName cho all action\n }", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function init() {\n $this->_temporizador = new Trf1_Admin_Timer ();\n $this->_temporizador->Inicio();\n\n /* Initialize action controller here */\n $this->view->titleBrowser = 'e-Sisad';\n }", "public function __construct()\n\t{\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "function __construct()\n {\n parent::Controller();\n }", "public function controller()\n\t{\n\t\n\t}", "public function init() {\n\t\t\t\t\t\t$this->view->controller = $this->_request->getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->action = $this->_request->getParam ( 'action' );\n\t\t\t\t\t\t$this->getLibBaseUrl = new Zend_View_Helper_BaseUrl ();\n\t\t\t\t\t\t$this->GetModelOrganize = new Application_Model_ModOrganizeDb ();\n\t\t\t\t\t\t$this->_helper->ajaxContext->addActionContext('deleteOrganisme1','json')->initContext();\n\t\t\t\t\t\t// call function for dynamic sidebar\n\t\t\t\t\t\t$this->_Categories = new Application_Model_ModCatTerm ();\n\t\t\t\t\t\t$parent_id = $this->_getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->secondSideBar = $this->_Categories->showCateParent ( $parent_id );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public function initializeAction() {\t\t\n\t\t$this->contactRepository = t3lib_div::makeInstance('Tx_Addresses_Domain_Repository_ContactRepository');\t\n\t}", "public function init() {\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t$this->_helper->acl->allow('public',null);\n\t$this->_helper->contextSwitch()\n\t\t->setAutoDisableLayout(true)\n\t\t->addActionContext('index', array('xml','json'))\n\t\t->addActionContext('mint', array('xml','json'))\n\t\t->initContext();\n }", "public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }", "public function initializeAction() {\n parent::initializeAction();\n $this->umDiv = new Tx_Magenerator_Domain_UserManagement_Div();\n }", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }", "public function getControllerAction() {}", "public function __construct($action = '') {\n\t\t$this->app = Application::app();\n\t\t$this->setAction($action);\n\t}", "function initialize(Controller $controller) {\n $this->controller=&$controller;\n \t}", "public function __construct($controller, $action) {\n parent::__construct($controller, $action);\n $this->loadModel('Baskets');\n $this->loadModel('Orders');\n $this->loadModel('Messages');\n $this->loadModel('Products');\n\n if(Session::exists(BUYER_SESSION_NAME)) {\n $this->view->totalProductInBasket = $this->BasketsModel->countProductInBasket();\n $this->view->totalOrders = $this->OrdersModel->countSentOrder();\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n } elseif(Session::exists(STORE_SESSION_NAME)) {\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n $this->view->newOrders = $this->OrdersModel->newOrders(Session::get(STORE_SESSION_NAME));\n }\n\n $this->view->setLayout('details');\n }", "function initialize(Controller $controller) {\n $this->controller = $controller;\n }", "public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }", "public function __construct() {\r\n\t\t\r\n\t\tSession::init();\n\t\tif (!Session::get('local'))\n\t\t\tSession::set('local', DEFAULT_LANGUAGE);\r\n\t\t\r\n\t\t$this->getUrl();\r\n\t\t\r\n\t\t//No controller is specified.\r\n\t\tif (empty($this->url[0])) {\r\n\t\t\t$this->loadDefaultController();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->loadCurrentController();\r\n\t\t$this->callControllerMethod();\r\n\r\n\t}", "public function __construct() {\n $this->urlValues = $_GET;\n if (!isset($this->urlValues['c'])) {\n $this->controllerName = \"home\";\n $this->controllerClass = \"HomeController\";\n } else {\n $this->controllerName = strtolower($this->urlValues['c']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['c'])) . \"Controller\";\n }\n \n if (!isset($this->urlValues['a'])) {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['a']; \n }\n }", "public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }", "function __construct($controller, $action)\n {\n global $inflect;\n\n $this->renderPage = true;\n $this->renderHeader = true;\n \t\n\t\t$this->requireUser = false;\n\t\t \n $this->_controller = ucfirst($controller);\n $this->_action = $action;\n \n $model = ucfirst($inflect->singularize($controller));\n $this->$model = new $model;\n\n $this->_template = new Template($controller, $action);\n }", "public function init()\n {\n $this->ctrlModel = new Admin_Model_Acl_ControllersActions();\n $this->dbCtrl = new Admin_Model_DbTable_Acl_ModuleController();\n }", "public function setup_actions() {}", "public function init(){\r\n\t\t$this->_data = $this->_request->getParams();\r\n $controller = $this->_data['controller']; //Get controller\r\n $action = $this->_data['action']; //Get action\r\n \r\n $loadfunction = new Default_Model_Common();\r\n foreach($loadfunction->loadFunction($controller) as $value){\r\n if($action == $value['action']){\r\n $load = new $value['model_load']();\r\n $this->view->$value['varname'] = $load->$value['function_load']();\r\n }\r\n }\r\n\r\n $this->view->lang = Zend_Registry::get(\"lang\"); //load language\r\n \r\n //List menu\r\n $listmenu = Zend_Registry::get(\"listmenu\");\r\n $this->view->listmenu = $listmenu;\r\n \r\n $this->view->selectaccount = ' class=\"selected\"';\r\n }", "function __construct() {\n\t\t\n\t\tparent::__construct();\n\t\t\n\t\t// skip the timestamp check for this app\n\t\tSession::check(true);\n\t\t$this->data[\"showActions\"] = true;\n\t\t$this->data[\"csrfToken\"] = CSRF::generateToken();\n\t\t\n\t}", "abstract public function getControllerAction();", "public function _construct($controller,$view){\r\n $this->controller = $controller;\r\n }", "public function initialize()\n { $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"notification\");\n }", "protected function __construct() {\n\t\t\tadd_action( 'init', array( $this, 'action__init' ), 11 );\n\t\t}", "public function init()\n {\n $this->ctrlActionModel = new Admin_Model_Acl_ControllersActions();\n $this->dbController = new Admin_Model_DbTable_Acl_ModuleController();\n $this->dbAction = new Admin_Model_DbTable_Acl_Action();\n }", "public function init()\n {\n $this->projectController->init();\n }", "function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}", "public function __construct() {\n // Call Module constructur\n parent::__construct();\n\n // Add additional route\n $this->_actions['GET']['/people/:id'] = 'people';\n }", "public function initialize()\n {\n $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"refund\");\n }", "function Controller()\n\t{\t\t\n\t\t$this->method = \"showView\";\n\t\tif (array_key_exists(\"method\", $_REQUEST))\n\t\t\t$this->method = $_REQUEST[\"method\"];\n\t\t\t\t\n\t\t$this->icfTemplating = new IcfTemplating();\n\t\t$this->tpl =& $this->icfTemplating->getTpl();\n\t\t$this->text =& $this->icfTemplating->getText();\t\t\n\t\t$this->controllerMessageArray = array();\n\t\t$this->pageTitle = \"\";\n\t\t$this->dateFormat = DateFormatFactory::getDateFormat();\n\t\t$this->controllerData =& $this->newControllerData();\n\t}", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "function __construct($module,$controller,$action) {\n\t\t$this->action = $action;\n\t\t$this->controller = preg_replace('%Controller$%','',$controller);\n\t\t$this->module = $module;\n\n\t\t$jadeCacheDir = J::path(\"App/Cache/Jade/$this->module/$this->controller\");\n\t\t(is_dir($jadeCacheDir)) || mkdir($jadeCacheDir,0777,true);\n\t\t$this->cacheFile = J::path(\"$jadeCacheDir/$this->action.php\");\n\t\t$this->viewFile = J::path(\"App/Modules/$this->module/Views/$this->controller/$this->action.jade\");\n\t}", "public function __construct()\n {\n $url = $this->getUrl();\n // Look in controllers folder for first value and ucwords(); will capitalise first letter \n if (isset($url[0]) && file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {\n $this->currentController = ucwords($url[0]); // Setting the current controllers name to the name capitilised first letter\n unset($url[0]); \n }\n\n // Require the controller\n require_once '../app/controllers/' . $this->currentController . '.php';\n // Taking the current controller and instantiating the controller class \n $this->currentController = new $this->currentController;\n // This is checking for the second part of the URL\n if (isset($url[1])) {\n if (method_exists($this->currentController, $url[1])) { // Checking the seond part of the url which is the corresponding method from the controller class\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n // Get params, if no params, keep it empty\n $this->params = $url ? array_values($url) : []; \n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}", "public function __construct()\n {\n $this->controller = new Controller;\n $this->error_message = 'bad request or duplicate data';\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }" ]
[ "0.89566046", "0.89566046", "0.82057846", "0.80040884", "0.80040884", "0.8004028", "0.7928566", "0.7802862", "0.7750365", "0.7750365", "0.7750365", "0.7750365", "0.7750365", "0.7741994", "0.76497424", "0.7542271", "0.7541656", "0.7458589", "0.7430627", "0.7382884", "0.73493266", "0.73307425", "0.7321889", "0.73055863", "0.7295852", "0.7274981", "0.72531754", "0.7246773", "0.7212456", "0.72057885", "0.71661454", "0.71535975", "0.7130195", "0.7116122", "0.70873964", "0.7080964", "0.7078719", "0.70654655", "0.7053619", "0.7048942", "0.7036025", "0.7028192", "0.6996098", "0.69914645", "0.6983108", "0.69822043", "0.6978827", "0.69710267", "0.69653803", "0.6934731", "0.69341296", "0.6926329", "0.692468", "0.69113386", "0.6909758", "0.6896174", "0.68904704", "0.6874338", "0.68700373", "0.68700373", "0.6862786", "0.6847179", "0.6844484", "0.68443036", "0.68056643", "0.6804595", "0.68018633", "0.67917275", "0.6769771", "0.676602", "0.6765842", "0.67582476", "0.67257833", "0.6721477", "0.6721169", "0.67196625", "0.67082113", "0.6707143", "0.6706214", "0.67023355", "0.6700337", "0.669937", "0.6695276", "0.66930395", "0.6692887", "0.6688026", "0.66866106", "0.66839683", "0.6674853", "0.6667438", "0.6658782", "0.66509074", "0.6642763", "0.66400504", "0.6634305", "0.6610988", "0.6610453", "0.66071516", "0.66062886", "0.6600459", "0.6599095" ]
0.0
-1
/ end po15 head cleanup remove WP version from RSS
function po_rss_version() { return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function theme_rss_version() { return ''; }", "function mdwpfp_rss_version() { return ''; }", "function wpgrade_rss_version() { return ''; }", "function spartan_rss_version() { return ''; }", "function bulledev_rss_version() { return ''; }", "function bones_rss_version() { return ''; }", "public function remove_rss_version() {\n\t\treturn '';\n\t}", "public function remove_rss_version() {\n return '';\n }", "function tlh_rss_version() {\n\treturn '';\n}", "function bones_rss_version()\n{\n\treturn '';\n}", "function cardealer_rss_version() {\r\n\treturn '';\r\n}", "function wpcom_vip_remove_mediacontent_from_rss2_feed() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function remove_thefeeds()\r\n{\r\n remove_theme_support( 'automatic-feed-links' ); //remove feed links in head\r\n}", "function permalink_single_rss($deprecated = '')\n {\n }", "function get_wp_title_rss($deprecated = '&#8211;')\n {\n }", "function remove_versao_wp() { return ''; }", "function remove_versao_wp() { return ''; }", "function pd_head_cleanup()\n{\n\n /* ===============\n Remove RSS from header\n =============== */\n remove_action('wp_head', 'rsd_link'); #remove page feed\n remove_action('wp_head', 'feed_links_extra', 3); // Remove category feeds\n remove_action('wp_head', 'feed_links', 2); // Remove Post and Comment Feeds\n\n\n /* ===============\n remove windindows live writer link\n =============== */\n remove_action('wp_head', 'wlwmanifest_link');\n\n\n /* ===============\n links for adjacent posts\n =============== */\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\n\n /* ===============\n WP version\n =============== */\n remove_action('wp_head', 'wp_generator');\n\n\n /* ===============\n remove WP version from css\n =============== */\n add_filter('style_loader_src', 'pd_remove_wp_ver_css_js', 9999);\n\n\n /* ===============\n remove Wp version from scripts\n =============== */\n add_filter('script_loader_src', 'pd_remove_wp_ver_css_js', 9999);\n}", "function wpgrade_head_cleanup() {\r\n\t// Remove WP version\r\n\tremove_action( 'wp_head', 'wp_generator' );\r\n\t\r\n\tremove_action( 'wp_head', 'rsd_link' );\r\n\t// windows live writer\r\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\r\n\t\r\n\t// remove WP version from css - those parameters can prevent caching\r\n\t//add_filter( 'style_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\t// remove WP version from scripts - those parameters can prevent caching\r\n\t//add_filter( 'script_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\r\n}", "function wp_title_rss($deprecated = '&#8211;')\n {\n }", "function wpversion_remove_version() {\n return '';\n }", "function getVersion() {\n\t\treturn DOMIT_RSS_VERSION;\n\t}", "function newenglish_head_cleanup() {\n // Originally from http://wpengineer.com/1438/wordpress-header/\n remove_action('wp_head', 'feed_links_extra', 3);\n add_action('wp_head', 'ob_start', 1, 0);\n add_action('wp_head', function () {\n $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\\r\\n]+/';\n echo preg_replace($pattern, '', ob_get_clean());\n }, 3, 0);\n remove_action('wp_head', 'rsd_link');\n remove_action('wp_head', 'wlwmanifest_link');\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);\n remove_action('wp_head', 'wp_generator');\n remove_action('wp_head', 'wp_shortlink_wp_head', 10);\n remove_action('wp_head', 'print_emoji_detection_script', 7);\n remove_action('admin_print_scripts', 'print_emoji_detection_script');\n remove_action('wp_print_styles', 'print_emoji_styles');\n remove_action('admin_print_styles', 'print_emoji_styles');\n remove_action('wp_head', 'wp_oembed_add_discovery_links');\n remove_action('wp_head', 'wp_oembed_add_host_js');\n remove_action('wp_head', 'rest_output_link_wp_head', 10);\n remove_filter('the_content_feed', 'wp_staticize_emoji');\n remove_filter('comment_text_rss', 'wp_staticize_emoji');\n remove_filter('wp_mail', 'wp_staticize_emoji_for_email');\n add_filter('use_default_gallery_style', '__return_false');\n add_filter('emoji_svg_url', '__return_false');\n add_filter('show_recent_comments_widget_style', '__return_false');\n}", "function remove_wordpress_version() {\n remove_filter( 'update_footer', 'core_update_footer' );\n}", "function cleaning_wp(){\n remove_action('wp_head', 'wp_generator'); // remove WP tag\n\n remove_action( 'wp_head', 'feed_links_extra', 3 ); // remove extra feeds\n remove_action( 'wp_head', 'feed_links', 2 ); // remove general feeds\n remove_action( 'wp_head', 'rsd_link' ); // remove RSD link\n remove_action( 'wp_head', 'wlwmanifest_link' ); // remove manifest link\n remove_action( 'wp_head', 'index_rel_link' ); // remove index link\n remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // remove prev link\n remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // remove start link\n remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // remove links to adjacent posts\n remove_action( 'wp_head', 'wp_shortlink_wp_head'); // remove shortlink\n\n // disable admin bar\n add_filter('the_generator', '__return_false');\n add_filter('show_admin_bar','__return_false');\n\n // disable emoji\n remove_action( 'wp_head', 'print_emoji_detection_script', 7);\n remove_action( 'wp_print_styles', 'print_emoji_styles' );\n\n // disbale json\n remove_action( 'wp_head', 'rest_output_link_wp_head' );\n remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n remove_action( 'template_redirect', 'rest_output_link_header', 11 );\n}", "public function head_cleanup() {\n\t\tremove_action('wp_head', 'feed_links_extra', 3);\n\t\tadd_action('wp_head', 'ob_start', 1, 0);\n\t\tadd_action('wp_head', function () {\n\t\t\t$pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\\r\\n]+/';\n\t\t\techo preg_replace($pattern, '', ob_get_clean());\n\t\t}, 3, 0);\n\n\t\tremove_action('wp_head', 'rsd_link');\n\t\tremove_action('wp_head', 'wlwmanifest_link');\n\t\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\t\tremove_action('wp_head', 'wp_generator');\n\t\tremove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);\n\t\tremove_action('wp_head', 'print_emoji_detection_script', 7);\n\t\tremove_action('admin_print_scripts', 'print_emoji_detection_script');\n\t\tremove_action('wp_print_styles', 'print_emoji_styles');\n\t\tremove_action('admin_print_styles', 'print_emoji_styles');\n\t\tremove_action('wp_head', 'wp_oembed_add_discovery_links');\n\t\tremove_action('wp_head', 'wp_oembed_add_host_js');\n\t\tremove_action('wp_head', 'rest_output_link_wp_head', 10, 0);\n\t\tremove_filter('the_content_feed', 'wp_staticize_emoji');\n\t\tremove_filter('comment_text_rss', 'wp_staticize_emoji');\n\t\tremove_filter('wp_mail', 'wp_staticize_emoji_for_email');\n\t\tadd_filter('use_default_gallery_style', '__return_false');\n\n\t\tglobal $wp_widget_factory;\n\n\t\tif (isset($wp_widget_factory->widgets['WP_Widget_Recent_Comments'])) {\n\t\t\tremove_action('wp_head', [$wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style']);\n\t\t}\n\n\t\tif (!class_exists('WPSEO_Frontend')) {\n\t\t\tremove_action('wp_head', 'rel_canonical');\n\t\t\tadd_action('wp_head', [$this, 'rel_canonical']);\n\t\t}\n\n\t\tif (class_exists('SitePress')) {\n\t\t\tdefine('ICL_DONT_LOAD_NAVIGATION_CSS', true);\n\t\t\tdefine('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);\n\t\t\tdefine('ICL_DONT_LOAD_LANGUAGES_JS', true);\n\t\t\tremove_action( 'wp_head', [ $GLOBALS['sitepress'], 'meta_generator_tag', 20 ] );\n\t\t}\n\n\t\tif ( class_exists( 'woocommerce' ) ) {\n\t\t\tadd_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );\n\t\t}\n\t}", "function prop_clean_the_head() {\n\n remove_action( 'wp_head', 'feed_links_extra', 3 );\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );\n\tremove_action( 'wp_head', 'wp_generator' );\n\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10 );\n\tremove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n\tremove_action( 'wp_head', 'wp_oembed_add_host_js' );\n remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );\n \n add_action( 'wp_head', 'ob_start', 1, 0 );\n\tadd_action( 'wp_head', function () {\n\t\t$pattern = '/.*' . preg_quote( esc_url( get_feed_link( 'comments_' . get_default_feed() ) ), '/' ) . '.*[\\r\\n]+/';\n\t\techo preg_replace( $pattern, '', ob_get_clean() );\n\t}, 3, 0 );\n\n global $wp_widget_factory;\n \n\tif ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) {\n\t\tremove_action( 'wp_head', [\n\t\t\t$wp_widget_factory->widgets['WP_Widget_Recent_Comments'],\n\t\t\t'recent_comments_style'\n ] ); \n }\n\n}", "function wpcom_vip_remove_feed_tracking_bug() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function customRSS() {\n add_feed('active_plugins', 'createPluginRssFeed');\n}", "function startertheme_remove_version() {\nreturn '';\n}", "function plugin_tb_output_rsslist($tb_id)\n{\n\tglobal $script, $vars, $entity_pattern;\n\n\t$page = tb_id2page($tb_id);\n\tif ($page === FALSE) return FALSE;\n\n\t$items = '';\n\tforeach (tb_get(tb_get_filename($page)) as $arr) {\n\t\t// _utime_, title, excerpt, _blog_name_\n\t\tarray_shift($arr); // Cut utime\n\t\tlist ($url, $title, $excerpt) = array_map(\n\t\t\tcreate_function('$a', 'return htmlsc($a);'), $arr);\n\t\t$items .= <<<EOD\n\n <item>\n <title>$title</title>\n <link>$url</link>\n <description>$excerpt</description>\n </item>\nEOD;\n\t}\n\n\t$title = htmlsc($page);\n\t$link = $script . '?' . rawurlencode($page);\n\t$vars['page'] = $page;\n\t$excerpt = strip_htmltag(convert_html(get_source($page)));\n\t$excerpt = preg_replace(\"/&$entity_pattern;/\", '', $excerpt);\n\t$excerpt = mb_strimwidth(preg_replace(\"/[\\r\\n]/\", ' ', $excerpt), 0, 255, '...');\n\t$lang = PLUGIN_TB_LANGUAGE;\n\n\t$rc = <<<EOD\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<response>\n <error>0</error>\n <rss version=\"0.91\">\n <channel>\n <title>$title</title>\n <link>$link</link>\n <description>$excerpt</description>\n <language>$lang</language>$items\n </channel>\n </rss>\n</response>\nEOD;\n\n\tpkwk_common_headers();\n\theader('Content-Type: text/xml');\n\techo mb_convert_encoding($rc, 'UTF-8', SOURCE_ENCODING);\n\texit;\n}", "function get_bloginfo_rss($show = '')\n {\n }", "function rss()\n\t{\n\t\t// Header\n\t\theader(\"Content-Type: application/rss+xml\");\n\t\t$xml = '<?xml version=\"1.0\" encoding=\"utf-8\"?>';\n\t\t$xml .= \"\\n\".'<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">';\n\t\t$xml .= \"\\n\".'<channel>';\n\t\t$xml .= \"\\n\".'<atom:link href=\"'.SITEURL.'?rss\" rel=\"self\" type=\"application/rss+xml\" />';\n\n\t\t$last_edit = $this->find('page', null, null, 1, SORT_DESC, 'date', true);\n\t\t$last_edit = $this->get('page', $last_edit, 'date');\n\n\t\t// Channel description\n\t\t$xml .= \"\\n\".'<title>' . $this->setting('site_title') . '</title>';\n\t\t$xml .= \"\\n\".'<link>' . SITEURL . '</link>';\n\t\t$xml .= \"\\n\".'<description>' . $this->setting('site_description') . '</description>';\n\t\t$xml .= \"\\n\".'<lastBuildDate>' . date('r', intval($last_edit)) . '</lastBuildDate>';\n\t\t$xml .= \"\\n\".'<language>' . $this->language() . '</language>';\n\n\t\t// Items\n\t\tforeach($this->get('page') as $name => $page) {\n\t\t\t$url = $this->page_url($name);\n\n\t\t\t$content = $this->parse($page['content'], false);\n\t\t\t$content = $this->markup_del($content, false);\n\t\t\t$content = $this->excerpt($content, 300, '...');\n\t\t\t$content = html_entity_decode(strip_tags($content), ENT_QUOTES, 'UTF-8');\n\n\t\t\t$xml .= \"\\n\".'<item>';\n\t\t\t$xml .= \"\\n\\t\".'<title>' . html_entity_decode($this->page_title($name), ENT_QUOTES, 'UTF-8'). '</title>';\n\t\t\t$xml .= \"\\n\\t\".'<link>' . $url . '</link>';\n\t\t\t$xml .= \"\\n\\t\".'<guid>' . $url . '</guid>';\n\t\t\t$xml .= \"\\n\\t\".'<pubDate>' . $page['date'] . '</pubDate>';\n\t\t\t$xml .= \"\\n\\t\".'<description>' . $content . '</description>';\n\t\t\t$xml .= \"\\n\".'</item>';\n\t\t}\n\t\t$xml .= '</channel></rss>';\n\t\treturn $xml;\n\t}", "function RSS_upgrade($oldversion)\n{\n // Update successful\n return true;\n}", "function full_feed() {\n\tadd_filter('pre_option_rss_use_excerpt', '__return_zero');\n\tload_template( ABSPATH . WPINC . '/feed-rss2.php' );\n}", "function the_permalink_rss()\n {\n }", "function get_the_title_rss()\n {\n }", "function wp_rss_multi_importer_shortcode($atts = array())\n{\n\n//if ($_GET[\"rssvn\"]==q){\n//\techo WP_RSS_MULTI_VERSION; // maybe use in future for getting version number\n//}\n\n add_action('wp_footer', 'footer_scripts');\n\n if (!function_exists(\"wprssmi_hourly_feed\")) {\n function wprssmi_hourly_feed()\n {\n return 0;\n }\n }\n add_filter('wp_feed_cache_transient_lifetime', 'wprssmi_hourly_feed');\n\n\n $siteurl = get_site_url();\n $cat_options_url = $siteurl . '/wp-admin/options-general.php?page=wp_rss_multi_importer_admin&tab=category_options/';\n $images_url = $siteurl . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/images';\n\n $parms = shortcode_atts(array( //Get shortcode parameters\n 'category' => 0,\n 'hdsize' => '16px',\n 'hdweight' => 400,\n 'anchorcolor' => '',\n 'testyle' => 'color: #000000; font-weight: bold;margin: 0 0 0.8125em;',\n 'maximgwidth' => 150,\n 'datestyle' => 'font-style:italic;',\n 'floattype' => '',\n 'showdate' => 1,\n 'showgroup' => 1,\n 'thisfeed' => '',\n 'timer' => 0,\n 'dumpthis' => 0,\n 'cachetime' => NULL,\n 'pinterest' => 0,\n 'maxperpage' => 0,\n 'noimage' => 0,\n 'sortorder' => NULL,\n 'defaultimage' => NULL,\n 'showdesc' => NULL,\n 'mytemplate' => '',\n 'showmore' => NULL,\n 'authorprep' => 'by',\n 'morestyle' => '[...]'\n ), $atts);\n\n $showThisDesc = $parms['showdesc'];\n $defaultImage = $parms['defaultimage'];\n $sortOrder = $parms['sortorder'];\n $authorPrep = $parms['authorprep'];\n $anchorcolor = $parms['anchorcolor'];\n $datestyle = $parms['datestyle'];\n $hdsize = $parms['hdsize'];\n $thisCat = $parms['category'];\n $parmfloat = $parms['floattype'];\n $catArray = explode(\",\", $thisCat);\n $showdate = $parms['showdate'];\n $showgroup = $parms['showgroup'];\n $pshowmore = $parms['showmore'];\n $hdweight = $parms['hdweight'];\n $testyle = $parms['testyle'];\n global $morestyle;\n $morestyle = $parms['morestyle'];\n $warnmsg = $parms['warnmsg'];\n global $maximgwidth;\n $maximgwidth = $parms['maximgwidth'];\n $thisfeed = $parms['thisfeed']; // max posts per feed\n $timerstop = $parms['timer'];\n $dumpthis = $parms['dumpthis']; //diagnostic parameter\n $cachename = 'wprssmi_' . $thisCat;\n $cachetime = $parms['cachetime'];\n $pinterest = $parms['pinterest'];\n $parmmaxperpage = $parms['maxperpage'];\n $noimage = $parms['noimage'];\n $mytemplate = $parms['mytemplate'];\n $readable = '';\n $options = get_option('rss_import_options', 'option not found');\n $option_items = get_option('rss_import_items', 'option not found');\n $option_category_images = get_option('rss_import_categories_images', 'option not found');\n\n if ($option_items == false) return _e(\"You need to set up the WP RSS Multi Importer Plugin before any results will show here. Just go into the <a href='/wp-admin/options-general.php?page=wp_rss_multi_importer_admin'>settings panel</a> and put in some RSS feeds\", 'wp-rss-multi-importer');\n\n\n $cat_array = preg_grep(\"^feed_cat_^\", array_keys($option_items));\n\n if (count($cat_array) == 0) { // for backward compatibility\n $noExistCat = 1;\n } else {\n $noExistCat = 0;\n }\n\n\n if (!empty($option_items)) {\n\n//GET PARAMETERS\n global $RSSdefaultImage;\n $RSSdefaultImage = $options['RSSdefaultImage']; // 0- process normally, 1=use default for category, 2=replace when no image available\n $size = count($option_items);\n $sortDir = $options['sortbydate']; // 1 is ascending\n $stripAll = $options['stripAll'];\n $todaybefore = $options['todaybefore'];\n $adjustImageSize = $options['adjustImageSize'];\n $showDesc = $options['showdesc']; // 1 is show\n $descNum = $options['descnum'];\n $maxperPage = $options['maxperPage'];\n $showcategory = $options['showcategory'];\n $cacheMin = $options['cacheMin'];\n $maxposts = $options['maxfeed'];\n $showsocial = $options['showsocial'];\n $targetWindow = $options['targetWindow']; // 0=LB, 1=same, 2=new\n $floatType = $options['floatType'];\n $noFollow = $options['noFollow'];\n $showmore = $options['showmore'];\n $cb = $options['cb']; // 1 if colorbox should not be loaded\n $pag = $options['pag']; // 1 if pagination\n $perPage = $options['perPage'];\n global $anyimage;\n $anyimage = $options['anyimage'];\n $addAuthor = $options['addAuthor'];\n\n if (!is_null($defaultImage)) {\n $RSSdefaultImage = $defaultImage;\n }\n\n\n if (!is_null($showThisDesc)) {\n $showDesc = $showThisDesc;\n }\n\n if (!is_null($sortOrder)) {\n $sortDir = $sortOrder;\n }\n\n if (!is_null($pshowmore)) {\n $showmore = $pshowmore;\n }\n\n if (empty($options['sourcename'])) {\n $attribution = '';\n } else {\n $attribution = $options['sourcename'] . ': ';\n }\n\n if ($floatType == '1') {\n $float = \"left\";\n } else {\n $float = \"none\";\n }\n\n\n if ($parmfloat != '')\n $float = $parmfloat;\n\n if ($parmmaxperpage != 0)\n $maxperPage = $parmmaxperpage;\n\n if ($noimage == 1)\n $stripAll = 1;\n\n if ($thisfeed != '')\n $maxposts = $thisfeed;\n\n if ($pinterest == 1) {\n $divfloat = \"left\";\n } else {\n $divfloat = '';\n }\n\n if ($cacheMin == '') {\n $cacheMin = 0;\n } //set caching minutes\n\n\n if (!is_null($cachetime)) {\n $cacheMin = $cachetime;\n } //override caching minutes with shortcode parameter\n\n\n if (is_null($cb) && $targetWindow == 0) {\n add_action('wp_footer', 'colorbox_scripts'); // load colorbox only if not indicated as conflict\n }\n\n $template = $options['template'];\n if ($mytemplate != '') $template = $mytemplate;\n\n//\tEND PARAMETERS\n\n\n timer_start(); //TIMER START - for testing purposes\n\n\n $myarray = get_transient($cachename); // added for transient cache\n\n if ($cacheMin == 0) {\n delete_transient($cachename);\n }\n\n if (false === $myarray) { // added for transient cache - only get feeds and put into array if the array isn't cached (for a given category set)\n\n\n for ($i = 1; $i <= $size; $i = $i + 1) {\n\n\n $key = key($option_items);\n if (!strpos($key, '_') > 0) continue; //this makes sure only feeds are included here...everything else are options\n\n $rssName = $option_items[$key];\n\n\n next($option_items);\n\n $key = key($option_items);\n\n $rssURL = $option_items[$key];\n\n\n next($option_items);\n $key = key($option_items);\n\n $rssCatID = $option_items[$key]; ///this should be the category ID\n\n\n if (((!in_array(0, $catArray) && in_array($option_items[$key], $catArray))) || in_array(0, $catArray) || $noExistCat == 1) {\n\n\n $myfeeds[] = array(\"FeedName\" => $rssName, \"FeedURL\" => $rssURL, \"FeedCatID\" => $rssCatID); //with Feed Category ID\n\n\n }\n\n $cat_array = preg_grep(\"^feed_cat_^\", array_keys($option_items)); // for backward compatibility\n\n if (count($cat_array) > 0) {\n\n next($option_items); //skip feed category\n }\n\n }\n\n if ($maxposts == \"\") return _e(\"One more step...go into the the <a href='/wp-admin/options-general.php?page=wp_rss_multi_importer_admin&tab=setting_options'>Settings Panel and choose Options.</a>\", 'wp-rss-multi-importer'); // check to confirm they set options\n\n if (empty($myfeeds)) {\n\n return _e(\"You've either entered a category ID that doesn't exist or have no feeds configured for this category. Edit the shortcode on this page with a category ID that exists, or <a href=\" . $cat_options_url . \">go here and and get an ID</a> that does exist in your admin panel.\", 'wp-rss-multi-importer');\n exit;\n }\n\n\n if ($dumpthis == 1) {\n list_the_plugins();\n echo \"<strong>Feeds</strong><br>\";\n var_dump($myfeeds);\n }\n\n\n foreach ($myfeeds as $feeditem) {\n\n\n $url = (string)($feeditem[\"FeedURL\"]);\n\n\n while (stristr($url, 'http') != $url)\n $url = substr($url, 1);\n\n if (empty($url)) {\n continue;\n }\n\n\n $url = esc_url_raw(strip_tags($url));\n\n\n $feed = fetch_feed($url);\n\n\n if (is_wp_error($feed)) {\n\n if ($dumpthis == 1) {\n echo $feed->get_error_message();\n }\n if ($size < 4) {\n return _e(\"You have one feed and it's not valid. This is likely a problem with the source of the RSS feed. Contact our support forum for help.\", 'wp-rss-multi-importer');\n exit;\n\n } else {\n //echo $feed->get_error_message();\n continue;\n }\n }\n\n $maxfeed = $feed->get_item_quantity(0);\n\n if ($feedAuthor = $feed->get_author()) {\n $feedAuthor = $feed->get_author()->get_name();\n }\n\n\n//SORT DEPENDING ON SETTINGS\n\n if ($sortDir == 1) {\n\n for ($i = $maxfeed - 1; $i >= $maxfeed - $maxposts; $i--) {\n $item = $feed->get_item($i);\n if (empty($item)) continue;\n\n\n if (exclude_post($feeditem[\"FeedCatID\"], $item->get_content()) == True) continue; // FILTER\n\n if ($enclosure = $item->get_enclosure()) {\n if (!IS_NULL($item->get_enclosure()->get_thumbnail())) {\n $mediaImage = $item->get_enclosure()->get_thumbnail();\n } else if (!IS_NULL($item->get_enclosure()->get_link())) {\n $mediaImage = $item->get_enclosure()->get_link();\n }\n }\n\n\n if ($itemAuthor = $item->get_author()) {\n $itemAuthor = $item->get_author()->get_name();\n } else if (!IS_NULL($feedAuthor)) {\n $itemAuthor = $feedAuthor;\n\n }\n\n\n $myarray[] = array(\"mystrdate\" => strtotime($item->get_date()), \"mytitle\" => $item->get_title(), \"mylink\" => $item->get_link(), \"myGroup\" => $feeditem[\"FeedName\"], \"mydesc\" => $item->get_content(), \"myimage\" => $mediaImage, \"mycatid\" => $feeditem[\"FeedCatID\"], \"myAuthor\" => $itemAuthor);\n\n unset($mediaImage);\n unset($itemAuthor);\n\n }\n\n } else {\n\n for ($i = 0; $i <= $maxposts - 1; $i++) {\n $item = $feed->get_item($i);\n if (empty($item)) continue;\n\n\n if (exclude_post($feeditem[\"FeedCatID\"], $item->get_content()) == True) continue; // FILTER\n\n if ($enclosure = $item->get_enclosure()) {\n\n if (!IS_NULL($item->get_enclosure()->get_thumbnail())) {\n $mediaImage = $item->get_enclosure()->get_thumbnail();\n } else if (!IS_NULL($item->get_enclosure()->get_link())) {\n $mediaImage = $item->get_enclosure()->get_link();\n }\n }\n\n\n if ($itemAuthor = $item->get_author()) {\n $itemAuthor = $item->get_author()->get_name();\n } else if (!IS_NULL($feedAuthor)) {\n $itemAuthor = $feedAuthor;\n }\n\n\n $myarray[] = array(\"mystrdate\" => strtotime($item->get_date()), \"mytitle\" => $item->get_title(), \"mylink\" => $item->get_link(), \"myGroup\" => $feeditem[\"FeedName\"], \"mydesc\" => $item->get_content(), \"myimage\" => $mediaImage, \"mycatid\" => $feeditem[\"FeedCatID\"], \"myAuthor\" => $itemAuthor);\n\n\n unset($mediaImage);\n unset($itemAuthor);\n }\n }\n\n\n }\n\n\n if ($cacheMin !== 0) {\n set_transient($cachename, $myarray, 60 * $cacheMin); // added for transient cache\n }\n\n } // added for transient cache\n\n if ($timerstop == 1) {\n timer_stop(1);\n echo ' seconds<br>'; //TIMER END for testing purposes\n }\n\n\n// CHECK $myarray BEFORE DOING ANYTHING ELSE //\n\n if ($dumpthis == 1) {\n echo \"<br><strong>Array</strong><br>\";\n var_dump($myarray);\n exit;\n }\n if (!isset($myarray) || empty($myarray)) {\n if (!$warnmsg == 1) {\n return _e(\"There is a problem with the feeds you entered. Go to our <a href='http://www.allenweiss.com/wp_plugin'>support page</a> and we'll help you diagnose the problem.\", 'wp-rss-multi-importer');\n }\n exit;\n }\n\n global $isMobileDevice;\n if (isset($isMobileDevice) && $isMobileDevice == 1) { //open mobile device windows in new tab\n $targetWindow = 2;\n\n }\n\n\n//$myarrary sorted by mystrdate\n\n foreach ($myarray as $key => $row) {\n $dates[$key] = $row[\"mystrdate\"];\n }\n\n\n//SORT, DEPENDING ON SETTINGS\n\n if ($sortDir == 1) {\n array_multisort($dates, SORT_ASC, $myarray);\n } else {\n array_multisort($dates, SORT_DESC, $myarray);\n }\n\n// HOW THE LINK OPENS\n\n if ($targetWindow == 0) {\n $openWindow = 'class=\"colorbox\"';\n } elseif ($targetWindow == 1) {\n $openWindow = 'target=_self';\n } else {\n $openWindow = 'target=_blank';\n }\n\n $total = -1;\n $todayStamp = 0;\n $idnum = 0;\n\n//for pagination\n $currentPage = trim($_REQUEST[pg]);\n $currentURL = $_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"];\n $currentURL = str_replace('&pg=' . $currentPage, '', $currentURL);\n $currentURL = str_replace('?pg=' . $currentPage, '', $currentURL);\n\n if (strpos($currentURL, '?') == 0) {\n $currentURL = $currentURL . '?';\n } else {\n $currentURL = $currentURL . '&';\n }\n\n\n//pagination controls and parameters\n\n\n if (!isset($perPage)) {\n $perPage = 5;\n }\n\n $numPages = ceil(count($myarray) / $perPage);\n if (!$currentPage || $currentPage > $numPages)\n $currentPage = 0;\n $start = $currentPage * $perPage;\n $end = ($currentPage * $perPage) + $perPage;\n\n\n if ($pag == 1) { //set up pagination array and put into myarray\n foreach ($myarray AS $key => $val) {\n if ($key >= $start && $key < $end)\n $pagedData[] = $myarray[$key];\n }\n\n $myarray = $pagedData;\n }\n //end set up pagination array and put into myarray\n\n\n// templates checked and added here\n\n if (!isset($template) || $template == '') {\n return _e(\"One more step...go into the <a href='/wp-admin/options-general.php?page=wp_rss_multi_importer_admin&tab=setting_options'>Settings Panel and choose a Template.</a>\", 'wp-rss-multi-importer');\n }\n\n\n require(WP_RSS_MULTI_TEMPLATES . $template);\n\n\n }\n\n //pagination controls at bottom\n\n if ($pag == 1) {\n $readable .= '<div class=\"pag_box\">';\n\n if ($numPages > $currentPage && ($currentPage + 1) < $numPages)\n $readable .= '<a href=\"http://' . $currentURL . 'pg=' . ($currentPage + 1) . '\" class=\"more-prev\">' . __('Next page', 'wp-rss-multi-importer') . ' »</a>';\n //$readable .=$numPages;\n if ($currentPage > 0 && $currentPage < $numPages)\n $readable .= '<a href=\"http://' . $currentURL . 'pg=' . ($currentPage - 1) . '\" class=\"more-prev\">« ' . __('Previous page', 'wp-rss-multi-importer') . '</a>';\n\n $readable .= '</div>';\n\n }\n //end pagination controls at bottom\n\n\n return $readable;\n\n}", "function head_cleanup() {\n\t// Originally from http://wpengineer.com/1438/wordpress-header/\n\tremove_action( 'wp_head', 'feed_links_extra', 3 );\n\tadd_action( 'wp_head', 'ob_start', 1, 0 );\n\tadd_action( 'wp_head', function () {\n\t\t$pattern = '/.*' . preg_quote( esc_url( get_feed_link( 'comments_' . get_default_feed() ) ), '/' )\n\t\t . '.*[\\r\\n]+/';\n\t\techo preg_replace( $pattern, '', ob_get_clean() );\n\t}, 3, 0 );\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );\n\tremove_action( 'wp_head', 'wp_generator' );\n\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10 );\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n\tremove_action( 'wp_head', 'wp_oembed_add_host_js' );\n\tremove_action( 'wp_head', 'rest_output_link_wp_head', 10 );\n\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n\tremove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\tadd_filter( 'use_default_gallery_style', '__return_false' );\n\tadd_filter( 'emoji_svg_url', '__return_false' );\n\n\tglobal $wp_widget_factory;\n\n\tif ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) {\n\t\tremove_action( 'wp_head',\n\t\t [ $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ] );\n\t}\n\n\tif ( ! class_exists( 'WPSEO_Frontend' ) ) {\n\t\tremove_action( 'wp_head', 'rel_canonical' );\n\t\tadd_action( 'wp_head', __NAMESPACE__ . '\\\\rel_canonical' );\n\t}\n}", "function sunset_remove_wp_version_strings($src){\n global $wp_version;\n parse_str(parse_url($src,PHP_URL_QUERY),$query);\n if (!empty($query['ver']) && $query['ver'] === $wp_version){\n $src = remove_query_arg('ver',$src);\n }\n return $src;\n}", "function wp_widget_rss_output($rss, $args = array())\n {\n }", "function wpcom_vip_disable_enhanced_feeds() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function wp_widget_rss_process($widget_rss, $check_feed = \\true)\n {\n }", "function spartan_head_cleanup() {\n\t// EditURI link\n\tremove_action( 'wp_head', 'rsd_link' );\n\t// windows live writer\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t// index link\n\tremove_action( 'wp_head', 'index_rel_link' );\n\t// previous link\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\t// start link\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t// links for adjacent posts\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\t// WP version\n\tremove_action( 'wp_head', 'wp_generator' );\n // remove WP version from css\n add_filter( 'style_loader_src', 'spartan_remove_wp_ver_css_js', 9999 );\n // remove Wp version from scripts\n add_filter( 'script_loader_src', 'spartan_remove_wp_ver_css_js', 9999 );\n\n}", "function bloginfo_rss($show = '')\n {\n }", "function manofbytes_hide_wp_version() {\n\treturn '';\n}", "function the_title_rss()\n {\n }", "function fs_head_cleanup() {\r\n\t// Originally from http://wpengineer.com/1438/wordpress-header/\r\n\tremove_action( 'wp_head', 'feed_links', 2 );\r\n\tremove_action( 'wp_head', 'feed_links_extra', 3 );\r\n\tremove_action( 'wp_head', 'rsd_link' );\r\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\r\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\r\n\tremove_action( 'wp_head', 'wp_generator' );\r\n\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\r\n\r\n\tglobal $wp_widget_factory;\r\n\tremove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );\r\n\r\n\tadd_filter( 'use_default_gallery_style', '__return_null' );\r\n}", "function wp_folksonomy_rss_feed() {\n\tglobal $wpdb;\n\t$tags = $wpdb->get_results(\"SELECT * FROM \".WP_FOLKSONOMY_TABLE.\" ORDER BY tag_datetime DESC LIMIT \". WP_FOLKSONOMY_RSS_LIMIT);\n\theader('Content-type: text/xml; charset=' . get_option('blog_charset'), true);\n\techo '<?xml version=\"1.0\" encoding=\"'.get_option('blog_charset').'\"?'.'>';\n?>\n<rss version=\"2.0\" \n\txmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n\txmlns:wfw=\"http://wellformedweb.org/CommentAPI/\"\n\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n>\n\n<channel>\n\t<title><?php echo __('Tag Report for: ','wp_folksonomy'); bloginfo_rss('name'); ?></title>\n\t<link><?php bloginfo_rss('url') ?></link>\n\t<description><?php bloginfo_rss(\"description\") ?></description>\n\t<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>\n\t<generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>\n\t<language><?php echo get_option('rss_language'); ?></language>\n<?php\n\t\tif (count($tags) > 0) {\n\t\t\tforeach ($tags as $tag) {\n\t\t\t\t$term=get_term($tag->term_id,'post_tag');\n\t\t\t\t$post=get_post($tag->object_id);\n\t\t\t\t$deletelink='(<a href=\"options-general.php?page=wp_folksonomy.php&action=delete&ask=true&tag='.$tag->term_id.'&post='.$tag->object_id.'\">'.__('Delete','wp_folksonomy').'</a>)';\n\t\t\t\tif($tag->status=='WAIT') $approvelink='(<a href=\"options-general.php?page=wp_folksonomy.php&action=approve&tag='.$tag->term_id.'&post='.$tag->object_id.'\">'.__('Approve','wp_folksonomy').'</a>)';\n\t\t\t\telse $approvelink=''; \n\t\t\t\t\n\t\t\t\t$content = '\n\t\t\t\t\t<p>'.__('Tag added: ', 'wp_folksonomy').'<a href=\"'.get_tag_link($tag->term_id).'\" rel=\"tag\">'.$term->name.'</a></p>\n\t\t\t\t\t<p>'.__('Post: ', 'wp_folksonomy').' <a href=\"'.get_permalink($post->ID).'\">'.$post->post_title.'</a></p>\n\t\t\t\t\t<p>'.$deletelink.' '.$approvelink.'</p>\n\t\t\t\t';\n?>\n\t<item>\n\t\t<title><![CDATA[<?php echo $term->name; ?>]]></title>\n\t\t<link><![CDATA[<?php echo get_tag_link($tag->term_id); ?>]]></link>\n\t\t<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', $tag->tag_datetime, false); ?></pubDate>\n\t\t<guid isPermaLink=\"false\"><?php print($tag->id); ?></guid>\n\t\t<description><![CDATA[<?php echo $content; ?>]]></description>\n\t\t<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>\n\t</item>\n<?php $items_count++; if (($items_count == get_option('posts_per_rss')) && !is_date()) { break; } } } ?>\n</channel>\n</rss>\n<?php\n\t\tdie();\n}", "function flex_head_cleanup() {\r\n\t// Remove category feeds\r\n remove_action( 'wp_head', 'feed_links_extra', 3 );\r\n\t// Remove post and comment feeds\r\n remove_action( 'wp_head', 'feed_links', 2 );\r\n\t// Remove EditURI link\r\n\tremove_action( 'wp_head', 'rsd_link' );\r\n\t// Remove Windows live writer\r\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\r\n\t// Remove index link\r\n\tremove_action( 'wp_head', 'index_rel_link' );\r\n\t// Remove previous link\r\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\r\n\t// Remove start link\r\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\r\n\t// Remove links for adjacent posts\r\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\r\n\t// Remove WP version\r\n\tremove_action( 'wp_head', 'wp_generator' );\r\n}", "function wfs_remove_meta_version() {\n\treturn '';\n}", "function bajweb_remove_wp_version_strings( $src ) {\n\n\tglobal $wp_version;\n\tparse_str( parse_url($src, PHP_URL_QUERY), $query );\n\tif ( !empty( $query['ver'] ) && $query['ver'] === $wp_version ) {\n\t\t$src = remove_query_arg( 'ver', $src );\n\t}\n\treturn $src;\n\n}", "function gigx_dashboard_widget_function(){\n ?>\n <p>Enjoy your new website. If you've got any questions or encounter any bugs, please contact me at <a href=\"mailto:[email protected]\">[email protected]</a>.\n I will add a list of useful links and tutorials below, as well as any messages about updates.<br/><a href=\"http://axwax.de\" target=\"_blank\">Axel</a></p> \n <?php wp_widget_rss_output('http://www.axwax.de/category/support/history/feed/', array('items' => 5, 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1));\n}", "function lastcomments_rssfeed() {\r\n\r\n\tglobal $SUPRESS_TEMPLATE_SHOW, $SUPRESS_MAINBLOCK_SHOW, $CurrentHandler;\r\n\t// Action if rssfeed is enabled\r\n\tif (pluginGetVariable('lastcomments', 'rssfeed') && !(checkLinkAvailable('lastcomments', 'rss') && $CurrentHandler['handlerParams']['value']['pluginName'] == 'core')) {\r\n\t\t// Hide Template\r\n\t\t$SUPRESS_TEMPLATE_SHOW = true;\r\n\t\t$SUPRESS_MAINBLOCK_SHOW = true;\r\n\t\t// Disable index actions\r\n\t\tactionDisable(\"index\");\r\n\t\tactionDisable(\"index_pre\");\r\n\t\tactionDisable(\"index_post\");\r\n\t\t// launch rss\r\n\t\techo lastcomments(2);\r\n\t} else {\r\n\t\terror404();\r\n\t}\r\n}", "function the_excerpt_rss()\n {\n }", "function ti_wp_foundation_theme_head_cleanup() {\n\t// Remove category feeds\n\t// remove_action( 'wp_head', 'feed_links_extra', 3 );\n\t// Remove post and comment feeds\n\t// remove_action( 'wp_head', 'feed_links', 2 );\n\t// Remove EditURI link\n\tremove_action( 'wp_head', 'rsd_link' );\n\t// Remove Windows live writer\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t// Remove index link\n\tremove_action( 'wp_head', 'index_rel_link' );\n\t// Remove previous link\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\t// Remove start link\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t// Remove links for adjacent posts\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\t// Remove WP version\n\tremove_action( 'wp_head', 'wp_generator' );\n}", "function mdwpfp_init_markup_cleanup() {\n add_action('init', 'mdwpfp_head_cleanup');\n\n // Remove WP version from the RSS feed.\n add_filter('the_generator', 'mdwpfp_rss_version');\n\n // Clean the WP generated code around images.\n add_filter('the_content', 'mdwpfp_filter_ptags_on_images');\n\n // Remove pesky injected css for recent comments widget.\n add_filter('wp_head', 'mdwpfp_remove_wp_widget_recent_comments_style', 1);\n // Clean up injected comment styles in the <head>.\n add_action('wp_head', 'mdwpfp_remove_recent_comments_style', 1);\n\n // Clean the default WP photo gallery output.\n add_filter('gallery_style', 'mdwpfp_gallery_style');\n\n}", "function wpb_remove_version() {\nreturn '';\n}", "function rss()\n\t{\n\t\tglobal $prefs,$txpac;\n\t\textract($prefs);\n\t\tob_start();\n\n\t\textract(doSlash(gpsa(array('category','section','limit','area'))));\n\n\t\t// send a 304 if nothing has changed since the last visit\n\t\n\t\t$last = fetch('unix_timestamp(val)','txp_prefs','name','lastmod');\n\t\t$last = gmdate(\"D, d M Y H:i:s \\G\\M\\T\",$last);\n\t\theader(\"Last-Modified: $last\");\n\t\t$hims = serverset('HTTP_IF_MODIFIED_SINCE');\n\t\tif ($hims == $last) {\n\t\t\theader(\"HTTP/1.1 304 Not Modified\"); exit; \n\t\t}\n\t\t\n\t\t$area = gps('area');\n\n\t\t$sitename .= ($section) ? ' - '.$section : '';\n\t\t$sitename .= ($category) ? ' - '.$category : '';\n\n\t\t$out[] = tag(doSpecial($sitename),'title');\n\t\t$out[] = tag('http://'.$siteurl.$path_from_root,'link');\n\t\t$out[] = tag(doSpecial($site_slogan),'description');\n\n\t\tif (!$area or $area=='article') {\n\t\t\t\t\t\n\t\t\t$sfilter = ($section) ? \"and Section = '\".$section.\"'\" : '';\n\t\t\t$cfilter = ($category) \n\t\t\t\t? \"and (Category1='\".$category.\"' or Category2='\".$category.\"')\":'';\n\t\t\t$limit = ($limit) ? $limit : '5';\n\t\t\n\t\t\t\t$frs = safe_column(\"name\", \"txp_section\", \"in_rss != '1'\");\n\t\t\t\tif ($frs) foreach($frs as $f) $query[] = \"and Section != '\".$f.\"'\";\n\t\t\t$query[] = $sfilter;\n\t\t\t$query[] = $cfilter;\n\t\t\t\n\t\t\t$rs = safe_rows(\n\t\t\t\t\"*\", \n\t\t\t\t\"textpattern\", \n\t\t\t\t\"Status = 4 \".join(' ',$query).\n\t\t\t\t\"and Posted < now() order by Posted desc limit $limit\"\n\t\t\t);\n\t\t\t\t\n\t\t\tif($rs) {\n\t\t\t\tforeach ($rs as $a) {\n\t\t\t\t\textract($a);\n\t\t\t\t\t$Body = (!$txpac['syndicate_body_or_excerpt']) ? $Body_html : $Excerpt;\n\t\t\t\t\t$Body = (!trim($Body)) ? $Body_html : $Body;\n\t\t\t\t\t$Body = str_replace('href=\"/','href=\"http://'.$siteurl.'/',$Body);\n\t\t\t\t\t$Body = htmlspecialchars($Body,ENT_NOQUOTES);\n\t\n\t\t\t\t\t$link = ($url_mode==0)\n\t\t\t\t\t?\t'http://'.$siteurl.$path_from_root.'index.php?id='.$ID\n\t\t\t\t\t:\t'http://'.$siteurl.$path_from_root.$Section.'/'.$ID.'/';\n\t\t\n\t\t\t\t\tif ($txpac['show_comment_count_in_feed']) {\n\t\t\t\t\t\t$dc = getCount('txp_discuss', \"parentid=$ID and visible=1\");\n\t\t\t\t\t\t$count = ($dc > 0) ? ' ['.$dc.']' : '';\n\t\t\t\t\t} else $count = '';\n\n\t\t\t\t\t$Title = doSpecial($Title).$count;\n\n\t\t\t\t\t$item = tag(strip_tags($Title),'title').n.\n\t\t\t\t\t\ttag($Body,'description').n.\n\t\t\t\t\t\ttag($link,'link');\n\t\n\t\t\t\t\t$out[] = tag($item,'item');\n\t\t\t\t}\n\t\n\t\t\theader(\"Content-Type: text/xml\"); \n\t\t\treturn '<rss version=\"0.92\">'.tag(join(n,$out),'channel').'</rss>';\n\t\t\t}\n\t\t} elseif ($area=='link') {\n\t\t\t\t\n\t\t\t$cfilter = ($category) ? \"category='$category'\" : '1';\n\t\t\t$limit = ($limit) ? $limit : 15;\n\n\t\t\t$rs = safe_rows(\"*\", \"txp_link\", \"$cfilter order by date desc limit $limit\");\n\t\t\n\t\t\tif ($rs) {\n\t\t\t\tforeach($rs as $a) {\n\t\t\t\t\textract($a);\n\t\t\t\t\t$item = \n\t\t\t\t\t\ttag(doSpecial($linkname),'title').n.\n\t\t\t\t\t\ttag(doSpecial($description),'description').n.\n\t\t\t\t\t\ttag($url,'link');\n\t\t\t\t\t$out[] = tag($item,'item');\n\t\t\t\t}\n\t\t\t\theader(\"Content-Type: text/xml\"); \n\t\t\t\treturn '<rss version=\"0.92\">'.tag(join(n,$out),'channel').'</rss>';\n\t\t\t}\n\t\t}\n\t\treturn 'no articles recorded yet';\n\t}", "function cardealer_head_cleanup() {\r\n\tadd_filter( 'style_loader_src', 'cardealer_remove_wp_ver_css_js', 9999 ); // remove WP version from css\r\n\tadd_filter( 'script_loader_src', 'cardealer_remove_wp_ver_css_js', 9999 ); // remove WP version from scripts\r\n}", "function bones_head_cleanup()\n{\n\t// category feeds\n\tremove_action('wp_head', 'feed_links_extra', 3);\n\t// post and comment feeds\n\tremove_action('wp_head', 'feed_links', 2);\n\t// EditURI link\n\tremove_action('wp_head', 'rsd_link');\n\t// windows live writer\n\tremove_action('wp_head', 'wlwmanifest_link');\n\t// previous link\n\tremove_action('wp_head', 'parent_post_rel_link', 10, 0);\n\t// start link\n\tremove_action('wp_head', 'start_post_rel_link', 10, 0);\n\t// links for adjacent posts\n\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\t// WP version\n\tremove_action('wp_head', 'wp_generator');\n\n\tremove_action('wp_head', 'print_emoji_detection_script', 7); // no php needed above it\n\tremove_action('wp_print_styles', 'print_emoji_styles');\n\tremove_action('admin_print_scripts', 'print_emoji_detection_script');\n\tremove_action('admin_print_styles', 'print_emoji_styles'); // php is not closed in the last line\n\n\t// remove WP version from css\n\tadd_filter('style_loader_src', 'bones_remove_wp_ver_css_js', 9999);\n\t// remove Wp version from scripts\n\tadd_filter('script_loader_src', 'bones_remove_wp_ver_css_js', 9999);\n}", "function wpfc_podcast_add_head(){\n\t\n\tremove_filter('the_content', 'add_wpfc_sermon_content');\n\n\t$settings = get_option('wpfc_options'); ?>\n\t<copyright><?php echo esc_html( $settings['copyright'] ) ?></copyright>\n\t<itunes:subtitle><?php echo esc_html( $settings['itunes_subtitle'] ) ?></itunes:subtitle>\n\t<itunes:author><?php echo esc_html( $settings['itunes_author'] ) ?></itunes:author>\n\t<?php $category_description = category_description();\n\tif ( ! empty( $category_description ) ) { ?>\n\t\t<itunes:summary><?php echo wp_filter_nohtml_kses( $category_description ); ?></itunes:summary>\n\t<?php } else{ ?>\n\t\t<itunes:summary><?php echo wp_filter_nohtml_kses( $settings['itunes_summary'] ) ?></itunes:summary>\n\t<?php } ?>\t\t\n\t<itunes:owner>\n\t\t<itunes:name><?php echo esc_html( $settings['itunes_owner_name'] ) ?></itunes:name>\n\t\t<itunes:email><?php echo esc_html( $settings['itunes_owner_email'] ) ?></itunes:email>\n\t</itunes:owner>\n\t<itunes:explicit>no</itunes:explicit>\n\t<?php //Show the taxonomy image if there is one\n\t$image_url = apply_filters( 'sermon-images-queried-term-image-url', '' ); \n\tif ($image_url) { ?>\n\t\t<itunes:image href=\"<?php echo $image_url ?>\" />\n\t<?php } else { //otherwise, show the image from the podcast settings ?>\n\t\t<itunes:image href=\"<?php echo esc_url( $settings['itunes_cover_image'] ) ?>\" />\n\t<?php } ?>\n\t<itunes:category text=\"<?php echo esc_attr( $settings['itunes_top_category'] ) ?>\">\n\t\t<itunes:category text=\"<?php echo esc_attr( $settings['itunes_sub_category'] ) ?>\"/>\n\t</itunes:category>\n\t<?php\n}", "function wpb_remove_version() {\r\n return '';\r\n}", "function clean_feeds() {\r\n\t\t//var_dump($this->file);\r\n\t\tif(strpos($this->code, '<feed xmlns=\"http://www.w3.org/2005/Atom\"') === false && strpos($this->code, '<feed xmlns=\"https://www.w3.org/2005/Atom\"') === false) { // this is not a feed file\r\n\t\t\r\n\t\t} else {\r\n\t\t\tinclude_once('feed_generator' . DS . 'FeedWriter.php');\r\n\t\t\t//include('feed_generator' . DS . 'FeedWriter.php');\r\n\t\t\t$changed_feed_file = false;\r\n\t\t\t$TestFeed = new FeedWriter(ATOM);\r\n\t\t\t\r\n\t\t\t$feed_pos = strpos($this->code, '<feed');\r\n\t\t\t$first_entry_pos = strpos($this->code, '<entry');\r\n\t\t\t$header_code = substr($this->code, $feed_pos, $first_entry_pos - $feed_pos);\r\n\t\t\tpreg_match_all('/<id[^<>]*?>(.*?)<\\/id>/is', $header_code, $id_matches);\r\n\t\t\t//print('$id_matches: ');var_dump($id_matches);exit(0);\r\n\t\t\tif(sizeof($id_matches[0]) === 1) {\r\n\t\t\t\t$current_id = $id_matches[1][0];\r\n\t\t\t} else {\r\n\t\t\t\tprint('Found other than one ID in Atom RSS header...');var_dump($header_code);exit(0);\r\n\t\t\t}\r\n\t\t\tpreg_match_all('/<link[^<>]*? href=\"([^\"]*?)\"[^<>]*?>(.*?)<\\/link>/is', $header_code, $link_matches);\r\n\t\t\tif(sizeof($id_matches[0]) === 1) {\r\n\t\t\t\t$current_link = $link_matches[1][0];\r\n\t\t\t} else { // we have to be a bit more clever\r\n\t\t\t\t$found_default_link = false;\r\n\t\t\t\tforeach($link_matches[0] as $index => $value) {\r\n\t\t\t\t\tif(strpos($link_matches[0][$index], 'rel=\"self\"') !== false) {\r\n\t\t\t\t\t\t$found_default_link = true;\r\n\t\t\t\t\t\t$current_link = $link_matches[1][$index];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($found_default_link) {\r\n\t\t\t\t\tprint('Could not find default link for Atom RSS feed file...');var_dump($header_code);exit(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$generated_id = $TestFeed->uuid($current_link, 'urn:uuid:');\r\n\t\t\tif($generated_id !== $current_id) {\r\n\t\t\t\t$this->code = str_replace($current_id, $generated_id, $this->code);\r\n\t\t\t\t$this->logMsg('Feed file ID with link: ' . $current_link . ' was changed.');\r\n\t\t\t\t$changed_feed_file = true;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tpreg_match_all('/<entry(.*?)<\\/entry>/is', $this->code, $entry_matches);\r\n\t\t\t$counter = sizeof($entry_matches[0]) - 1;\r\n\t\t\twhile($counter > -1) {\r\n\t\t\t\t$entry_match = $initial_entry_match = $entry_matches[0][$counter];\r\n\t\t\t\tpreg_match_all('/<id[^<>]*?>(.*?)<\\/id>/is', $entry_match, $id_matches);\r\n\t\t\t\tif(sizeof($id_matches[0]) === 1) {\r\n\t\t\t\t\t$current_id = $id_matches[1][0];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprint('Found other than one ID in an Atom RSS entry...');var_dump($entry_match);exit(0);\r\n\t\t\t\t}\r\n\t\t\t\tpreg_match_all('/<link[^<>]*? href=\"([^\"]*?)\"[^<>]*?>(.*?)<\\/link>/is', $entry_match, $link_matches);\r\n\t\t\t\tif(sizeof($id_matches[0]) === 1) {\r\n\t\t\t\t\t$current_link = $link_matches[1][0];\r\n\t\t\t\t} else { // we have to be a bit more clever\r\n\t\t\t\t\t$found_default_link = false;\r\n\t\t\t\t\tforeach($link_matches[0] as $index => $value) {\r\n\t\t\t\t\t\tif(strpos($link_matches[0][$index], 'rel=\"self\"') !== false) {\r\n\t\t\t\t\t\t\t$found_default_link = true;\r\n\t\t\t\t\t\t\t$current_link = $link_matches[1][$index];\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($found_default_link) {\r\n\t\t\t\t\t\tprint('Could not find default link for an Atom RSS entry...');var_dump($entry_match);exit(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$generated_id = $TestFeed->uuid($current_link, 'urn:uuid:');\r\n\t\t\t\tif($generated_id !== $current_id) {\r\n\t\t\t\t\t//var_dump($generated_id, $current_id);\r\n\t\t\t\t\t//print('current_id: ');var_dump($current_id);\r\n\t\t\t\t\t//print('generated_id: ');var_dump($generated_id);\r\n\t\t\t\t\t$entry_match = str_replace($current_id, $generated_id, $entry_match);\r\n\t\t\t\t\t$this->logMsg('ID on entry with link: ' . $current_link . ' was changed.');\r\n\t\t\t\t}/* else {\r\n\t\t\t\t\tprint('hi3740650056<br>');\r\n\t\t\t\t}*/\r\n\t\t\t\t//print('here37485969707<br>');\r\n\t\t\t\tif($entry_match != $initial_entry_match) {\r\n\t\t\t\t\t//print('here37485969708<br>');\r\n\t\t\t\t\t$this->code = str_replace($initial_entry_match, $entry_match, $this->code);\r\n\t\t\t\t\t$changed_feed_file = true;\r\n\t\t\t\t}\r\n\t\t\t\t$counter--;\r\n\t\t\t}\r\n\t\t\t//print('here37485969709<br>');\r\n\t\t\tif($changed_feed_file) {\r\n\t\t\t\t//print('here37485969710<br>');\r\n\t\t\t\t//var_dump(date(\"Y-m-d\"), time(\"Y-m-d\"));\r\n\t\t\t\t$this->code = preg_replace('/<feed([^<>]*?)>(.*?)<updated>([0-9]{4})\\-([0-9]{2})\\-([0-9]{2})([^<>]*?)<\\/updated>/is', '<feed$1>$2<updated>' . date(\"Y-m-d\") . '$6</updated>', $this->code);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function html_type_rss()\n {\n }", "function fabric_head_cleanup() {\n // Originally from http://wpengineer.com/1438/wordpress-header/\n remove_action('wp_head', 'feed_links', 2);\n remove_action('wp_head', 'feed_links_extra', 3);\n remove_action('wp_head', 'rsd_link');\n remove_action('wp_head', 'wlwmanifest_link');\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n remove_action('wp_head', 'wp_generator');\n remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);\n\n global $wp_widget_factory;\n remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style'));\n\n if (!class_exists('WPSEO_Frontend')) {\n remove_action('wp_head', 'rel_canonical');\n add_action('wp_head', 'fabric_rel_canonical');\n }\n}", "function do_feed_rss()\n {\n }", "function jeg_rss_request($qv) {\n if (isset($qv['feed']) && !isset($qv['post_type']))\n $qv['post_type'] = array('post', 'portfolio');\n return $qv;\n}", "function remove_non_rss(string $html): string\n{\n $html = preg_replace('%<script.*?>.*?</script>%is', '', $html);\n $html = preg_replace('%<a href=\"#.*?>(.*?)</a>%is', '$1', $html);\n $html = preg_replace('%<a href=\"javascript.*?>(.*?)</a>%is', '$1', $html);\n return $html;\n}", "function deactivate_plugins_rss_feed() {\n\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class-plugins_rss_feed-deactivator.php';\n\tPlugins_rss_feed_Deactivator::deactivate();\n}", "public function wp_head_cleanup() {\n\n\t\t//Remove header links\n\t\tremove_action( 'wp_head', 'feed_links_extra', 3 ); // Category Feeds\n\t\tremove_action( 'wp_head', 'feed_links', 2 ); // Post and Comment Feeds\n\t\tremove_action( 'wp_head', 'rsd_link' ); // EditURI link\n\t\tremove_action( 'wp_head', 'wlwmanifest_link' ); // Windows Live Writer\n\t\tremove_action( 'wp_head', 'index_rel_link' ); // index link\n\t\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // previous link\n\t\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link\n\t\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); // Links for Adjacent Posts\n\t\tremove_action( 'wp_head', 'wp_generator' ); // WP version\n\n\t\t//Remove emoji garbage\n\t\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\t\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\t\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\t\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\t\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n\t\tremove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\t\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\t\tadd_filter( 'tiny_mce_plugins', array($this, 'disable_emojis_tinymce') );\n\n\t\tif( !is_admin() && !function_exists('get_current_screen') ) {\n\t\t\twp_deregister_script('jquery'); // De-Register jQuery\n\t\t\twp_register_script('jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js', '', '3.4.1', false);\n\t\t}\n\n\t}", "function ticketbud_widget_process( $widget_rss, $check_feed = true ) {\n\t$items = (int) $widget_rss['items'];\n\tif ( $items < 1 || 20 < $items )\n\t\t$items = 10;\n\t$url = esc_url_raw(strip_tags( $widget_rss['url'] ));\n\t$title = trim(strip_tags( $widget_rss['title'] ));\n\t$show_summary = isset($widget_rss['show_summary']) ? (int) $widget_rss['show_summary'] : 0;\n\t$show_author = isset($widget_rss['show_author']) ? (int) $widget_rss['show_author'] :0;\n\t$show_date = isset($widget_rss['show_date']) ? (int) $widget_rss['show_date'] : 0;\n\t$show_poweredby= isset($widget_rss['show_poweredby']) ? (int) $widget_rss['show_poweredby'] :0;\n\n\n\tif ( $check_feed ) {\n\t\t$rss = fetch_feed($url);\n\t\t$error = false;\n\t\t$link = '';\n\t\tif ( is_wp_error($rss) ) {\n\t\t\t$error = $rss->get_error_message();\n\t\t} else {\n\t\t\t$link = esc_url(strip_tags($rss->get_permalink()));\n\t\t\twhile ( stristr($link, 'http') != $link )\n\t\t\t\t$link = substr($link, 1);\n\n\t\t\t$rss->__destruct();\n\t\t\tunset($rss);\n\t\t}\n\t}\n\n\treturn compact( 'title', 'url', 'link', 'items', 'error', 'show_summary', 'show_author', 'show_date', 'show_poweredby' );\n}", "function sunset_remove_meta_version(){\n return '' ;\n}", "function remove_src_version ( $src ) {\r\n\tglobal $wp_version;\r\n\t$version_str = '?ver='.$wp_version;\r\n\t$version_str_offset = strlen( $src ) - strlen( $version_str );\r\n\tif( substr( $src, $version_str_offset ) == $version_str )\r\n\t$src = substr( $src, 0, $version_str_offset ) . '?' . filemtime( __FILE__ );\r\n\treturn $src;\r\n}", "function bajweb_remove_meta_version() {\n\treturn '';\n}", "function Sandy_RSS_List($feed, $filter, $num, $ltime, $list, $target, $pubdate, $pubtime, $dformat, $tformat, $pubauthor, $excerpt, $charex, $chartle, $sort, $cachefeed) {\r\n\r\n\tinclude_once(ABSPATH . WPINC . '/feed.php');\r\n\r\n\t// set cache recreation frequency (in seconds)\r\n\tadd_filter( 'wp_feed_cache_transient_lifetime' , create_function( '$a', 'return '.$cachefeed.';' ) );\r\n\r\n\t// unset cache recreation frequency\r\n\t// remove_filter( 'wp_feed_cache_transient_lifetime' , create_function( '$a', 'return 42300;' ) );\r\n\r\n\t// decoding needed when you use a shortcode as URLs are encoded by the shortcode\r\n\t$feed = html_entity_decode($feed); \r\n\r\n\t// fetch feed using simplepie. Returns a standard simplepie object\r\n\t$rss = fetch_feed($feed);\r\n\r\n\t// Checks that the object is created correctly \r\n\tif (is_wp_error( $rss )) \r\n\t\t$flist = \"<br />Ooops...this plugin cannot read your feed at this time. The error message is: <b><i>\" . $rss->get_error_message() . \"</i></b>.<br>It might be temp. not available or - if you use it for the first time - you might have mistyped the url or a misformatted RSS or Atom feed is present.<br>Please, check if your browser can read it instead: <a target='_blank' href='$feed'>$feed</a>.<br> If yes, contact me at stefonthenet AT gmail DOT com with your RSS or Atom feed URL and the shortcode or widget params you want to use it with; if not, contact the feed URL provider.<br>\";\r\n\r\n\telse {\r\n\r\n \t\t// Figure out how many total items there are, but limit it to the given param $num. \r\n\r\n\t\t$nitems = $rss->get_item_quantity($num);\r\n\r\n\t\tif ($nitems == 0) $flist = \"<li>No items found in feed URL: $feed.</li>\";\r\n\r\n\t\telse {\r\n\r\n\r\n\t\t// Build an array of all the items, starting with element 0 (first element).\r\n\r\n\t\t$rss_items = $rss->get_items(0, $nitems); \r\n\r\n\r\n\r\n\t\t// Sort by title\r\n\r\n\t\tif (filter_var($sort, FILTER_VALIDATE_BOOLEAN)) asort($rss_items); \r\n\r\n\t\t$flist = \"<$list>\";\r\n\r\n\t\tforeach ( $rss_items as $item ) {\r\n\r\n\t\t\t// get title from feed\r\n\r\n\t\t\t$title = esc_html( $item->get_title() );\r\n\r\n\t\t\t$exclude = false;\r\n\r\n\t\t\t$include = 0;\r\n\r\n\t\t\t$includetest = false;\r\n\r\n\t\t\tif ($filter) {\r\n\r\n\t\t\t\t$aword = explode( ' ' , $filter );\r\n\r\n\t\t\t\t// count occurences of each $ainclude element in $title\r\n\r\n\t\t\t\tforeach ( $aword as $word ) {\r\n\r\n\t\t\t\t\tif ( substr($word,0,1) == \"-\" ) {\r\n\r\n\t\t\t\t\t\t// this word needs to be excluded as it starts with a -\r\n\r\n\t\t\t\t\t\tstripos( $title, substr($word,1) )===false?$exclude=false:$exclude=true;\r\n\r\n\t\t\t\t\t\t// if it finds the word that excludes the item, then breaks the loop\r\n\r\n\t\t\t\t\t\tif ($exclude) break;\r\n\r\n\r\n\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t$includetest=true;\r\n\r\n\t\t\t\t\t\t// this word needs to be included\r\n\r\n\t\t\t\t\t\tif ( stripos( $title, $word )!==false) $include++;\r\n\r\n\t\t\t\t\t\t// if it finds the word that includes the item, then set the nclusion variable\r\n\r\n\t\t\t\t\t\t// i cannot break the look as i might still find exclusion words \r\n\r\n\t\t\t\t\t}\r\n\r\n \t\t\t\t}\r\n\r\n\t\t\t} // if ($filter)\r\n\r\n\r\n\t\t\t// either (at least one occurrence of searched words is found AND no excluded words is found)\r\n\r\n\t\t\tif ( !$exclude AND ($includetest===false or $include>0) ) {\r\n\t\t\tif ( $ltime==='' OR ($ltime>'' AND (time() < strtotime(\"+$ltime minutes\", strtotime($item->get_date()))) ) ) \t\t{\r\n\r\n\t\t\t\t// get description from feed\r\n\t\t\t\t$desc = esc_html( $item->get_description() );\r\n\t\t\t\t$flist .= '<li> ';\r\n\r\n\t\t\t\t// get title from feed\r\n\t\t\t\t$title = cdataize( $item->get_title() );\r\n\r\n\t\t\t\t// get description from feed\r\n\t\t\t\t$desc = cdataize( $item->get_description() );\r\n\r\n\t\t\t\t// sanitize title and description\r\n\t\t\t\t$title = sanitxt( $title );\r\n\r\n\t\t\t\t$desc = sanitxt( $desc );\r\n\r\n\t\t\t\tif ($chartle>=1) $title=substr($title, 0, $chartle).'...';\r\n\r\n\t\t\t\tif ( $title || $desc ) {\r\n\r\n\t\t\t\t\tif ( $item->get_permalink() ) {\r\n\r\n\t\t\t\t\t$permalink = esc_url( $item->get_permalink() );\r\n\r\n\t\t\t\t \t$motext = isset( $desc ) ? $desc : $title;\r\n\r\n\t\t\t\t \t// writes the link\r\n\t\t\t\t\t$flist .= \"<p class='rss-headline'><a target='$target' href='$permalink'\";\r\n\t\t\t\t\tif (!filter_var($excerpt, FILTER_VALIDATE_BOOLEAN)) $flist .= \" title='\".substr($motext,0,400).\"...'\";\r\n\t\t\t\t\t$flist .= \">\";\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// writes the title\r\n\t\t\t\t\t$flist .= isset( $title ) ? $title : $motext;\r\n\r\n\t\t\t\t\t// end the link (anchor tag)\r\n\t\t\t\t\tif ( $permalink ) $flist .= '</a></p>'; \r\n\r\n\t\t\t\t\tif ( $item->get_date() ) {\r\n\t\t\t\t\t\t$datim = strtotime( $item->get_date() );\r\n\t\t\t\t\t\tif ( filter_var($pubdate, FILTER_VALIDATE_BOOLEAN) ) {\r\n\r\n\t\t\t\t\t\t\tif (empty($dformat)) $dformat = get_option('date_format');\r\n\r\n\t\t\t\t\t\t\t// $flist .= ' - ' . date( $dformat, $datim );\r\n\t\t\t\t\t\t\t$flist .= '<p><time>' . date_i18n( $dformat, $datim ) . '</time></p>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\r\n\r\n \t\t\t\tif ( filter_var($pubtime, FILTER_VALIDATE_BOOLEAN) ) {\r\n\r\n\t\t\t\t\t\t\tif (empty($tformat)) $tformat = get_option('time_format');\r\n\r\n\t\t\t\t\t\t\t$flist .= ' at ' . date ( $tformat, $datim ); \r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\t\tif ($desc && filter_var($excerpt, FILTER_VALIDATE_BOOLEAN)) {\r\n\r\n\t\t\t\t\t\tif ( $charex >= 1 && $charex<strlen($desc) ) { \r\n\r\n\t\t\t\t\t\t\t$flist .= '<p class=\"rss-meta\">' . substr($motext, 0, $charex) . \" [<a target='$target' href='$permalink'>...</a>]</p>\";\r\n\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t$flist .= '' . $motext;\r\n\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t$flist .= '<li>No standard <item> in file.';\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$flist .= '</li>';\r\n\t\t\t} // if ($ltime...)\r\n\t\t\t} // if ($exclude...)\r\n\r\n\t\t} // foreach\r\n\r\n\t\t$flist .= \"</$list>\\n\";\r\n\r\n\t\t} // else of if ($nitems == 0)\r\n\r\n\t} // else of if (is_wp_error( $rss ))\r\n\r\n \t// if pubauthor has been selected\r\n\r\n\tif ( filter_var($pubauthor, FILTER_VALIDATE_BOOLEAN) ) {\r\n\r\n\t\t$flist .= '';\r\n\r\n\t}\r\n\r\n\treturn $flist;\r\n\r\n}", "function rss_feed_links() {\n\tadd_theme_support( 'automatic-feed-links' );\n}", "function fww_rss( $rssUrl, $id ) {\n // Do we have this information in our transients already?\n $transient = get_transient( 'tna_rss_blog_transient' . $id );\n // Yep! Just return it and we're done.\n if( ! empty( $transient ) ) {\n echo $transient ;\n // Nope! We gotta make a call.\n } else {\n // Get feed source.\n $content = file_get_contents( $rssUrl );\n if ( $content !== false ) {\n $x = new SimpleXmlElement( $content );\n $n = 0;\n // Loop through each feed item and display each item\n foreach ( $x->channel->item as $item ) :\n if ( $n == 1 ) {\n break;\n }\n $enclosure = $item->enclosure['url'];\n $namespaces = $item->getNameSpaces( true );\n $dc = $item->children( $namespaces['dc'] );\n $pubDate = $item->pubDate;\n $pubDate = date( \"l d M Y\", strtotime( $pubDate ) );\n $html = '<div class=\"col-sm-6\"><div class=\"card clearfix\">';\n if ( $enclosure ) {\n $html .= '<a href=\"' . $item->link . '\" title=\"' . $item->title . '\">';\n $html .= '<div class=\"entry-thumbnail\" style=\"background: url(' . $enclosure . ') no-repeat center center;background-size: cover;\">';\n // $html .= '<img src=\"' . $enclosure . '\" class=\"img-responsive\" alt=\"' . $item->title . '\">';\n $html .= '</div></a>';\n }\n $html .= '<div class=\"entry-content\"><small>Blog</small><h2><a href=\"' . $item->link . '\">';\n $html .= $item->title;\n $html .= '</a></h2>';\n $html .= '<small>' . $dc->creator . ' | ' . $pubDate . '</small>';\n $html .= '<p>' . $item->description . '</p><ul class=\"child\"><li><a href=\"http://blog.nationalarchives.gov.uk/blog/tag/first-world-war/\">Join us on our blog</a></li></ul></div>';\n $html .= '</div></div>';\n $n ++;\n endforeach;\n set_transient( 'tna_rss_blog_transient' . $id, $html, HOUR_IN_SECONDS );\n echo $html;\n }\n else {\n echo '<div class=\"col-md-6\"><div class=\"card\"><div class=\"entry-content\"><h2>First World War blog</h2><ul class=\"child\"><li><a href=\"http://blog.nationalarchives.gov.uk/blog/tag/first-world-war/\">Join us on our blog</a></li></ul></div></div></div>';\n }\n }\n}", "public function head_cleanup() {\n\t\t// RSS links.\n\t\t$this->remove_action( 'wp_head', 'feed_links_extra', 3 );\n\t\t$this->remove_action( 'wp_head', 'rsd_link' );\n\n\t\t// Manifest link.\n\t\t$this->remove_action( 'wp_head', 'wlwmanifest_link' );\n\n\t\t// Prev / next post links.\n\t\t$this->remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\n\t\t// Generator tag.\n\t\t$this->remove_action( 'wp_head', 'wp_generator' );\n\t\t$this->add_filter( 'the_generator', '__return_false' );\n\n\t\t// Shortlink.\n\t\t$this->remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\n\n\t\t// Emoji scripts & styles.\n\t\t$this->remove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\t\t$this->remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\t\t$this->remove_action( 'wp_print_styles', 'print_emoji_styles' );\n\t\t$this->remove_action( 'admin_print_styles', 'print_emoji_styles' );\n\t\t$this->remove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n\t\t$this->remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\t\t$this->remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\n\t\t// Inline gallery styles.\n\t\t$this->add_filter( 'use_default_gallery_style', '__return_false' );\n\t}", "function funct_Sandy_RSS() {\r\n register_widget( 'WP_Sandy_RSS' );\r\n}", "function removeHeadLinks() {\n remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds\n remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed\n remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link\n remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file.\n remove_action( 'wp_head', 'index_rel_link' ); // index link\n remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // prev link\n remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link\n remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Display relational links for the posts adjacent to the current post.\n remove_action( 'wp_head', 'wp_generator' ); // Display the XHTML generator that is generated on the wp_head hook, WP version\n}", "function ticketbud_widget_output( $rss, $args = array() ) {\n\tif ( is_string( $rss ) ) {\n\t\t$rss = fetch_feed($rss);\n\t} elseif ( is_array($rss) && isset($rss['url']) ) {\n\t\t$args = $rss;\n\t\t$rss = fetch_feed($rss['url']);\n\t} elseif ( !is_object($rss) ) {\n\t\treturn;\n\t}\n\n\tif ( is_wp_error($rss) ) {\n\t\tif ( is_admin() || current_user_can('manage_options') )\n\t\t\techo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>';\n\t\treturn;\n\t}\n\n\t$default_args = array( 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0, 'show_poweredby' => 0 );\n\t$args = wp_parse_args( $args, $default_args );\n\textract( $args, EXTR_SKIP );\n\n\t$items = (int) $items;\n\tif ( $items < 1 || 20 < $items )\n\t\t$items = 10;\n\t$show_summary = (int) $show_summary;\n\t$show_author = (int) $show_author;\n\t$show_date = (int) $show_date;\n\t$show_poweredby = (int) $show_poweredby;\n\n\tif ( !$rss->get_item_quantity() ) {\n\t\techo '<ul><li>' . __( 'There are no current events.' ) . '</li></ul>';\n\t\t$rss->__destruct();\n\t\tunset($rss);\n\t\treturn;\n\t}\n\n\techo '<ul>';\n\tforeach ( $rss->get_items(0, $items) as $item ) {\n\t\t$link = $item->get_link();\n\t\twhile ( stristr($link, 'http') != $link )\n\t\t\t$link = substr($link, 1);\n\t\t$link = esc_url(strip_tags($link));\n\t\t$title = esc_attr(strip_tags($item->get_title()));\n\t\tif ( empty($title) )\n\t\t\t$title = __('Untitled');\n\n\t\t$desc = str_replace( array(\"\\n\", \"\\r\"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );\n\t\t$desc = wp_html_excerpt( $desc, 360 );\n\n\t\t// Append ellipsis. Change existing [...] to [&hellip;].\n\t\tif ( '[...]' == substr( $desc, -5 ) )\n\t\t\t$desc = substr( $desc, 0, -5 ) . '[&hellip;]';\n\t\telseif ( '[&hellip;]' != substr( $desc, -10 ) )\n\t\t\t$desc .= ' [&hellip;]';\n\n\t\t$desc = esc_html( $desc );\n\n\t\tif ( $show_summary ) {\n\t\t\t$summary = \"<div class='rssSummary'>$desc</div>\";\n\t\t} else {\n\t\t\t$summary = '';\n\t\t}\n\n\t\t$date = '';\n\t\tif ( $show_date ) {\n\t\t\t$date = $item->get_date();\n\t\t\t$myLocaltime = new DateTime($date);\n\t\t\tif ( get_option('timezone_string') ){\n\t\t\t $myTimezone = get_option('timezone_string');\n\t\t\t}else{\n\t\t\t $myTimezone = ticketbudGetTimeZoneStringFromOffset(get_option('gmt_offset'));\n\t\t\t}\n\t\t\t$myLocaltime->setTimezone(new DateTimeZone( $myTimezone ) );\n\t\t\t// error_log($myTimezone . \" \" . ($myLocaltime->getOffset()/ 3600) );\n\t\t\tif ( $date ) {\n\t\t\t if ( $date_stamp = strtotime( $myLocaltime->format( get_option( 'date_format' ) ) ) )\n\t\t\t\t $date = '<br /><span class=\"rss-date\">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>';\n\t\t\t\telse\n\t\t\t\t\t$date = '';\n\t\t\t}\n\t\t}\n\n\t\t$author = '';\n\t\tif ( $show_author ) {\n\t\t\t$author = $item->get_author();\n\t\t\tif ( is_object($author) ) {\n\t\t\t\t$author = $author->get_name();\n\t\t\t\t$author = ' <cite>' . esc_html( strip_tags( $author ) ) . '</cite>';\n\t\t\t}\n\t\t}\n\n\t\tif ( $link == '' ) {\n\t\t\techo \"<li>$title{$date}{$summary}{$author}</li>\";\n\t\t} else {\n \t\t\techo \"<li><a class='rsswidget' href='$link' title='$desc'><b>$title</b>{$date}{$summary}{$author}</a></li>\";\n\t\t}\n\t}\n\techo '</ul>';\n\n\tif ( $show_poweredby ) {\n \t echo \"<a href='http://ticketbud.com' title='Sell Tickets Online'><img style='padding:0px 0px 10px 25px;' src='http://ticketbud.com/images/Ticketbud-sm.png' alt='Ticketbud' border='0'/></a>\";\n\t}\n\n\t$rss->__destruct();\n\tunset($rss);\n}", "function frontpage_news_rss($url) {\n $obj = simplexml_load_file($url);\n\n // If an RSS feed:\n if(!empty($obj->channel)) {\n $description = \"description\";\n $pubDate = \"pubDate\";\n $collect = $obj->channel->item;\n // Else an Atom feed\n } else {\n $description = \"content\";\n $pubDate = \"published\";\n $collect = $obj->entry;\n }\n\n foreach($collect as $item) {\n $news .= \"<div style='border:1px solid #CCC;margin:4px;padding:4px;-moz-border-radius-topright:12px;border-radius-topright:12px;'>\n <a href='\".$item->link.\"'>\".$item->title.\"</a><br />\n <span style='font-size:10px;'>\".date(\"h:i A M jS\",strtotime($item->$pubDate)).\"</span>\n <p>\".$item->$description.\"</p></div>\";\n }\n\n return $news;\n}", "function fs_remove_default_description( $bloginfo ) {\r\n\t$default_tagline = 'Just another WordPress site';\r\n\r\n\treturn ( $bloginfo === $default_tagline ) ? '' : $bloginfo;\r\n}", "private function cleanHead()\n {\n remove_action('wp_head', 'print_emoji_detection_script', 7);\n remove_action('wp_print_styles', 'print_emoji_styles');\n remove_action('wp_head', 'rsd_link'); //removes EditURI/RSD (Really Simple Discovery) link.\n remove_action('wp_head', 'wlwmanifest_link'); //removes wlwmanifest (Windows Live Writer) link.\n remove_action('wp_head', 'wp_generator'); //removes meta name generator.\n remove_action('wp_head', 'wp_shortlink_wp_head'); //removes shortlink.\n remove_action('wp_head', 'feed_links', 2); //removes feed links.\n remove_action('wp_head', 'feed_links_extra', 3); //removes comments feed.\n }", "static function deliverRSS($a_wsp_id)\n\t{\n\t\tglobal $tpl, $ilSetting;\n\t\t\n\t\tif(!$ilSetting->get('enable_global_profiles'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// #10827\n\t\tif(substr($a_wsp_id, -4) != \"_cll\")\n\t\t{\n\t\t\tinclude_once \"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php\";\n\t\t\t$wsp_id = new ilWorkspaceTree(0);\n\t\t\t$obj_id = $wsp_id->lookupObjectId($a_wsp_id);\t\n\t\t\t$is_wsp = \"_wsp\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$a_wsp_id = substr($a_wsp_id, 0, -4);\n\t\t\t$obj_id = ilObject::_lookupObjId($a_wsp_id);\n\t\t\t$is_wsp = null;\n\t\t}\n\t\tif(!$obj_id)\n\t\t{\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$blog = new self($obj_id, false);\t\t\n\t\tif(!$blog->hasRSS())\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\t\t\t\n\t\tinclude_once \"Services/Feeds/classes/class.ilFeedWriter.php\";\n\t\t$feed = new ilFeedWriter();\n\t\t\t\t\n\t\tinclude_once \"Services/Link/classes/class.ilLink.php\";\n\t\t$url = ilLink::_getStaticLink($a_wsp_id, \"blog\", true, $is_wsp);\n\t\t$url = str_replace(\"&\", \"&amp;\", $url);\n\t\t\n\t\t// #11870\n\t\t$feed->setChannelTitle(str_replace(\"&\", \"&amp;\", $blog->getTitle()));\n\t\t$feed->setChannelDescription(str_replace(\"&\", \"&amp;\", $blog->getDescription()));\n\t\t$feed->setChannelLink($url);\n\t\t\n\t\t// needed for blogpostinggui / pagegui\n\t\t$tpl = new ilTemplate(\"tpl.main.html\", true, true);\n\t\t\n\t\tinclude_once(\"./Modules/Blog/classes/class.ilBlogPosting.php\");\t\t\t\t\t\n\t\tinclude_once(\"./Modules/Blog/classes/class.ilBlogPostingGUI.php\");\t\t\t\n\t\tforeach(ilBlogPosting::getAllPostings($obj_id) as $item)\n\t\t{\n\t\t\t$id = $item[\"id\"];\n\n\t\t\t// only published items\n\t\t\t$is_active = ilBlogPosting::_lookupActive($id, \"blp\");\n\t\t\tif(!$is_active)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// #16434\n\t\t\t$snippet = strip_tags(ilBlogPostingGUI::getSnippet($id), \"<br><br/><div><p>\");\n\t\t\t$snippet = str_replace(\"&\", \"&amp;\", $snippet);\t\n\t\t\t$snippet = \"<![CDATA[\".$snippet.\"]]>\";\n\n\t\t\t$url = ilLink::_getStaticLink($a_wsp_id, \"blog\", true, \"_\".$id.$is_wsp);\n\t\t\t$url = str_replace(\"&\", \"&amp;\", $url);\t\t\t\t\n\n\t\t\t$feed_item = new ilFeedItem();\n\t\t\t$feed_item->setTitle(str_replace(\"&\", \"&amp;\", $item[\"title\"])); // #16022\n\t\t\t$feed_item->setDate($item[\"created\"]->get(IL_CAL_DATETIME));\n\t\t\t$feed_item->setDescription($snippet);\n\t\t\t$feed_item->setLink($url);\n\t\t\t$feed_item->setAbout($url);\t\t\t\t\n\t\t\t$feed->addItem($feed_item);\n\t\t}\t\t\t\t\t\n\t\t\n\t\t$feed->showFeed();\n\t\texit();\t\t\n\t}", "function bones_head_cleanup() {\n remove_action( 'wp_head', 'feed_links_extra', 3 ); // category feeds\n remove_action( 'wp_head', 'feed_links', 2 ); // post and comment feeds\n remove_action( 'wp_head', 'rsd_link' ); // EditURI link\n remove_action( 'wp_head', 'wlwmanifest_link' ); // windows live writer\n remove_action( 'wp_head', 'index_rel_link' ); // index link\n remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // previous link\n remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link\n remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); // links for adjacent posts\n}", "private function init() {\n\t\tadd_action('init', [$this, 'head_cleanup']);\n\n\t\t// Remove the WordPress version from RSS feeds\n\t\tadd_filter('the_generator', '__return_false');\n\n\t\t// Clean up language_attributes() used in <html> tag\n\t\tadd_filter('language_attributes', [$this, 'language_attributes']);\n\n\t\t// Clean up output of stylesheet <link> tags\n\t\tadd_filter('style_loader_tag', [$this, 'clean_style_tag']);\n\n\t\t// Clean up output of script tags\n\t\tadd_filter('script_loader_tag', [$this, 'clean_script_tag']);\n\n\t\t// Add and remove body_class() classes\n\t\tadd_filter('body_class', [$this, 'body_class']);\n\n\t\t// Wrap embedded media as suggested by Readability\n\t\tadd_filter('embed_oembed_html', [$this, 'embed_wrap']);\n\n\t\t// Remove unnecessary dashboard widgets\n\t\tadd_action('admin_init', [$this, 'remove_dashboard_widgets']);\n\n\t\t// Remove unnecessary self-closing tags\n\t\t$this->remove_self_closing_tags();\n\n\t\t// Don't return the default description in the RSS feed if it hasn't been changed\n\t\tadd_filter('get_bloginfo_rss', [$this, 'remove_default_description']);\n\n\t\t// Remove unnecessary assets\n\t\tadd_action( 'wp_enqueue_scripts', [$this, 'remove_enqueued_assets'], 100 );\n\t}", "function grav_head_cleanup() {\n\t// remove header links\n\t\n\t// these two are for RSS feeds - only uncomment if you don't want RSS\n\t//remove_action( 'wp_head', 'feed_links_extra', 3 ); // Category Feeds\n\t//remove_action( 'wp_head', 'feed_links', 2 ); // Post and Comment Feeds\n\t\n\tremove_action( 'wp_head', 'rsd_link' ); // EditURI link\n\tremove_action( 'wp_head', 'wlwmanifest_link' ); // Windows Live Writer\n\tremove_action( 'wp_head', 'index_rel_link' ); // index link\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // previous link\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); // Links for Adjacent Posts\n\tremove_action( 'wp_head', 'wp_generator' ); // WP version\n}", "function rssreader_last5news($where, $who, $site) {\r\n\t$module = 'rssreader';\r\n\t$data = html_entity_decode( file_get_contents( $site ) );\r\n\t//$data = mb_convert_encoding( $data, 'utf-8', 'utf-8,iso-8859-1,iso-8859-15' );\r\n\t$data = mb_convert_encoding( $data, 'utf-8' );\r\n\t$data = utf8_decode( $data );\r\n\t$data = str_replace('&','&amp;',str_replace('&amp;','&',$data));\r\n\t$data = preg_replace('#<([^@ :/?]+@[^>]+)>#i','\"$1\"',$data);\r\n\t$data = preg_replace('#<([^@ :/?]+) at ([^@ :/?]+) dot ([^>]+)>#i','\"$1@$2.$3\"',$data);\r\n\t$data = preg_replace('#<([^@ :/?]+) at ([^>]+)>#i','\"$1@$2.$3\"',$data);\r\n\t$valid = true;\r\n\ttry {\r\n\t\t$dom = $GLOBALS['modules'][$module]['functions']['XmlLoader']( $data );\r\n\t}\r\n\tcatch( DOMException $e ) {\r\n\t\tprint($e.\"\\n\");\r\n\t\t$valid = false;\r\n\t}\r\n\tif( $valid === false ) {\r\n\t\tsay( $where, $who, 'xml non valide' );\r\n\t\treturn false;\r\n\t}\r\n\t$allitems = $dom->getElementsByTagName( 'item' );\r\n\tfor($i = 0 ; $i < 5 && $i < $allitems->length ; $i++) {\r\n\t\tsay( $where, $who, $allitems->item( $i )->getElementsByTagName( 'title' )->item( 0 )->nodeValue . \"\\r\\n\" );\r\n\t}\r\n\treturn true;\r\n}", "function wpb_remove_version() {\n return '';\n}", "function wpmudev_remove_version() {\nreturn '';\n}", "function head_cleanup(){\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\tremove_action( 'wp_head', 'index_rel_link' );\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\tremove_action( 'wp_head', 'wp_generator' );\n\tadd_filter( 'style_loader_src', 'remove_wp_ver_css_js', 9999 );\n\tadd_filter( 'script_loader_src', 'remove_wp_ver_css_js', 9999 );\n}", "function full_reset(){\n\t/**\n\t* This function will reset all the header links\n\t* http://wordpress.stackexchange.com/questions/207104/edit-theme-wp-head\n\t*/\n\t// Removes the wlwmanifest link\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t// Removes the RSD link\n\tremove_action( 'wp_head', 'rsd_link' );\n\t// Removes the WP shortlink\n\t//remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\n\t// Removes the canonical links\n\t//remove_action( 'wp_head', 'rel_canonical' );\n\t// Removes the links to the extra feeds such as category feeds\n\t//remove_action( 'wp_head', 'feed_links_extra', 3 ); \n\t// Removes links to the general feeds: Post and Comment Feed\n\t//remove_action( 'wp_head', 'feed_links', 2 ); \n\t// Removes the index link\n\tremove_action( 'wp_head', 'index_rel_link' ); \n\t// Removes the prev link\n\tremove_action( 'wp_head', 'parent_post_rel_link' ); \n\t// Removes the start link\n\tremove_action( 'wp_head', 'start_post_rel_link' ); \n\t// Removes the relational links for the posts adjacent to the current post\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link' );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );\n\t// Removes the WordPress version i.e. -\n\tremove_action( 'wp_head', 'wp_generator' );\n\t\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\t\n\t/**\n\t*https://wordpress.org/support/topic/wp-44-remove-json-api-and-x-pingback-from-http-headers\n\t*/\n\tadd_filter('rest_enabled', '_return_false');\n\tadd_filter('rest_jsonp_enabled', '_return_false');\n\t\n\tremove_action( 'wp_head', 'rest_output_link_wp_head', 10 );\n\tremove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 );\n\t\n\tremove_action('wp_head', 'wp_print_scripts');\n //remove_action('wp_head', 'wp_print_head_scripts', 9);\n add_action('wp_footer', 'wp_print_scripts', 5);\n add_action('wp_footer', 'wp_print_head_scripts', 5);\n}", "function the_content_rss($more_link_text = '(more...)', $stripteaser = 0, $more_file = '', $cut = 0, $encode_html = 0)\n {\n }", "function wp_dashboard_plugins_output($rss, $args = array())\n {\n }", "function comments_rss()\n {\n }", "function remove_default_description( $bloginfo ) {\n\t$default_tagline = 'Just another WordPress site';\n\n\treturn ( $bloginfo === $default_tagline ) ? '' : $bloginfo;\n}", "function PageSummaries_rssToHtml($rss) {\n\t$rss=str_replace('<'.'?xml version=\"1.0\" ?'.'><rss version=\"2.0\">', '', $rss);\n\t$rss=preg_replace('/<channel.*?\\/description>/', '', $rss);\n\t$rss=preg_replace('/<pubDate>.*?<\\/pubDate>/', '', $rss);\n\t$rss=str_replace(\n\t\tarray('<title>', '</title>', '&#8364;'),\n\t\tarray('<h3>', '</h3>', '&euro;'),\n\t\t$rss\n\t);\n\t$rss=str_replace('<description>', '<p>', $rss);\n\t$rss=str_replace('</description>', '</p>', $rss);\n\t$rss=str_replace('<item>', '<div class=\"page_summary_item\">', $rss);\n\t$rss=str_replace('</item>', '</div>', $rss);\n\t$rss=str_replace('<link>', '<a href=\"', $rss);\n\t$rss=str_replace('</link>', '\">'.__('[more...]').'</a>', $rss);\n\t$rss=str_replace(array('</rss>', '</channel>'), array('', ''), $rss);\n\treturn $rss==''?'<em>'.__('No articles contained here.').'</em>':$rss;\n}", "function wpfc_podcast_summary ($content) {\n\tglobal $post;\n\t//$content = '';\n\t$content = wp_filter_nohtml_kses( get_wpfc_sermon_meta('sermon_description') ); \n\t\treturn $content;\n}" ]
[ "0.8088184", "0.8031337", "0.7991728", "0.7916498", "0.78290415", "0.77846205", "0.75705534", "0.7520781", "0.7428136", "0.74133563", "0.7149772", "0.6792606", "0.6727403", "0.6712296", "0.65957093", "0.6594163", "0.6594163", "0.6574723", "0.6574168", "0.6573446", "0.65106386", "0.647524", "0.6463781", "0.6463771", "0.64418846", "0.64193195", "0.63747686", "0.6352717", "0.63495517", "0.63210624", "0.6321023", "0.631954", "0.63087195", "0.62978303", "0.6293042", "0.62918127", "0.62418467", "0.62396574", "0.6232178", "0.6206735", "0.62060416", "0.6204014", "0.618988", "0.61881423", "0.61873287", "0.61862636", "0.6162608", "0.61540824", "0.6141039", "0.6132367", "0.6132074", "0.61316484", "0.61188185", "0.6084149", "0.6071358", "0.6069892", "0.6048773", "0.6037159", "0.60329884", "0.6010842", "0.6006389", "0.59660506", "0.59621006", "0.5943127", "0.5940288", "0.59353733", "0.59339255", "0.5913671", "0.59126824", "0.5905209", "0.5899125", "0.58977866", "0.58947253", "0.5852816", "0.58451414", "0.5842767", "0.5835172", "0.58331895", "0.58322126", "0.58303237", "0.5825811", "0.5823596", "0.5814901", "0.5814452", "0.58042306", "0.57999474", "0.5793459", "0.5775134", "0.57611763", "0.575911", "0.5756775", "0.57553977", "0.5740343", "0.5732333", "0.5725198", "0.5718654", "0.5717757", "0.5714935", "0.5711015", "0.57096004" ]
0.8056424
1
remove WP version from scripts
function po_remove_wp_ver_css_js( $src ) { if ( strpos( $src, 'ver=' ) ) $src = remove_query_arg( 'ver', $src ); return $src; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpversion_remove_version() {\n return '';\n }", "function startertheme_remove_version() {\nreturn '';\n}", "function remove_versao_wp() { return ''; }", "function remove_versao_wp() { return ''; }", "function remove_wordpress_version() {\n remove_filter( 'update_footer', 'core_update_footer' );\n}", "function wpgrade_head_cleanup() {\r\n\t// Remove WP version\r\n\tremove_action( 'wp_head', 'wp_generator' );\r\n\t\r\n\tremove_action( 'wp_head', 'rsd_link' );\r\n\t// windows live writer\r\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\r\n\t\r\n\t// remove WP version from css - those parameters can prevent caching\r\n\t//add_filter( 'style_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\t// remove WP version from scripts - those parameters can prevent caching\r\n\t//add_filter( 'script_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\r\n}", "function cardealer_head_cleanup() {\r\n\tadd_filter( 'style_loader_src', 'cardealer_remove_wp_ver_css_js', 9999 ); // remove WP version from css\r\n\tadd_filter( 'script_loader_src', 'cardealer_remove_wp_ver_css_js', 9999 ); // remove WP version from scripts\r\n}", "function manofbytes_hide_wp_version() {\n\treturn '';\n}", "function dimaan_remove_version() { return ''; }", "function wpb_remove_version() {\nreturn '';\n}", "function wpb_remove_version() {\r\n return '';\r\n}", "function sunset_remove_wp_version_strings($src){\n global $wp_version;\n parse_str(parse_url($src,PHP_URL_QUERY),$query);\n if (!empty($query['ver']) && $query['ver'] === $wp_version){\n $src = remove_query_arg('ver',$src);\n }\n return $src;\n}", "function material_press_remove_script_version( $src ) {\n \t$parts = explode( '?ver', $src );\n \treturn $parts[0];\n }", "function sunset_remove_meta_version(){\n return '' ;\n}", "function pu_remove_script_version( $src ){\n return remove_query_arg( 'ver', $src );\n}", "function wpb_remove_version() {\n return '';\n}", "function wfs_remove_meta_version() {\n\treturn '';\n}", "function flexfour_remove_wp_ver_css_js( $src ) {\n if ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) )\n $src = remove_query_arg( 'ver', $src );\n return $src;\n}", "function bajweb_remove_wp_version_strings( $src ) {\n\n\tglobal $wp_version;\n\tparse_str( parse_url($src, PHP_URL_QUERY), $query );\n\tif ( !empty( $query['ver'] ) && $query['ver'] === $wp_version ) {\n\t\t$src = remove_query_arg( 'ver', $src );\n\t}\n\treturn $src;\n\n}", "function remove_wp_ver_css_js( $src ) {\n\tif ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) )\n\t\t$src = remove_query_arg( 'ver', $src );\n\treturn $src;\n}", "function remove_wp_ver_css_js( $src ) {\n\tif ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) )\n\t\t$src = remove_query_arg( 'ver', $src );\n\treturn $src;\n}", "function bft_remove_version() {\n\treturn '';\n}", "function theme_remove_wp_ver_css_js($src) {\n if ( strpos($src, 'ver=') ) {\n $src = remove_query_arg('ver', $src);\n }\n return $src;\n}", "function bajweb_remove_meta_version() {\n\treturn '';\n}", "function pramble_remove_version(){\n\t\t\t\treturn '';\n\t\t\t}", "function vc_remove_wp_ver_css_js( $src ) {\n if ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) )\n $src = remove_query_arg( 'ver', $src );\n return $src;\n}", "function pd_remove_wp_ver_css_js($src)\n{\n if (strpos($src, 'ver='))\n $src = remove_query_arg('ver', $src);\n return $src;\n}", "function shapeSpace_remove_version_scripts_styles($src) {\n if (strpos($src, 'ver=')) {\n $src = remove_query_arg('ver', $src);\n }\n return $src;\n}", "function _remove_script_version( $src ){\n$parts = explode( '?ver', $src );\nreturn $parts[0];\n}", "function shapeSpace_remove_version_scripts_styles($src) {\n\tif (strpos($src, 'ver=')) {\n\t\t$src = remove_query_arg('ver', $src);\n\t}\n\treturn $src;\n}", "function ws_remove_wp_ver_css_js( $src ) {\n if ( strpos( $src, 'ver=' ) )\n $src = remove_query_arg( 'ver', $src );\n return $src;\n}", "function remove_jquery_wordpress( $scripts ) {\n if ( !is_admin() ) {\n $script = $scripts->registered['jquery'];\n \n if ( $script->deps ) { \n $script->deps = array_diff( $script->deps, array( 'jquery-core', 'jquery-migrate' ) );\n \n }\n }\n }", "function vc_remove_wp_ver_css_js( $src )\n{\n if ( strpos( $src, 'ver=' ) )\n $src = remove_query_arg( 'ver', $src );\n return $src;\n}", "function remove_src_version ( $src ) {\r\n\tglobal $wp_version;\r\n\t$version_str = '?ver='.$wp_version;\r\n\t$version_str_offset = strlen( $src ) - strlen( $version_str );\r\n\tif( substr( $src, $version_str_offset ) == $version_str )\r\n\t$src = substr( $src, 0, $version_str_offset ) . '?' . filemtime( __FILE__ );\r\n\treturn $src;\r\n}", "function spartan_remove_wp_ver_css_js( $src ) {\n if ( strpos( $src, 'ver=' ) )\n $src = remove_query_arg( 'ver', $src );\n return $src;\n}", "function wpt_uninstall(){\n //Nothing to say for this version\n}", "function manofbytes_remove_wp_ver_css_js( $src ) {\n\tif ( strpos( $src, 'ver=' ) ) {\n\t\t$src = remove_query_arg( 'ver', $src );\n\t}\n\treturn $src;\n}", "function _remove_script_version($src) {\n $parts = explode('?ver', $src);\n return $parts[0];\n}", "function vc_remove_wp_ver_css_js( $src ) {\n if ( strpos( $src, 'ver=' ) )\n $src = remove_query_arg( 'ver', $src );\n return $src;\n}", "function bones_remove_wp_ver_css_js($src)\n{\n\tif (strpos($src, 'ver='))\n\t\t$src = remove_query_arg('ver', $src);\n\treturn $src;\n}", "function tlh_remove_wp_ver_css_js( $src ) {\n\tif ( strpos( $src, 'ver=' ) ) {\n\t\t$src = remove_query_arg( 'ver', $src );\n\t}\n\treturn $src;\n}", "function wpmudev_remove_version() {\nreturn '';\n}", "function mdwpfp_remove_wp_ver_css_js($src) {\n if (strpos($src, 'ver='))\n $src = remove_query_arg('ver', $src);\n return $src;\n}", "function remove_theme_mods()\n {\n }", "function bulledev_remove_wp_ver_css_js( $src ) {\n if ( strpos( $src, 'ver=' ) )\n $src = remove_query_arg( 'ver', $src );\n return $src;\n}", "function childtheme_remove_scripts(){\n remove_action('wp_enqueue_scripts','thematic_head_scripts');\n}", "function oh_remove_wp_ver_css_js( $src ) {\n if ( strpos( $src, 'ver=' ) )\n $src = remove_query_arg( 'ver', $src );\n return $src;\n}", "function complete_version_removal() { return ''; }", "function _remove_script_version( $src ) {\r\n $parts = explode( '?ver', $src );\r\n return $parts[0];\r\n}", "function spartan_head_cleanup() {\n\t// EditURI link\n\tremove_action( 'wp_head', 'rsd_link' );\n\t// windows live writer\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t// index link\n\tremove_action( 'wp_head', 'index_rel_link' );\n\t// previous link\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\t// start link\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t// links for adjacent posts\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\t// WP version\n\tremove_action( 'wp_head', 'wp_generator' );\n // remove WP version from css\n add_filter( 'style_loader_src', 'spartan_remove_wp_ver_css_js', 9999 );\n // remove Wp version from scripts\n add_filter( 'script_loader_src', 'spartan_remove_wp_ver_css_js', 9999 );\n\n}", "function _h_remove_jetpack_footer_assets() {\n wp_deregister_script('sharing-js');\n\n // disable spinner when infinite loading is enabled\n wp_deregister_script('jquery.spin');\n wp_deregister_script('spin');\n}", "function _remove_script_version( $src ){\n$parts = explode( '?', $src );\nreturn $parts[0];\n}", "function remove_version_number() {\n return '';\n}", "function _remove_script_version( $src ){\n\t\t\t$parts = explode( '?ver', $src );\n\t\t\treturn $parts[0];\n\t\t}", "private static function removeConflictingScripts()\n {\n remove_action('admin_enqueue_scripts', 'kadence_admin_scripts');\n\n // Compatibility with Woocommerce Product Tab Pro 1.8.0 (http://codecanyon.net/item/woocommerce-tabs-pro-extra-tabs-for-product-page/8218941)\n remove_action('admin_print_footer_scripts', '_hc_tinymce_footer_scripts');\n }", "function _remove_script_version( $src ){\n $parts = explode( '?', $src );\n return $parts[0];\n}", "function bfa_remove_featured_gallery_scripts() {\r\n remove_action('wp_head', 'gallery_styles');\r\n}", "function my_deregister_scripts(){\r\n\t \twp_deregister_script( 'wp-embed' );\r\n\t}", "function _h_remove_jetpack_head_assets() {\n wp_dequeue_script('devicepx');\n wp_dequeue_style('sharedaddy');\n wp_dequeue_style('social-logos');\n}", "function wp_deregister_script($handle)\n {\n }", "function tsapress_remove_localization_script() {\n\tif (!is_admin()) {\n\t\twp_deregister_script('l10n');\n\t}\n}", "function my_deregister_scripts(){\n wp_deregister_script( 'wp-embed' );\n}", "function cultiv8_deregister_scripts() {\n\tglobal $wp_query, $post;\n\t\n\tif( ! ( strpos( json_encode( $wp_query ), '[contact-form-7' ) || strpos( json_encode( $post ), '[contact-form-7' ) ) ) {\n\t\t\twp_deregister_script( 'contact-form-7' );\n\t\t\twp_deregister_style( 'contact-form-7' );\n\t}\n\n}", "function remove_wp_embed_and_jquery() {\n\tif (!is_admin()) {\n\t\twp_deregister_script('wp-embed');\t\t\n\t}\n}", "function wp_deregister_script( $handle ) {\r\n\tglobal $wp_scripts;\r\n\tif ( !is_a($wp_scripts, 'WP_Scripts') )\r\n\t\t$wp_scripts = new WP_Scripts();\r\n\r\n\t$wp_scripts->remove( $handle );\r\n}", "function headClean() {\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action( 'wp_head', 'wp_generator' );\n\tremove_action( 'wp_head', 'wp_wlwmanifest' );\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n}", "function deregister_scripts_oembed_footer(){\n\twp_deregister_script( 'wp-embed' );\n}", "function deregister_scripts_oembed_footer(){\n\twp_deregister_script( 'wp-embed' );\n}", "function remove_asset_version($src) {\n return $src ? esc_url(remove_query_arg('ver', $src)) : false;\n }", "function head_cleanup(){\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\tremove_action( 'wp_head', 'index_rel_link' );\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\tremove_action( 'wp_head', 'wp_generator' );\n\tadd_filter( 'style_loader_src', 'remove_wp_ver_css_js', 9999 );\n\tadd_filter( 'script_loader_src', 'remove_wp_ver_css_js', 9999 );\n}", "function crunchify_stop_loading_wp_embed() {\n if (!is_admin()) {\n wp_deregister_script('wp-embed');\n }\n}", "function ct_remove_assets() {\n wp_dequeue_style( 'bigcommerce-styles' );\n\n if ( ct_is_pagespeed() ) {\n wp_dequeue_script( 'bigcommerce-manifest' );\n wp_dequeue_script( 'bigcommerce-vendors' );\n wp_dequeue_script( 'bigcommerce-scripts' );\n } else {\n wp_enqueue_script( 'smile.io', 'https://cdn.sweettooth.io/assets/storefront.js', array(), '1.0', true );\n }\n}", "function wooadmin_remove_woo_commerce_generator_tag()\n{\n remove_action('wp_head',array($GLOBALS['eshopbox'], 'generator'));\n}", "public function remove_woocommerce_scripts() {\n\n\t\t// First check that woo exists to prevent fatal errors.\n\t\tif ( function_exists( 'is_woocommerce' ) ) {\n\n\t\t\t// Dequeue scripts and styles.\n\t\t\tif ( ! is_woocommerce() && ! is_cart() && ! is_checkout() && ! is_account_page() ) {\n\t\t\t\twp_dequeue_script( 'cyprus-woocommerce' );\n\t\t\t\twp_dequeue_style( 'woocommerce-layout' );\n\t\t\t\twp_dequeue_style( 'woocommerce-smallscreen' );\n\t\t\t\twp_dequeue_style( 'woocommerce-general' );\n\t\t\t\twp_dequeue_style( 'wc-bto-styles' );\n\t\t\t\twp_dequeue_script( 'wc-add-to-cart' );\n\t\t\t\twp_dequeue_script( 'wc-cart-fragments' );\n\t\t\t\twp_dequeue_script( 'woocommerce' );\n\t\t\t\twp_dequeue_script( 'jquery-blockui' );\n\t\t\t\twp_dequeue_script( 'jquery-placeholder' );\n\t\t\t}\n\t\t}\n\t}", "function remove_theme_mod($name)\n {\n }", "function harvest_deregister_scripts() {\n\tglobal $wp_query, $post;\n\t\n\tif( ! ( strpos( json_encode( $wp_query ), '[contact-form-7' ) || strpos( json_encode( $post ), '[contact-form-7' ) ) ) {\n\t\t\twp_deregister_script( 'contact-form-7' );\n\t\t\twp_deregister_style( 'contact-form-7' );\n\t}\n\n}", "public function remove_conflicting_asset_files() {\n\t\t$scripts = array(\n\t\t\t'jetpack-onboarding-vendor', // Jetpack Onboarding Bluehost.\n\t\t);\n\n\t\tif ( ! empty( $scripts ) ) {\n\t\t\tforeach ( $scripts as $script ) {\n\t\t\t\twp_dequeue_script( $script ); // Remove JS file.\n\t\t\t\twp_deregister_script( $script );\n\t\t\t}\n\t\t}\n\t}", "function admin_footer_version_removal () {\n remove_filter( 'update_footer', 'core_update_footer' );\n}", "function webamp_remove_double_menu() {\n // register your script location, dependencies and version\n wp_register_script('custom_script',\n plugin_dir_url( __FILE__ ) . 'js/doublemenuscript.js',\n array('jquery'),\n '1.0',\n true);\n // enqueue the script\n wp_enqueue_script('custom_script');\n}", "function disable_scripts() { \n\tif ($GLOBALS['pagenow'] != 'wp-login.php' && !is_admin()) {\n\t\twp_deregister_script('l10n');\n\t\twp_deregister_script('jquery');\n\t\twp_deregister_script('wp-embed');\n\t}\n}", "function bones_head_cleanup()\n{\n\t// category feeds\n\tremove_action('wp_head', 'feed_links_extra', 3);\n\t// post and comment feeds\n\tremove_action('wp_head', 'feed_links', 2);\n\t// EditURI link\n\tremove_action('wp_head', 'rsd_link');\n\t// windows live writer\n\tremove_action('wp_head', 'wlwmanifest_link');\n\t// previous link\n\tremove_action('wp_head', 'parent_post_rel_link', 10, 0);\n\t// start link\n\tremove_action('wp_head', 'start_post_rel_link', 10, 0);\n\t// links for adjacent posts\n\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\t// WP version\n\tremove_action('wp_head', 'wp_generator');\n\n\tremove_action('wp_head', 'print_emoji_detection_script', 7); // no php needed above it\n\tremove_action('wp_print_styles', 'print_emoji_styles');\n\tremove_action('admin_print_scripts', 'print_emoji_detection_script');\n\tremove_action('admin_print_styles', 'print_emoji_styles'); // php is not closed in the last line\n\n\t// remove WP version from css\n\tadd_filter('style_loader_src', 'bones_remove_wp_ver_css_js', 9999);\n\t// remove Wp version from scripts\n\tadd_filter('script_loader_src', 'bones_remove_wp_ver_css_js', 9999);\n}", "function deenqueue_parent_scripts_styles() {\n wp_dequeue_script( 'one-page-slitslider' );\n wp_deregister_script( 'one-page-slitslider' );\n wp_dequeue_script( 'one-page-custom' );\n wp_deregister_script( 'one-page-custom' );\n}", "function isa_remove_jquery_migrate( &$scripts) {\n if(!is_admin()) {\n $scripts->remove( 'jquery');\n $scripts->add( 'jquery', false, array( 'jquery-core' ), '1.4.11' );\n }\n}", "function remove_head_scripts() {\n remove_action('wp_head', 'wp_print_scripts');\n remove_action('wp_head', 'wp_print_head_scripts', 9);\n remove_action('wp_head', 'wp_enqueue_scripts', 1);\n\n // remove_action('wp_head', 'wp_print_style');\n // remove_action('wp_head', 'wp_print_head_style', 9);\n // remove_action('wp_head', 'wp_enqueue_style', 1);\n \n add_action('wp_footer', 'wp_print_scripts', 5);\n add_action('wp_footer', 'wp_enqueue_scripts', 5);\n add_action('wp_footer', 'wp_print_head_scripts', 5);\n\n // add_action('wp_footer', 'wp_print_style', 5);\n // add_action('wp_footer', 'wp_enqueue_style', 5);\n // add_action('wp_footer', 'wp_print_head_style', 5);\n}", "function remove_wp_cli_hooks() {\n\tremove_action( 'init', array( 'DevHub_CLI', 'action_init_register_cron_jobs' ) );\n\tremove_action( 'init', array( 'DevHub_CLI', 'action_init_register_post_types' ) );\n\tremove_action( 'pre_get_posts', array( 'DevHub_CLI', 'action_pre_get_posts' ) );\n\tremove_action( 'devhub_cli_manifest_import', array( 'DevHub_CLI', 'action_devhub_cli_manifest_import' ) );\n\tremove_action( 'devhub_cli_markdown_import', array( 'DevHub_CLI', 'action_devhub_cli_markdown_import' ) );\n\tremove_action( 'breadcrumb_trail', array( 'DevHub_CLI', 'filter_breadcrumb_trail' ) );\n\tremove_action( 'the_content', array( 'DevHub_CLI', 'filter_the_content' ) );\n}", "function hoopsai_wp_uninstall () {\n delete_option('hoopsai_wp_api_key');\n}", "function sdt_remove_ver_css_js( $src ) {\n\tif ( strpos( $src, 'ver=' ) )\n\t\t$src = remove_query_arg( 'ver', $src );\n\treturn $src;\n}", "function shutdown() {\n // Safety for themes not using wp_footer\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "function pm_demo_uninstall() {\n\t\t global $wpdb;\n\t\t\n }", "function remove_plugin_assets() {\n wp_dequeue_style('roots-share-buttons'); // roots-share-buttons/assets/styles/share-buttons.css\n wp_dequeue_script('roots-share-buttons'); //roots-share-buttons/assets/scripts/share-buttons.js\n wp_dequeue_style('wp-biographia-bio'); //wp-biographia/css/wp-biographia-min.css\n}", "function speed_stop_loading_wp_embed() {\r\n if (!is_admin()) {\r\n wp_deregister_script('wp-embed');\r\n }\r\n}", "function pd_head_cleanup()\n{\n\n /* ===============\n Remove RSS from header\n =============== */\n remove_action('wp_head', 'rsd_link'); #remove page feed\n remove_action('wp_head', 'feed_links_extra', 3); // Remove category feeds\n remove_action('wp_head', 'feed_links', 2); // Remove Post and Comment Feeds\n\n\n /* ===============\n remove windindows live writer link\n =============== */\n remove_action('wp_head', 'wlwmanifest_link');\n\n\n /* ===============\n links for adjacent posts\n =============== */\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\n\n /* ===============\n WP version\n =============== */\n remove_action('wp_head', 'wp_generator');\n\n\n /* ===============\n remove WP version from css\n =============== */\n add_filter('style_loader_src', 'pd_remove_wp_ver_css_js', 9999);\n\n\n /* ===============\n remove Wp version from scripts\n =============== */\n add_filter('script_loader_src', 'pd_remove_wp_ver_css_js', 9999);\n}", "function remove_generator_meta() {\n\t\tremove_action('wp_head', 'wp_generator');\n\t}", "function bethel_move_jquery() {\n global $wp_scripts;\n foreach ($wp_scripts->registered as $k => $v) {\n if (substr($k, 0, 6) == 'jquery') {\n if (isset($wp_scripts->registered[$k]->ver) && isset($wp_scripts->registered[$k]->src) && $wp_scripts->registered[$k]->deps) {\n $ver = $wp_scripts->registered[$k]->ver;\n $src = $wp_scripts->registered[$k]->src;\n $deps = $wp_scripts->registered[$k]->deps;\n wp_deregister_script ($k);\n wp_register_script($k, $src, $deps, $ver, true);\n }\n }\n }\n}", "function remove_cssjs_ver( $src ) {\n\t$src = remove_query_arg( array('v', 'ver', 'rev'), $src );\n\treturn esc_url($src);\n}", "function cleaning_wp(){\n remove_action('wp_head', 'wp_generator'); // remove WP tag\n\n remove_action( 'wp_head', 'feed_links_extra', 3 ); // remove extra feeds\n remove_action( 'wp_head', 'feed_links', 2 ); // remove general feeds\n remove_action( 'wp_head', 'rsd_link' ); // remove RSD link\n remove_action( 'wp_head', 'wlwmanifest_link' ); // remove manifest link\n remove_action( 'wp_head', 'index_rel_link' ); // remove index link\n remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // remove prev link\n remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // remove start link\n remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // remove links to adjacent posts\n remove_action( 'wp_head', 'wp_shortlink_wp_head'); // remove shortlink\n\n // disable admin bar\n add_filter('the_generator', '__return_false');\n add_filter('show_admin_bar','__return_false');\n\n // disable emoji\n remove_action( 'wp_head', 'print_emoji_detection_script', 7);\n remove_action( 'wp_print_styles', 'print_emoji_styles' );\n\n // disbale json\n remove_action( 'wp_head', 'rest_output_link_wp_head' );\n remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n remove_action( 'template_redirect', 'rest_output_link_header', 11 );\n}", "public function head_cleanup() {\n\n\t\tremove_action( 'wp_head', 'rsd_link' );\n\t\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t\tremove_action( 'wp_head', 'wp_generator' );\n\t}", "function uninstall() {\n\t\t/** globalising of the needed variables, objects and arrays */\n\t\tglobal $db, $apcms;\n\t\t\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['plugins'].\"` WHERE `name`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['rightsidebar'].\"` WHERE `plugin`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['leftsidebar'].\"` WHERE `plugin`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['rightsidebar'].\"` WHERE `plugin`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\n\t}", "function remove_cssjs_ver( $src ) {\nif( strpos( $src, '?ver=' ) )\n$src = remove_query_arg( 'ver', $src );\nreturn $src;\n}", "public function removeNodeWordpress()\n\t{\n\t\t$this->removeNode( 'wp-logo' );\n\t}" ]
[ "0.82148284", "0.8044779", "0.7878838", "0.7878838", "0.74833775", "0.7447804", "0.7428268", "0.74207836", "0.73202467", "0.7311629", "0.73104113", "0.730171", "0.7275161", "0.72141814", "0.71467793", "0.7136071", "0.7071606", "0.7071569", "0.7066507", "0.70492953", "0.70492953", "0.70357895", "0.70325613", "0.7022762", "0.701943", "0.7013049", "0.6961805", "0.69193405", "0.69141173", "0.6903146", "0.68638074", "0.68602395", "0.68448734", "0.68352073", "0.6822125", "0.67842746", "0.6781017", "0.67738646", "0.6773098", "0.6766108", "0.6765939", "0.67611617", "0.6758739", "0.6750589", "0.6745091", "0.67414993", "0.6735877", "0.67170936", "0.6706493", "0.6690771", "0.6683894", "0.66627836", "0.6660171", "0.6651202", "0.65977985", "0.65602046", "0.65595925", "0.6541171", "0.65101606", "0.65050924", "0.648898", "0.6475516", "0.64446867", "0.64344794", "0.6409184", "0.64003617", "0.6373683", "0.6373683", "0.63551736", "0.63522345", "0.6346698", "0.63173765", "0.63132745", "0.6305178", "0.628065", "0.62766725", "0.627566", "0.6266119", "0.6251451", "0.62437105", "0.623577", "0.62350863", "0.6233452", "0.62291986", "0.62273896", "0.6225783", "0.62131715", "0.62029165", "0.62010324", "0.61958295", "0.61824024", "0.6159606", "0.61550426", "0.6150643", "0.6143269", "0.61350155", "0.61283743", "0.61238104", "0.610402", "0.60945517" ]
0.684393
33
remove injected CSS from gallery
function po_gallery_style($css) { return preg_replace( "!<style type='text/css'>(.*?)</style>!s", '', $css ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bleachwave_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n}", "function wpfolio_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n\t}", "function rusticmodern_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n}", "function twentyten_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n}", "function twentyten_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n}", "function start_remove_gallery_style( $css ) {\n\treturn preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "function ti_wp_foundation_theme_gallery_style($css) {\n return preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "function bfa_remove_featured_gallery_scripts() {\r\n remove_action('wp_head', 'gallery_styles');\r\n}", "function remove_gallery_style( $a ) {\n return preg_replace(\"%<style type=\\'text/css\\'>(.*?)</style>%s\", \"\", $a);\n}", "function mdwpfp_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function boiler_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function theme_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function wpgrade_gallery_style($css) {\r\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\r\n}", "function spartan_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function roots_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function bones_gallery_style($css)\n{\n\treturn preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function tlh_gallery_style( $css ) {\n\treturn preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "public function use_default_gallery_style_filter() {\n \treturn false;\n }", "public function clean_galleries($css) {\n return preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n }", "function webbusiness_reset_cache_custom_css() {\n\tdelete_transient('webbusiness_custom_css_preview');\n\twebbusiness_cache_custom_css_preview();\n}", "function bethel_remove_filter_from_gallery_images ($edit) {\n remove_filter ('wp_get_attachment_image_attributes', 'bethel_filter_image_attributes_for_gallery', 10, 2);\n remove_filter ('wp_get_attachment_link', 'bethel_filter_attachment_link_for_gallery', 10, 6);\n return $edit;\n}", "public function meta_box_css() {\n\n ?>\n <style type=\"text/css\">.misc-pub-section:not(.misc-pub-post-status) { display: none; }</style>\n <?php\n\n // Fire action for CSS on Envira post type screens.\n do_action( 'envira_gallery_admin_css' );\n\n }", "function prop_clean() {\n\n remove_action('template_redirect', 'rest_output_link_header', 11);\n remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);\n\n add_filter( 'use_default_gallery_style', '__return_false' );\n\n // Emoji related\n remove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\n}", "function mdwpfp_init_markup_cleanup() {\n add_action('init', 'mdwpfp_head_cleanup');\n\n // Remove WP version from the RSS feed.\n add_filter('the_generator', 'mdwpfp_rss_version');\n\n // Clean the WP generated code around images.\n add_filter('the_content', 'mdwpfp_filter_ptags_on_images');\n\n // Remove pesky injected css for recent comments widget.\n add_filter('wp_head', 'mdwpfp_remove_wp_widget_recent_comments_style', 1);\n // Clean up injected comment styles in the <head>.\n add_action('wp_head', 'mdwpfp_remove_recent_comments_style', 1);\n\n // Clean the default WP photo gallery output.\n add_filter('gallery_style', 'mdwpfp_gallery_style');\n\n}", "function zuhaus_mikado_disable_woocommerce_pretty_photo() {\n\t\tif ( zuhaus_mikado_load_woo_assets() ) {\n\t\t\t\n\t\t\twp_deregister_style( 'woocommerce_prettyPhoto_css' );\n\t\t}\n\t}", "function more_zero_cleanup() {\n function zero_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n }\n\n // This removes inline width/height from images\n function remove_thumbnail_dimensions( $html ) {\n $html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html );\n return $html;\n }\n\n add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 );\n add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 );\n // Removes attached image sizes as well\n add_filter( 'the_content', 'remove_thumbnail_dimensions', 10 );\n\n\n }", "function remove_editor_styles()\n {\n }", "function DisableGutenbergCSS(){\n wp_dequeue_style( 'wp-block-library' );\n wp_dequeue_style( 'wp-block-library-theme' );\n wp_dequeue_style( 'wc-block-style' );\n }", "public function malinky_gallery_styles()\n\t{\n\t\tif ( WP_ENV != 'prod' ) {\n\n\t\t\t/**\n\t\t\t * Style.\n\t\t\t */\t\t\n\t\t\twp_register_style( 'malinky-gallery-style', \n\t\t\t\t\t\t\t\tMALINKY_GALLERY_PLUGIN_URL . '/css/style.css', \n\t\t\t\t\t\t\t\tfalse, \n\t\t\t\t\t\t\t\tNULL\n\t\t\t);\n\t\t\twp_enqueue_style( 'malinky-gallery-style' );\n\n\t\t}\n\t\t\n\t}", "function strip_shortcode_gallery( $content, $code ) {\n\t preg_match_all( '/'. get_shortcode_regex() .'/s', $content, $matches, PREG_SET_ORDER );\n\n\t if ( ! empty( $matches ) ) {\n\t foreach ( $matches as $shortcode ) {\n\t if ( $code === $shortcode[2] ) {\n\t $pos \t= strpos( $content, $shortcode[0] );\n\t \t\t\t$pos2 \t= strlen($shortcode[0]);\n\t if ($pos !== false) {\n\t \t$content = substr_replace( $content, '', $pos, $pos2 );\n\t\t\t\t\t}\n\t }\n\t }\n\n\t\t\t\n\t\t\n\t\t\t$content = str_replace( ']]>', ']]&gt;', apply_filters( 'the_content', $content ) );\n\t \t\n\t \techo $content;\n\t\t\n\t\t} else {\n\t\t\techo apply_filters( 'the_content', $content );\t\t\t\n\t\t}\n\n\n}", "public function stop_previewing_theme()\n {\n }", "function remove_block_css() {\n wp_dequeue_style( 'wp-block-library' ); // Wordpress core\n}", "function disable_shopp_css() {\n\tglobal $Shopp;\n\tremove_action('wp_head',array(&$Shopp,'header'));\n}", "function carousel_remove_junk_action_javascript() { \n ?>\n <script type=\"text/javascript\" >\n \"use strict\";\n jQuery(document).ready(function($) {\n setTimeout(function(){\n $('.wpbooklist_carousel_inner_main_display_div a').each(function(){\n $(this).removeClass('wpbooklist-show-book-colorbox');\n $(this).find('span').remove();\n })\n },2000)\n });\n </script>\n <?php\n}", "public function mm_default_css() {\n $default_css = CSS_DIR . DEFAULT_CSS;\n $new_css = CSS_DIR . CUSTOM_CSS;\n ob_start();\n @include( $default_css );\n $css = ob_get_contents();\n ob_end_clean();\n \n $css = stripslashes ( $css );\n \n update_option('mm_gallery_css', $css);\n file_put_contents($new_css, $css); \n }", "function launchpad_head_cleanup() {\n\tremove_action('wp_head', 'feed_links', 2);\n\tremove_action('wp_head', 'feed_links_extra', 3);\n\tremove_action('wp_head', 'rsd_link');\n\tremove_action('wp_head', 'wlwmanifest_link');\n\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\tremove_action('wp_head', 'wp_generator');\n\tremove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);\n\tremove_action('wp_head', 'noindex', 1);\n\tremove_action('wp_head', 'rel_canonical', 10);\n\t\n\tadd_filter('use_default_gallery_style', '__return_null');\n}", "function cardealer_head_cleanup() {\r\n\tadd_filter( 'style_loader_src', 'cardealer_remove_wp_ver_css_js', 9999 ); // remove WP version from css\r\n\tadd_filter( 'script_loader_src', 'cardealer_remove_wp_ver_css_js', 9999 ); // remove WP version from scripts\r\n}", "function jetpackme_remove_rp() {\n\tif ( class_exists( 'Jetpack_relatedPosts')) {\n\t\t$jprp = Jetpack_relatedPosts::init();\n\t\t$callback = array ( $jprp, 'filter_add_target_to_dom' );\n\t\tremove_filter( 'the_content', $callback, 40);\n\t}\n}", "public function clear_preview() {}", "function _h_remove_jetpack_head_assets() {\n wp_dequeue_script('devicepx');\n wp_dequeue_style('sharedaddy');\n wp_dequeue_style('social-logos');\n}", "function vip_admin_gallery_css_extras() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function ru_filter_styles(){\n $this->removestyle(\"bbp-default\");\n\n // download monitor is not used in the front-end.\n $this->removestyle(\"wp_dlmp_styles\");\n\n if( !is_singular( 'docs' ) ){\n // the table of contents plugin is being used on documentation pages only\n $this->removestyle(\"toc-screen\");\n }\n\n if ( !( is_page( 'account' ) || is_page( 'edit-profile' )) ){\n // this should not be like this. Need to look into it.\n $this->removestyle(\"wppb_stylesheet\");\n }\n\n if( !is_singular( array('docs', 'post' ) ) ){\n $this->removestyle(\"codebox\");\n }\n }", "function smartwp_remove_wp_block_library_css(){\nwp_dequeue_style( 'wp-block-library' );\nwp_dequeue_style( 'wp-block-library-theme' );\nwp_dequeue_style( 'wc-block-style' ); // Remove WooCommerce block CSS\n}", "function smartwp_remove_wp_block_library_css(){\n wp_dequeue_style( 'wp-block-library' );\n wp_dequeue_style( 'wp-block-library-theme' );\n wp_dequeue_style( 'wc-block-style' ); // Remove WooCommerce block CSS\n }", "function remove_theme_mods()\n {\n }", "function multi_post_thumbnail_links() {\n echo '<style type=\"text/css\">\n .media-php .post-slidewhow_image-thumbnail{display: none;}\n .media-php .page-slidewhow_image-thumbnail{display: none;}\n .media-php .project-slidewhow_image-thumbnail{display: none;}\n </style>';\n}", "public function disableCompressCss() {}", "function remove_custom_image_header()\n {\n }", "function remove_all_shortcodes()\n {\n }", "function _wp_post_thumbnail_class_filter_remove($attr)\n {\n }", "function wpgrade_head_cleanup() {\r\n\t// Remove WP version\r\n\tremove_action( 'wp_head', 'wp_generator' );\r\n\t\r\n\tremove_action( 'wp_head', 'rsd_link' );\r\n\t// windows live writer\r\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\r\n\t\r\n\t// remove WP version from css - those parameters can prevent caching\r\n\t//add_filter( 'style_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\t// remove WP version from scripts - those parameters can prevent caching\r\n\t//add_filter( 'script_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\r\n}", "function hook_image_style_flush($style) {\n // Empty cached data that contains information about the style.\n cache_clear_all('*', 'cache_mymodule', TRUE);\n}", "public function disableConcatenateCss() {}", "function _vip_admin_gallery_css_extras() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function unhook_parent_style() {\n \n wp_dequeue_style( 'genericons' );\n\twp_deregister_style( 'genericons' );\n wp_dequeue_style( 'twentyfifteen-ie' );\n\twp_deregister_style( 'twentyfifteen-ie' );\n wp_dequeue_style( 'twentyfifteen-ie7' );\n\twp_deregister_style( 'twentyfifteen-ie7' );\n wp_dequeue_style( 'twentyfifteen-fonts' );\n\twp_deregister_style( 'twentyfifteen-fonts' );\n}", "function remove_default_admin_stylesheets() {\n \t// wp_deregister_style('wp-reset-editor-styles');\n }", "public function tear_down() {\n\t\tremove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );\n\t\tparent::tear_down();\n\t}", "function wpview_media_sandbox_styles()\n {\n }", "function remove_image_zoom_support() {\n remove_theme_support( 'wc-product-gallery-zoom' );\n }", "function _wp_post_thumbnail_context_filter_remove()\n {\n }", "function gallery_styles() {\r\n $gallery_path = get_bloginfo('wpurl').\"/wp-content/plugins/featured-content-gallery/\";\r\n\r\n /* The xhtml header code needed for gallery to work: */\r\n\t$galleryscript = \"\r\n\t<!-- begin gallery scripts -->\r\n <link rel=\\\"stylesheet\\\" href=\\\"\".$gallery_path.\"css/jd.gallery.css.php\\\" type=\\\"text/css\\\" media=\\\"screen\\\" charset=\\\"utf-8\\\"/>\r\n\t<link rel=\\\"stylesheet\\\" href=\\\"\".$gallery_path.\"css/jd.gallery.css\\\" type=\\\"text/css\\\" media=\\\"screen\\\" charset=\\\"utf-8\\\"/>\r\n\t<script type=\\\"text/javascript\\\" src=\\\"\".$gallery_path.\"scripts/mootools.v1.11.js\\\"></script>\r\n\t<script type=\\\"text/javascript\\\" src=\\\"\".$gallery_path.\"scripts/jd.gallery.js.php\\\"></script>\r\n\t<script type=\\\"text/javascript\\\" src=\\\"\".$gallery_path.\"scripts/jd.gallery.transitions.js\\\"></script>\r\n\t<!-- end gallery scripts -->\\n\";\r\n\t\r\n\t/* Output $galleryscript as text for our web pages: */\r\n\techo($galleryscript);\r\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function child_manage_woocommerce_styles() {\n\tremove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );\t\n\t\n\t// Remove prettyPhoto Init\n\twp_dequeue_script( 'prettyPhoto-init' );\n\t\n\t// Load prettyPhoto init for non-mobile devices\n\tif ( !wp_is_mobile() ) {\n\t\twp_enqueue_script( 'wpex-prettyPhoto-init', get_template_directory_uri() .'/js/prettyphoto-init.js', array('prettyPhoto'), '', true );\n\t}\n\t\n}", "function medula_remove_plugin_image_sizes() {\n\tremove_image_size('image-name');\n}", "public function removeStyleDec() {\n\t}", "public function htheme_remove_default_elements(){\r\n\r\n\t\t/*vc_remove_element(\"vc_row\");*/\r\n\t\tvc_remove_element(\"vc_cta_button2\");\r\n\t\tvc_remove_element(\"vc_button2\");\r\n\t\tvc_remove_element(\"vc_masonry_media_grid\");\r\n\t\tvc_remove_element(\"vc_masonry_grid\");\r\n\t\tvc_remove_element(\"vc_masonry_grid\");\r\n\t\tvc_remove_element(\"vc_media_grid\");\r\n\t\tvc_remove_element(\"vc_basic_grid\");\r\n\t\tvc_remove_element(\"vc_cta\");\r\n\t\tvc_remove_element(\"vc_btn\");\r\n\t\tvc_remove_element(\"vc_custom_heading\");\r\n\t\tvc_remove_element(\"vc_empty_space\");\r\n\t\tvc_remove_element(\"vc_line_chart\");\r\n\t\tvc_remove_element(\"vc_round_chart\");\r\n\t\tvc_remove_element(\"vc_pie\");\r\n\t\tvc_remove_element(\"vc_raw_js\");\r\n\t\tvc_remove_element(\"vc_raw_html\");\r\n\t\tvc_remove_element(\"vc_video\");\r\n\t\tvc_remove_element(\"vc_widget_sidebar\");\r\n\t\tvc_remove_element(\"vc_tta_pageable\");\r\n\t\tvc_remove_element(\"vc_tta_accordion\");\r\n\t\tvc_remove_element(\"vc_tta_tour\");\r\n\t\tvc_remove_element(\"vc_tta_tabs\");\r\n\t\tvc_remove_element(\"vc_gallery\");\r\n\t\tvc_remove_element(\"vc_gallery\");\r\n\t\tvc_remove_element(\"vc_text_separator\");\r\n\t\t//vc_remove_element(\"vc_icon\");\r\n\t\t//vc_remove_element(\"vc_column_text\");\r\n\t\tvc_remove_element(\"vc_button\");\r\n\t\tvc_remove_element(\"vc_posts_slider\");\r\n\t\tvc_remove_element(\"vc_gmaps\");\r\n\t\tvc_remove_element(\"vc_teaser_grid\");\r\n\t\tvc_remove_element(\"vc_progress_bar\");\r\n\t\tvc_remove_element(\"vc_facebook\");\r\n\t\tvc_remove_element(\"vc_tweetmeme\");\r\n\t\tvc_remove_element(\"vc_googleplus\");\r\n\t\tvc_remove_element(\"vc_facebook\");\r\n\t\tvc_remove_element(\"vc_pinterest\");\r\n\t\tvc_remove_element(\"vc_message\");\r\n\t\tvc_remove_element(\"vc_posts_grid\");\r\n\t\tvc_remove_element(\"vc_carousel\");\r\n\t\tvc_remove_element(\"vc_flickr\");\r\n\t\tvc_remove_element(\"vc_tour\");\r\n\t\tvc_remove_element(\"vc_separator\");\r\n\t\tvc_remove_element(\"vc_single_image\");\r\n\t\tvc_remove_element(\"vc_cta_button\");\r\n\t\tvc_remove_element(\"vc_accordion\");\r\n\t\tvc_remove_element(\"vc_accordion_tab\");\r\n\t\tvc_remove_element(\"vc_toggle\");\r\n\t\tvc_remove_element(\"vc_tabs\");\r\n\t\tvc_remove_element(\"vc_tab\");\r\n\t\tvc_remove_element(\"vc_images_carousel\");\r\n\t\tvc_remove_element(\"vc_wp_archives\");\r\n\t\tvc_remove_element(\"vc_wp_calendar\");\r\n\t\tvc_remove_element(\"vc_wp_categories\");\r\n\t\tvc_remove_element(\"vc_wp_custommenu\");\r\n\t\tvc_remove_element(\"vc_wp_links\");\r\n\t\tvc_remove_element(\"vc_wp_meta\");\r\n\t\tvc_remove_element(\"vc_wp_pages\");\r\n\t\tvc_remove_element(\"vc_wp_posts\");\r\n\t\tvc_remove_element(\"vc_wp_recentcomments\");\r\n\t\tvc_remove_element(\"vc_wp_rss\");\r\n\t\tvc_remove_element(\"vc_wp_search\");\r\n\t\tvc_remove_element(\"vc_wp_tagcloud\");\r\n\t\tvc_remove_element(\"vc_wp_text\");\r\n\t\tvc_remove_element(\"woocommerce_cart\");\r\n\t\tvc_remove_element(\"woocommerce_checkout\");\r\n\t\tvc_remove_element(\"woocommerce_order_tracking\");\r\n\t\tvc_remove_element(\"woocommerce_my_account\");\r\n\t\tvc_remove_element(\"recent_products\");\r\n\t\tvc_remove_element(\"featured_products\");\r\n\t\tvc_remove_element(\"product\");\r\n\t\tvc_remove_element(\"products\");\r\n\t\tvc_remove_element(\"add_to_cart\");\r\n\t\tvc_remove_element(\"add_to_cart_url\");\r\n\t\tvc_remove_element(\"product_page\");\r\n\t\tvc_remove_element(\"product_category\");\r\n\t\tvc_remove_element(\"product_categories\");\r\n\t\tvc_remove_element(\"sale_products\");\r\n\t\tvc_remove_element(\"best_selling_products\");\r\n\t\tvc_remove_element(\"top_rated_products\");\r\n\t\tvc_remove_element(\"product_attribute\");/**/\r\n\t}", "function start_remove_wp_block_library_css() {\n\twp_dequeue_style( 'wp-block-library' );\n\twp_dequeue_style( 'wp-block-library-theme' );\n\twp_dequeue_style( 'wc-block-style' ); // Remove WooCommerce block CSS\n}", "function remove_custom_background()\n {\n }", "function head_cleanup(){\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\tremove_action( 'wp_head', 'index_rel_link' );\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\tremove_action( 'wp_head', 'wp_generator' );\n\tadd_filter( 'style_loader_src', 'remove_wp_ver_css_js', 9999 );\n\tadd_filter( 'script_loader_src', 'remove_wp_ver_css_js', 9999 );\n}", "function wp_deregister_style($handle)\n {\n }", "function fs_head_cleanup() {\r\n\t// Originally from http://wpengineer.com/1438/wordpress-header/\r\n\tremove_action( 'wp_head', 'feed_links', 2 );\r\n\tremove_action( 'wp_head', 'feed_links_extra', 3 );\r\n\tremove_action( 'wp_head', 'rsd_link' );\r\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\r\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\r\n\tremove_action( 'wp_head', 'wp_generator' );\r\n\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\r\n\r\n\tglobal $wp_widget_factory;\r\n\tremove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );\r\n\r\n\tadd_filter( 'use_default_gallery_style', '__return_null' );\r\n}", "function thb_remove_blog_grid_options() {\n\t\tif ( thb_get_admin_template() == 'template-blog-grid.php' ) {\n\t\t\t$fields_container = thb_theme()->getPostType( 'page' )->getMetabox( 'layout' )->getTab( 'blog_loop' )->getContainer( 'loop_container' );\n\t\t\t$fields_container->removeField( 'thumbnails_open_post' );\n\t\t}\n\t}", "function hmg_remove_featured() {\n\n\tif( get_option( 'hmg_manage_featured', true ) && get_option( 'hmg_post_type' ) )\n\t\tforeach( get_option( 'hmg_post_type' ) as $post_type )\n\t\t\tremove_meta_box( 'postimagediv', $post_type, 'side' );\n\n}", "function spartan_head_cleanup() {\n\t// EditURI link\n\tremove_action( 'wp_head', 'rsd_link' );\n\t// windows live writer\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t// index link\n\tremove_action( 'wp_head', 'index_rel_link' );\n\t// previous link\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\t// start link\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t// links for adjacent posts\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\t// WP version\n\tremove_action( 'wp_head', 'wp_generator' );\n // remove WP version from css\n add_filter( 'style_loader_src', 'spartan_remove_wp_ver_css_js', 9999 );\n // remove Wp version from scripts\n add_filter( 'script_loader_src', 'spartan_remove_wp_ver_css_js', 9999 );\n\n}", "public function init() {\n\n\t\t\tremove_shortcode('gallery', 'gallery_shortcode');\n\t\t\tadd_shortcode('gallery', array($this, 'gallery_shortcode'));\n\t\t}", "function dynamik_skin_images_cleanup()\n{\n\t$dynamik_gen_skin_options = get_option( 'dynamik_gen_skin_options' );\n\t$dynamik_gen_active_skin_options = get_option( 'dynamik_gen_' . $dynamik_gen_skin_options['active_skin'] . '_skin' );\n\t$skin_images_list = is_array( $dynamik_gen_active_skin_options['skin_images_list'] ) ? $dynamik_gen_active_skin_options['skin_images_list'] : array();\n\n\t$handle = opendir( dynamik_get_stylesheet_location( 'path' ) . 'images' );\n\twhile( false !== ( $file = readdir( $handle ) ) )\n\t{\n\t\t$ext = strtolower( substr( strrchr( $file, '.' ), 1 ) );\n\t\tif( $ext == 'jpg' || $ext == 'jpeg' || $ext == 'gif' || $ext == 'png' )\n\t\t{\n\t\t\tif( in_array( $file, $skin_images_list ) )\n\t\t\t{\n\t\t\t\tif( file_exists( dynamik_get_stylesheet_location( 'path' ) . 'images' . '/' . $file ) )\n\t\t\t\t\tunlink( dynamik_get_stylesheet_location( 'path' ) . 'images' . '/' . $file );\n\n\t\t\t\tif( file_exists( dynamik_get_stylesheet_location( 'path' ) . 'images' . '/adminthumbnails/' . $file ) )\n\t\t\t\t\tunlink( dynamik_get_stylesheet_location( 'path' ) . 'images' . '/adminthumbnails/' . $file );\n\t\t\t}\n\t\t}\n\t}\n\tclosedir( $handle );\n}", "function remove_plugin_assets() {\n wp_dequeue_style('roots-share-buttons'); // roots-share-buttons/assets/styles/share-buttons.css\n wp_dequeue_script('roots-share-buttons'); //roots-share-buttons/assets/scripts/share-buttons.js\n wp_dequeue_style('wp-biographia-bio'); //wp-biographia/css/wp-biographia-min.css\n}", "function html5_style_remove( $tag ) {\n return preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}", "function first_edition_deregister_styles() {\n\tif ( '' != get_option( 'first_edition_font_pair' ) ) {\n\t\twp_dequeue_style( 'quattrocento' );\n\t\twp_dequeue_style( 'quattrocento-sans' );\n\t}\n}", "function slug_disable_woocommerce_block_editor_styles()\n{\n wp_deregister_style('wc-block-editor');\n wp_deregister_style('wc-block-style');\n}", "public function head_cleanup() {\n\t\t// RSS links.\n\t\t$this->remove_action( 'wp_head', 'feed_links_extra', 3 );\n\t\t$this->remove_action( 'wp_head', 'rsd_link' );\n\n\t\t// Manifest link.\n\t\t$this->remove_action( 'wp_head', 'wlwmanifest_link' );\n\n\t\t// Prev / next post links.\n\t\t$this->remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\n\t\t// Generator tag.\n\t\t$this->remove_action( 'wp_head', 'wp_generator' );\n\t\t$this->add_filter( 'the_generator', '__return_false' );\n\n\t\t// Shortlink.\n\t\t$this->remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\n\n\t\t// Emoji scripts & styles.\n\t\t$this->remove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\t\t$this->remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\t\t$this->remove_action( 'wp_print_styles', 'print_emoji_styles' );\n\t\t$this->remove_action( 'admin_print_styles', 'print_emoji_styles' );\n\t\t$this->remove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n\t\t$this->remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\t\t$this->remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\n\t\t// Inline gallery styles.\n\t\t$this->add_filter( 'use_default_gallery_style', '__return_false' );\n\t}", "protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }", "function remove_image_links() {\n update_option('image_default_link_type', 'none');\n}", "function ct_clean_bigcommerce( $css ) {\n return '';\n}", "function deenqueue_parent_scripts_styles() {\n wp_dequeue_script( 'one-page-slitslider' );\n wp_deregister_script( 'one-page-slitslider' );\n wp_dequeue_script( 'one-page-custom' );\n wp_deregister_script( 'one-page-custom' );\n}", "function ks_style_remove( $tag ) {\n\treturn preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}", "public function reset_cache() {\n remove_theme_mod( 'athen_customizer_css_cache' );\n }", "function wph_remove_p_images($content) {\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function remove_gravityforms_style() {\n\twp_dequeue_style('gforms_css');\n}", "function briavers_remove_image_type_support() {\n remove_post_type_support( 'image_contest', 'editor' );\n}", "function pd_head_cleanup()\n{\n\n /* ===============\n Remove RSS from header\n =============== */\n remove_action('wp_head', 'rsd_link'); #remove page feed\n remove_action('wp_head', 'feed_links_extra', 3); // Remove category feeds\n remove_action('wp_head', 'feed_links', 2); // Remove Post and Comment Feeds\n\n\n /* ===============\n remove windindows live writer link\n =============== */\n remove_action('wp_head', 'wlwmanifest_link');\n\n\n /* ===============\n links for adjacent posts\n =============== */\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\n\n /* ===============\n WP version\n =============== */\n remove_action('wp_head', 'wp_generator');\n\n\n /* ===============\n remove WP version from css\n =============== */\n add_filter('style_loader_src', 'pd_remove_wp_ver_css_js', 9999);\n\n\n /* ===============\n remove Wp version from scripts\n =============== */\n add_filter('script_loader_src', 'pd_remove_wp_ver_css_js', 9999);\n}", "function attachment_image_link_remove_filter($content) {\n $content = preg_replace(array('{<a(.*?)(wp-att|wp-content\\/uploads)[^>]*><img}', '{ wp-image-[0-9]*\" /></a>}'), array('<img', '\" />'), $content);\n return $content;\n}", "function magazinevibe_child_remove_first_image( $content ) {\n\t$dom = new DOMDocument();\n\t$dom->loadHTML( $content );\n\t$images = $dom->getElementsByTagName( 'img' );\n\n\tforeach ( $images as $image ) {\n\t\t$parent = $image->parentNode;\n\t\tif ( $parent->nodeName ) {\n\t\t\t$parent->parentNode->removeChild( $parent );\n\t\t\t$content = $dom->saveHTML();\n\t\t\t$content = str_replace('&Acirc;', '', $content);\n\t\t\treturn $content;\n\t\t}\n\t}\n\n\t$content = str_replace('&Acirc;', '', $content);\n\n\treturn $content;\n}", "function replace_widjets_content() {\n remove_action( 'widgets_init', 'envo_storefront_widgets_init' );\n}", "function _h_remove_jetpack_footer_assets() {\n wp_deregister_script('sharing-js');\n\n // disable spinner when infinite loading is enabled\n wp_deregister_script('jquery.spin');\n wp_deregister_script('spin');\n}", "function remove_bloat() {\n\n\t\t\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\t\t\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\t\t\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\n\t\t\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\t\t\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t\t\tremove_action( 'wp_head', 'wp_resource_hints', 2 );\n\t\t\tremove_action( 'wp_head', 'rsd_link' );\n\t\t\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );\n\t\t\tremove_action( 'template_redirect', 'wp_shortlink_header', 11, 0 );\n\t\t\tremove_action( 'wp_head', 'feed_links_extra', 3 );\n\t\t\tremove_action( 'wp_head', 'feed_links', 2 );\n\t\t\tremove_action( 'wp_head', 'rel_canonical' );\n\t\t\tremove_action( 'wp_head', 'rsd_link' );\n\t\t\tremove_action( 'wp_head', 'wp_generator' );\n\t\t\tremove_action( 'wp_head', 'index_rel_link' );\n\t\t\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\t\t\tremove_action( 'wp_head', 'rest_output_link_wp_head' );\n\t remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n\t\t\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t\t\tremove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );\n\t\t\tremove_action( 'template_redirect', 'rest_output_link_header', 11, 0 );\n\t\t\tremove_action('opml_head','the_generator');\n\t\t\t\n\t\t\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\t\t\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n\t\t\tremove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\t\t\t\n\t\t}", "function ct_remove_assets() {\n wp_dequeue_style( 'bigcommerce-styles' );\n\n if ( ct_is_pagespeed() ) {\n wp_dequeue_script( 'bigcommerce-manifest' );\n wp_dequeue_script( 'bigcommerce-vendors' );\n wp_dequeue_script( 'bigcommerce-scripts' );\n } else {\n wp_enqueue_script( 'smile.io', 'https://cdn.sweettooth.io/assets/storefront.js', array(), '1.0', true );\n }\n}" ]
[ "0.7787884", "0.7713304", "0.7709339", "0.76458716", "0.76458716", "0.7619448", "0.75321317", "0.74490476", "0.73914856", "0.7388842", "0.738003", "0.7356031", "0.734546", "0.7308483", "0.73073465", "0.7305299", "0.7213021", "0.69508654", "0.6883758", "0.6528112", "0.63088024", "0.6305626", "0.6216887", "0.6180356", "0.6150383", "0.60698164", "0.605263", "0.6041942", "0.60406923", "0.6032412", "0.60282177", "0.6021497", "0.599882", "0.5992469", "0.5986771", "0.5978152", "0.5943852", "0.5939755", "0.591877", "0.5914131", "0.58810425", "0.5857167", "0.58352965", "0.58302253", "0.58295745", "0.5808354", "0.5793644", "0.57935333", "0.57827306", "0.5779976", "0.5774108", "0.5736945", "0.57345176", "0.5721127", "0.57173944", "0.57027054", "0.5684958", "0.5684809", "0.5684715", "0.5652467", "0.5647337", "0.5634348", "0.56234145", "0.56234145", "0.56234145", "0.5614393", "0.56101775", "0.560682", "0.560633", "0.56045073", "0.559856", "0.55971813", "0.55884093", "0.558164", "0.5580603", "0.55765456", "0.5575591", "0.5569655", "0.5568409", "0.5557467", "0.55365473", "0.5533725", "0.5532991", "0.55182856", "0.55108035", "0.5500625", "0.54981935", "0.5494889", "0.5494313", "0.5480918", "0.5477754", "0.5475853", "0.5473594", "0.5469686", "0.5461196", "0.5458075", "0.54554015", "0.5452316", "0.5450195", "0.54493386" ]
0.73092705
13
/ end po theme support MENUS Register Navigation Menus
function register_po_nav_menus() { $locations = array( 'main-navi' => __( 'Site main navigations', 'text_domain' ), 'footer-link' => __( 'Site secondary links', 'text_domain' ), 'cart-link' => __( 'Cart links', 'text_domain' ), 'socmed-link' => __( 'Social media links', 'text_domain' ) ); register_nav_menus( $locations ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function omega_register_menus() {\n\tregister_nav_menu( 'primary', _x( 'Primary', 'nav menu location', 'omega' ) );\n}", "function basetheme_nav_init()\n{\n\n\tregister_nav_menus( array(\n 'header' => 'Header',\n 'footer' => 'Footer'\n\t) );\n\n}", "function get_registered_nav_menus()\n {\n }", "function theme_nav_menus(){\n\t register_nav_menus( array(\n\t 'main'=>'Main Menu',\n\t 'footer'=>'Footer Menu'\n\t ) );\n\t}", "function theme_nav_menus(){\n register_nav_menus( array(\n 'main'=>'Main Menu',\n 'footer'=>'Footer Menu'\n ) );\n}", "function registerMenus() {\n\t\t\tregister_nav_menu( 'nav-1', __( 'Top Navigation' ) );\n\t\t}", "function pantomime_register_menu(){\n\tif ( function_exists( 'register_nav_menus' ) ) {\n\t\tregister_nav_menus(\n\t\t\tarray(\n\t\t\t 'main_nav' => 'Main Navigation'\n\t\t\t)\n\t\t);\n\t}\t\n}", "function register_my_menus() {\r\n register_nav_menus(\r\n array(\r\n 'primary-nav' => __( 'Primary Navigation' ),\r\n 'bottom-nav' => __( 'Bottom Navigation' )\r\n )\r\n );\r\n}", "function register_menus()\n{\n register_nav_menus(array(\n 'primary' => __('Primary Navigation', 'pd'),\n 'footer' => __('Footer Navigation', 'pd'),\n ));\n}", "function nav_menu_register() {\n\tregister_nav_menus(array(\n\t\t'primary-nav' => esc_html__('Primary Nav'),\n\t));\n}", "function lepetitfleur_register_nav_menu() {\n\tregister_nav_menu('primary', 'Header Navigtion Menu' );\n}", "function register_my_menu()\r\n{\r\n register_nav_menus(\r\n array(\r\n 'main' => 'Menu Principal',\r\n 'footer' => 'Menu Bas de Page',\r\n 'social' => 'Menu Réseaux Sociaux',\r\n 'side' => 'Menu bouton toggler'\r\n )\r\n );\r\n}", "public function register_menus() {\n // register_nav_menus(array(\n // 'header_menu' => 'Header Navigation Menu'\n // ));\n }", "function gymfitness_menus(){ \n register_nav_menus(array(\n 'menu-principal' =>__('Menu principal', 'gymfitness'),\n 'menu-principal2' =>__('Menu principal2', 'gymfitness')\n\n ));\n}", "function register_menus()\n{\n register_nav_menus(array(\n 'header' => __('Header Menu', 'html5blank'),\n 'sidebar' => __('Sidebar Menu', 'html5blank'),\n 'footer' => __(\"Footer Menu\", \"html5blank\"),\n 'kievari' => \"Kievari Menu\"\n ));\n}", "function fp_menus() {\n\t\n \tregister_nav_menus( \n\t\tarray(\n\t\t\t'header-menu' => 'Header Menu',\n\t\t\t'footer-menu' => 'Footer Menu'\n\t\t) \n\t);\n}", "function show_my_menus(){\n register_nav_menu('mainmenu', 'Huvudmeny');\n register_nav_menu('footermenu', 'Sociala medier');\n register_nav_menu('sidemenu', 'Sidomeny');\n register_nav_menu('blogsidepage', 'Blogg sidomeny sidor');\n register_nav_menu('blogsidearchive', 'Blogg sidomeny arkiv');\n register_nav_menu('blogsidecategory', 'Blogg sidomeny kategorier');\n}", "function register_ac_menu() \n{\n register_nav_menu( 'primary', 'Primary Menu' );\n}", "function zweidrei_eins_menus() {\n\n\t$locations = array(\n\t\t'header' => __( 'Header Menu'),\n\t\t'footer' => __( 'Footer Menu'),\n );\n\n\tregister_nav_menus( $locations );\n}", "public function fxm_register_menus()\n\t\t{\n\t\t\t$locations = array(\n\t\t\t\t'primary' \t=> __('Primary Menu', 'fxm'),\n\t\t\t\t'utilities' => __('Utilities Menu', 'fxm'),\n\t\t\t\t'mobile' \t \t=> __('Mobile Hamburger Menu', 'fxm'),\n\t\t\t\t'footer' \t \t=> __('Footer Menu', 'fxm'),\n\t\t\t\t'social' \t=> __( 'Social Menu', 'twentytwenty' ),\n\t\t\t);\n\t\t\tregister_nav_menus($locations);\n\t\t}", "function power_register_nav_menus() {\n\n\tif ( ! current_theme_supports( 'power-menus' ) ) {\n\t\treturn;\n\t}\n\n\t$menus = get_theme_support( 'power-menus' );\n\n\tregister_nav_menus( (array) $menus[0] );\n\n\t/**\n\t * Fires after registering custom Power navigation menus.\n\t *\n\t * @since 1.8.0\n\t */\n\tdo_action( 'power_register_nav_menus' );\n\n}", "function travomath_register_nav_menu() {\n\tregister_nav_menu( 'primary', 'Header Navigation Menu' );\n\tregister_nav_menu( 'secondary', 'Footer Navigation Menu' );\n}", "public function register_nav_menus()\n {\n \\register_nav_menus(\n array(\n 'header-menu' => __('Header Menu'),\n 'footer-menu' => __('Footer Menu'),\n 'mobile-menu' => __('Mobile Menu')\n )\n );\n }", "function morganceken_register_menus() {\r\n\tadd_theme_support( 'menus' );\r\n}", "function registrar_menu() {\nregister_nav_menu('menuprincipal', __('Menu Principal'));\n}", "function sunset_register_nav_menu() {\n\tregister_nav_menu( 'primary', 'Header Navigation Menu' );\n\tregister_nav_menu( 'top-header', 'Top Header Navigation Menu' );\n}", "function skudo_menus() {\n\tregister_nav_menu('PrimaryNavigation', 'Main Navigation');\n\tregister_nav_menu('woonav', 'WooCommerce Menu');\n\tregister_nav_menu('topbarnav', 'Top Bar Navigation');\n}", "function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}", "function register_menus() {\n\tregister_nav_menu( 'main', __( 'Main Menu', 'postlight-headless-wp' ) );\n}", "function naked_register_navigation(){\n register_nav_menus(\n array(\n 'primary' => __( 'Primary Menu', 'naked' ),\n 'single' => __( 'Single Menu', 'naked' ) // Register the Primary menu\n // Copy and paste the line above right here if you want to make another menu,\n // just change the 'primary' to another name\n )\n );\n}", "function register_my_menu() {\n register_nav_menu('main-menu',__( 'Navegador Primario' ));\n }", "function fumseck_register_menus() {\n\tregister_nav_menus(\n\t\tarray(\n\t\t\t'fumseck_top_nav' => __( 'Primary top navigation', 'fumseck' ),\n\t\t\t'fumseck_about_menu' => __( 'Menu for About page set', 'fumseck' )\n\t\t)\n\t);\n}", "function artspace_aboutmenu() {\n\n\t$locations = array(\n\t\t'orange' => __( 'Top About Menu', 'text_domain' ),\n\t);\n\tregister_nav_menus( $locations );\n\n}", "function mkRegisterMenu() {\n \n register_nav_menu('primary', 'Main Menu');\n \n }", "public function registerMenus() {\n $locations = array();\n foreach (Project::$menus as $slug => $name) {\n $locations[$slug] = __($name, Project::$projectNamespace);\n }\n register_nav_menus($locations);\n }", "function wob_setup() {\n register_nav_menus( array(\n 'primary' => esc_html__( 'Primary', 'acstarter' ),\n 'sitemap' => esc_html__( 'Sitemap', 'acstarter' ),\n ) );\n\n}", "function gucci_register_menus() {\n\tregister_nav_menus(\n\t\tarray( 'main-menu' => __('Main Menu') )\n\t);\n}", "function folio_register_nav_menu()\n{\n register_nav_menu('primary', 'Sidebar Menu');\n}", "function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\n}", "function elzero_add_menu() {\n // register_nav_menu('manin-menu', __('Main Navigation Menu'));\n register_nav_menus(array(\n 'main-menu' => 'Main Navigation Menu',\n 'footer-menu' => 'Footer Classic Menu'\n ));\n}", "function register_menus() { \n register_nav_menus(\n array(\n 'main-menu' => 'Main Menu', //primary menu\n )\n ); \n}", "function register_my_menus() {\n register_nav_menus(\n array( \n \t'header_navigation' => __( 'Header Navigation' ), \n \t'sidebar_navigation' => __( 'Sidebar Navigation' ),\n \t'mobile_navigation' => __( 'Mobile Navigation' ),\n \t'footer_navigation_1' => __( 'Footer Navigation 1' ),\n \t'footer_navigation_2' => __( 'Footer Navigation 2' ),\n \t'footer_navigation_3' => __( 'Footer Navigation 3' ),\n \t'footer_navigation_4' => __( 'Footer Navigation 4' )\n )\n );\n}", "function register_my_menus() {\n register_nav_menus (\n array(\n 'top-menu' => 'Top menu'\n )\n );\n}", "function register_theme_menus() {\n register_nav_menus(array(\n 'pagrindinis-menu' => __( 'Pagrindinis meniu' ),\n 'apatinis-menu' => __( 'Apatinis meniu' ),\n ));\n}", "function register_my_menu() {\n register_nav_menus(array(\n \t'top_menu' \t \t\t=> 'Top Menu',\n \t'council_first_menu'=> 'Council First Menu',\n \t'council_sec_menu' \t=> 'Council Second Menu',\n \t'council_third_menu'=> 'Council Third Menu',\n \t'contact_menu_one'\t=> 'Contact First Menu',\n \t'contact_menu_two'\t=> 'Contact Second Menu',\n \t'enjoy_menu'\t\t=> 'Enjoy Kasrin Menu',\n \t'news_menu'\t\t\t=> 'News Menu',\n \t'initate_menu' \t \t=> 'Initate Menu',\n \t'footer_menu_one' => 'Footer Menu 1',\n\t\t'footer_menu_tow' => 'Footer Menu 2',\n\t\t'footer_menu_three' => 'Footer Menu 3',\n\t\t'footer_menu_four' => 'Footer Menu 4',\n\t\t'footer_menu_five' => 'Footer Menu 5'\n ));\n}", "function jn_menu_setup() {\n register_nav_menu('primary', __('Primary Menu', 'jn'));\n}", "function rt_custom_menu() {\n register_nav_menus(\n array(\n 'top-nav' => __ ('Top menu'),\n 'bottom-nav' => __ ('Bottom menu'),\n )\n );\n}", "function register_nav_menus($locations = array())\n {\n }", "function wp_nav_menu_setup()\n {\n }", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function thiredtheme_menu_item()\n {\n register_nav_menus(\n array(\n 'header'=>__('header menu'),\n 'footer'=>__('footer menu'))); \n }", "function ruven_menus() {\n\n\t$locations = array(\n\t\t'primary' => __( 'Primary Menu', 'ruven' ),\n\t\t'secondary' => __( 'Secondary Menu', 'ruven' ),\n\t);\n\n\tregister_nav_menus( $locations );\n}", "function urbanfitness_menus()\n{\n // Wordpress Function\n //registering menu we created\n //pass in a associative array\n register_nav_menus([\n 'main-menu' => 'Main Menu',\n ]);\n}", "function register_menu() {\n\tregister_nav_menu('primary-menu', __('Primary Menu'));\n}", "function register_my_menus() {\n register_nav_menus(\n array( \n 'primary' => __( 'Main one page navigation' ),\n 'secondary' => __( 'Post and Page navigation' ),\n )\n );\n}", "function base_registerMenus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' ),\n )\n );\n}", "public function menus()\n\t{\n\t\tregister_nav_menus(array(\n\t\t\t'mega-meu'\t\t\t\t\t\t=> esc_html( 'Mega Menu', 'ema_theme' );\n\t\t));\n\t}", "protected function registerMenu()\n {\n }", "function register_menus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Menu Główne' ),\n 'photo-menu' => __( 'Photo Menu' )\n \n \n )\n );\n}", "function register_menus() {\n register_nav_menu('header-menu', __('Header Menu'));\n}", "function gymfitness_menus() {\n register_nav_menus( array(\n 'menu-principal' => __( 'Menu Principal', 'gymfitness' )\n ));\n}", "function register_html5_menu()\n{\n register_nav_menus(array( // Using array to specify more menus if needed\n 'header-menu' => __('Header Menu', 'oh'), // Main Navigation\n 'sidebar-menu' => __('Redes sociales Menu', 'oh'), // Sidebar Navigation\n 'extra-menu' => __('Extra Menu', 'oh') // Extra Navigation if needed (duplicate as many as you need!)\n ));\n}", "function mocca_custom_menu() {\n\n register_nav_menus(array(\n 'bootstrap-menu' => 'Navigtion Bar',\n 'footer-menu' => 'footer Bar',\n ));\n }", "function wpb_custom_new_menu() {\n register_nav_menus(\n array(\n 'my-custom-menu' => __( 'My Custom Menu' ),\n 'extra-menu' => __( 'Extra Menu' ),\n 'logo-menu' => __( 'Logo Menu' ),\n 'web-des' => __( 'Web Designing Services' ),\n 'sm-ser' => __( 'Social Meida Services' ),\n 'web-dev-ser' => __( 'Web Development Services' ),\n 'digital-ser' => __( 'Digital Marketing Services' ),\n )\n );\n}", "function register_menus() {\n\t\t\n\t\t\tregister_nav_menu( 'headermenu', __( 'Menú cabecera' ) );\n\t\t\tregister_nav_menu( 'footermenu', __( 'Menú pie' ) );\n\t\t\tregister_nav_menu( 'footermenulegal', __( 'Menú pie legal' ) );\t\t\t\n\n\t\t}", "function supreme_register_menus() {\r\n\r\n\t/* Get theme-supported menus. */\r\n\t$menus = get_theme_support( 'supreme-core-menus' );\r\n\r\n\t/* If there is no array of menus IDs, return. */\r\n\tif ( !is_array( $menus[0] ) )\r\n\t\treturn;\r\n\r\n\t/* Register the 'primary' menu. */\r\n\tif ( in_array( 'primary', $menus[0] ) )\r\n\t\tregister_nav_menu( 'primary', _x( 'Primary', 'nav menu location', 'supreme-core' ) );\r\n\r\n\t/* Register the 'secondary' menu. */\r\n\tif ( in_array( 'secondary', $menus[0] ) )\r\n\t\tregister_nav_menu( 'secondary', _x( 'Secondary', 'nav menu location', 'supreme-core' ) );\r\n\r\n\t/* Register the 'subsidiary' menu. */\r\n\tif ( in_array( 'subsidiary', $menus[0] ) )\r\n\t\tregister_nav_menu( 'subsidiary', _x( 'Subsidiary', 'nav menu location', 'supreme-core' ) );\r\n\r\n\tif ( in_array( 'footer', $menus[0] ) )\r\n\t\tregister_nav_menu( 'footer', _x( 'Footer', 'nav menu location', 'supreme-core' ) );\r\n}", "function menu_theme_setup() {\r\n\t\tregister_nav_menus( array( \r\n\t\t'header' => 'Header menu', \r\n\t\t'footer' => 'Footer menu' \r\n\t\t) );\r\n\t}", "function register_my_menus() {\nregister_nav_menus(\n\tarray(\t \n\t 'header-menu' => __('Header Menu')\t \n\t ) \n );\n}", "function register_my_menus() {\nregister_nav_menus(\n\tarray(\t \n\t 'header-menu' => __('Header Menu')\t \n\t ) \n );\n}", "function register_main_menu() {\n // register_nav_menu( 'main-menu', __('Main Menu') );\n register_nav_menus( array(\n 'main-menu' => __('Main Menu'),\n 'need-help-menu' => __('Need Help Menu'),\n 'company-menu' => __('Company Menu')\n ) );\n}", "function register_my_menus() {\n register_nav_menus(\n array(\n 'top-menu' => __( 'Top Menu' ),\n 'footer-menu' => __( 'Footer Menu' )\n )\n );\n }", "function register_crackingthecode_menus() {\n register_nav_menus(\n array(\n 'main-menu' => __('Main Menu','crackingthecode')\n )\n );\n}", "function register_my_menus()\n{\n register_nav_menus(\n array(\n 'main-menu' => __('Main Menu'),\n 'footer-menu' => __('Footer Menu'),\n 'social-menu' => __('Social Menu')\n )\n );\n}", "function thoughts_register_theme_menu() {\n register_nav_menu( 'primary', 'Main Navigation Menu' );\n}", "function udemy_theme_setup() {\n\tadd_theme_support('menus'); \n register_nav_menu('primary','Primary Header Navigation');\n register_nav_menu('secondary','Footer Navigation');\n\n}", "function custom_theme_setup() {\n register_nav_menus( array( \n 'header' => 'Header menu', \n 'footer' => 'Footer menu' \n ) );\n}", "function register_basics_menus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' ),\n 'extra-menu' => __( 'Extra Menu' )\n )\n );\n}", "function at_try_menu()\n{\n add_menu_page('signup_list', //page title\n 'Sign Up List', //menu title\n 'manage_options', //capabilities\n 'Signup_List', //menu slug\n Signup_list //function\n );\n}", "function tarful_register_menus() {\n register_nav_menus(\n array(\n 'credits-1' => __( 'Footer IZQ' ),\n 'credits-2' => __( 'Footer CTR' ),\n 'credits-3' => __( 'Footer DER' )\n )\n );\n}", "function nt_admin_menus(){\r\n\t\t// \t\t\t\t\t\t\t\t\t\t\tcallable $function = '', string $icon_url = '', int $position = null )\r\n\t\tadd_menu_page(\r\n\t\t\t__( 'Settings', 'newTheme'),\r\n\t\t\t__( 'NewTheme', 'newTheme'),\r\n\t\t\t'edit_theme_options',\r\n\t\t\t'nt_theme_options_page',\r\n\t\t\t'nt_theme_options_function'\r\n\t\t);\t\r\n\r\n\t\t//add_submenu_page( string $parent_slug, string $page_title, string $menu_title, string $capability, string $menu_slug, \r\n\t\t//\t\t\t\t\t\t\tcallable $function = '' )\r\n\t\tadd_submenu_page( \r\n\t\t\t'nt_theme_options_page', \r\n\t\t\t__( 'Settings', 'newTheme'), \r\n\t\t\t__( 'NewTheme options', 'newTheme'),\r\n\t\t\t'edit_theme_options',\r\n\t\t\t'nt_theme_options_page',\r\n\t\t\t'nt_theme_options_function'\r\n \t);\r\n\t}", "function test_theme_setup(){\n\n // Nav Menus\n register_nav_menus(array(\n 'primary' => __('Primary Menu')\n ));\n\n}", "public function register_menu()\n {\n add_menu_page('Coupons Settings', 'Coupons Settings', 'edit_others_posts', 'wpm_coupons_settings');\n add_submenu_page('wpm_coupons_settings', 'Coupons Settings', 'Coupons Settings', 'manage_options', 'wpm_coupons_settings', function () {\n $settings = json_decode(get_option('api_settings', true), true);\n\n include 'templates/settings_template.php';\n });\n }", "function register_my_menu() {\n register_nav_menu( 'primary', __( 'Primary Menu' ) );\n}", "function register_my_menus() {\n register_nav_menus(\n array(\n 'primary-menu' => __( 'Primary Menu' ),\n 'footer-menu' => __( 'Footer Menu' )\n )\n );\n}", "function register_my_menu() {\n register_nav_menu('footer-menu',__( 'Footer Menu' ));\n}", "function register_menu_locations() {\n register_nav_menus(\n array(\n 'primary-menu' => __( 'Primary Menu' ),\n 'footer-menu' => __( 'Footer Menu' )\n )\n );\n }", "function register_my_menus() {\n register_nav_menus(\n array('primary' => ( 'To display menu properly please select \"Main menu\" from list below.' ))\n );\n}", "public function registerNavigation()\n {\n $nexus = NexusSettings::instance();\n $iconSvg = '';\n\n if ($nexus->menu_icon_uploaded) {\n $iconSvg = $nexus->menu_icon_uploaded->getPath();\n } elseif (NexusSettings::get('menu_icon_text', '') == '') {\n $iconSvg = 'plugins/xitara/nexus/assets/images/icon-nexus.svg';\n }\n\n if (($label = NexusSettings::get('menu_text')) == '') {\n $label = 'xitara.nexus::lang.submenu.label';\n }\n\n return [\n 'nexus' => [\n 'label' => $label,\n 'url' => Backend::url('xitara/nexus/dashboard'),\n 'icon' => NexusSettings::get('menu_icon_text', 'icon-leaf'),\n 'iconSvg' => $iconSvg,\n 'permissions' => ['xitara.nexus.*'],\n 'order' => 50,\n ],\n ];\n }", "function woocommerce_custom_menu(){\n register_nav_menu('top-menu',__('WooCommerce Custom Menu', 'woocommercecustommenu'));\n}", "function setup_menus() {\n\t$icon = '';\n\tadd_menu_page('Site Features', 'Site Features', 'publish_pages', 'pop_site_features', '', $icon, 36);\n\tadd_submenu_page('pop_site_features','','','publish_pages','pop_site_features','homepage_touts_page');\n\tadd_submenu_page('pop_site_features', 'Homepage Features', 'Homepage Features', 'publish_pages', 'pop_homepage_features', 'homepage_features_page');\n\tadd_submenu_page('pop_site_features', 'Homepage Ticker', 'Homepage Ticker', 'publish_pages', 'pop_homepage_ticker', 'homepage_ticker_page');\n\tadd_submenu_page('pop_site_features', 'Homepage Touts', 'Homepage Touts', 'publish_pages', 'pop_homepage_touts', 'homepage_touts_page');\n\tadd_submenu_page('pop_site_features', 'Movement Touts', 'Movement Touts', 'publish_pages', 'pop_movement_touts', 'movement_touts_page');\n\tadd_submenu_page('pop_site_features', 'PoP & Local Events', 'PoP & Local Events', 'publish_pages', 'pop_events', 'movement_events_page');\n\tadd_submenu_page('pop_site_features', 'Season of 1000', 'Season of 1000 Promises', 'publish_pages', 'season1000', 'season_1000_page');\n}", "function dsobletTheme_register_my_menus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' , 'dsobletheme'),\n 'footer-menu' => __( 'Footer Menu' , 'dsobletheme')\n )\n );\n }", "function power_do_nav() {\n\n\t// Do nothing if menu not supported.\n\tif ( ! power_nav_menu_supported( 'primary' ) || ! has_nav_menu( 'primary' ) ) {\n\t\treturn;\n\t}\n\n\t$class = 'menu power-nav-menu menu-primary';\n\tif ( power_superfish_enabled() ) {\n\t\t$class .= ' js-superfish';\n\t}\n\n\tpower_nav_menu(\n\t\t[\n\t\t\t'theme_location' => 'primary',\n\t\t\t'menu_class' => $class,\n\t\t]\n\t);\n\n}", "function my_theme_setup()\n{\n\tadd_theme_support( 'menus' );\n\n\tregister_nav_menu( $location = 'header', $description = '這個是上面的menu' );\n\tregister_nav_menu( $location = 'footer', $description = '這個是下面的menu' );\n}", "function register_my_menus() {\r\n register_nav_menus(\r\n array(\r\n 'sidebar-menu' => __( 'Sidebar Menu' )\r\n \r\n\r\n) ); }", "function register_additional_genesis_menus() {\n\n\tadd_theme_support(\n\t 'genesis-menus', array(\n\t 'primary' => __( 'Header Menu', 'genesis-sample' ),\n\t 'secondary' => __( 'Footer Menu', 'genesis-sample' ),\n\t 'third-menu' => __( 'Third Navigation Menu', 'genesis-sample' ),\n\t )\n\t);\n\n\tregister_nav_menu( 'third-menu' ,\n\t__( 'Third Navigation Menu' ));\n\n}", "private function registerMenus()\n {\n if (!isset($this->config['menus'])) {\n return;\n }\n\n $menus = $this->config['menus'];\n add_action('init', function () use ($menus) {\n register_nav_menus($menus);\n });\n }", "function register_header_menu() {\r\n register_nav_menu('header-menu',__( 'Header Menu' ));\r\n}", "function register_my_menus() {\n register_nav_menus(\n array(\n 'footer-menu' => __( 'Footer Menu' ),\n 'header-menu' => __( 'Header Menu' ),\n )\n );\n }", "function register_my_menus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' ),\n 'footer-menu' => __( 'Footer Menu' ),\n\t 'topbar-menu' => __( 'Topbar Menu' )\n )\n );\n}", "function register_theme_menus() {\n register_nav_menus(\n array( 'main-menu' => __( 'Main Menu' ) )\n );\n }" ]
[ "0.82180166", "0.80616295", "0.80543405", "0.80352944", "0.7975038", "0.7938911", "0.7935851", "0.7917127", "0.7909255", "0.78959507", "0.7885589", "0.7883832", "0.7880348", "0.7833404", "0.78095996", "0.78090054", "0.77852374", "0.7782849", "0.77618474", "0.7755041", "0.7740841", "0.77358574", "0.7733624", "0.77333856", "0.7730588", "0.7711864", "0.7710927", "0.7708826", "0.77017456", "0.7688272", "0.7659821", "0.7657098", "0.7655876", "0.7654162", "0.7646568", "0.76394904", "0.7638857", "0.7638353", "0.76348", "0.7626219", "0.76243126", "0.762378", "0.76189244", "0.76162046", "0.76084244", "0.7606213", "0.7602062", "0.7600758", "0.7591968", "0.75891924", "0.7581595", "0.7579318", "0.75789636", "0.7569312", "0.7557751", "0.75002104", "0.74684864", "0.74617255", "0.745869", "0.74501836", "0.74422306", "0.74246037", "0.7412602", "0.7410099", "0.74100065", "0.7408916", "0.7396571", "0.7393739", "0.7393739", "0.7378285", "0.7374847", "0.7360449", "0.7344336", "0.7337567", "0.7336846", "0.73118603", "0.73062015", "0.7297904", "0.7297155", "0.7294739", "0.72936845", "0.7279802", "0.7271692", "0.7261772", "0.72609884", "0.72506505", "0.72486836", "0.7242752", "0.7242369", "0.7221781", "0.7221275", "0.721705", "0.72097", "0.7206059", "0.71978384", "0.71892905", "0.7184321", "0.71813196", "0.71790516", "0.7172437" ]
0.8133599
1
OTHER CLEANUPS remove the p from around imgs [ ]
function po_filter_ptags_on_images($content){ return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wph_remove_p_images($content) {\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function wpfme_remove_img_ptags($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function zero_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n }", "function spartan_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function pd_img_unautop($imgWrap)\n{\n $imgWrap = preg_replace('/<p>\\\\s*?(<a .*?><img.*?><\\\\/a>|<img.*?>)?\\\\s*<\\\\/p>/s', '<figure>$1</figure>', $imgWrap);\n return $imgWrap;\n}", "function baindesign324_filter_ptags_on_images($content){\n\t return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n\t}", "public function remove_p_tag_from_images( $content ) {\n\n\t\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n\n\t}", "function cardealer_filter_ptags_on_images($content){\r\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function wpgrade_filter_ptags_on_images($content){\r\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function bones_filter_ptags_on_images($content)\n{\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function more_zero_cleanup() {\n function zero_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n }\n\n // This removes inline width/height from images\n function remove_thumbnail_dimensions( $html ) {\n $html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html );\n return $html;\n }\n\n add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 );\n add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 );\n // Removes attached image sizes as well\n add_filter( 'the_content', 'remove_thumbnail_dimensions', 10 );\n\n\n }", "function mdwpfp_filter_ptags_on_images($content){\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function theme_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content) {\n // do a regular expression replace...\n // find all p tags that have just\n // <p>maybe some white space<img all stuff up to /> then maybe whitespace </p>\n // replace it with just the image tag...\n return preg_replace('/<p>(\\s*)(<img .* \\/>)(\\s*)<\\/p>/iU', '\\2', $content);\n}", "function custom_filter_ptags_on_images($content){\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function quadro_filter_ptags_on_portfimages($content) {\n\tglobal $post;\n\tif ( $post->post_type != 'quadro_portfolio') return $content;\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n$content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\nreturn preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function tlh_filter_ptags_on_images( $content ) {\n\treturn preg_replace( '/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content );\n}", "function filter_ptags_on_images($content) {\n $content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n return preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function filter_ptags_on_images($content) {\n $content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n return preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function magazinevibe_child_remove_first_image( $content ) {\n\t$dom = new DOMDocument();\n\t$dom->loadHTML( $content );\n\t$images = $dom->getElementsByTagName( 'img' );\n\n\tforeach ( $images as $image ) {\n\t\t$parent = $image->parentNode;\n\t\tif ( $parent->nodeName ) {\n\t\t\t$parent->parentNode->removeChild( $parent );\n\t\t\t$content = $dom->saveHTML();\n\t\t\t$content = str_replace('&Acirc;', '', $content);\n\t\t\treturn $content;\n\t\t}\n\t}\n\n\t$content = str_replace('&Acirc;', '', $content);\n\n\treturn $content;\n}", "function _tts_preprocess_p_img_big(&$vars){\n $alt = (isset($vars['content']['field_img'][0]['#item']['title'])\n && !empty($vars['content']['field_img'][0]['#item']['title'])\n ? $vars['content']['field_img'][0]['#item']['title'] . ' - '\n : '') . 'Serramenti Torino';\n $vars['content']['field_img'][0]['#item']['alt'] = $alt;\n \n \n if ($vars['view_mode'] == 'full'){\n $vars['content']['field_img'] = array(\n '#prefix' => '<div class=\"wrapper-p-img margin-b-1\">',\n '#suffix' => '</div>',\n 'data' => $vars['content']['field_img'][0],\n );\n\n //_tts_add_fancy_svg($vars);\n\n if (isset($vars['content']['field_img']['data']['#item']['title']) && $vars['content']['field_img']['data']['#item']['title']!== ''){\n $title = $vars['content']['field_img']['data']['#item']['title'];\n $vars['content']['field_img']['desc'] = array(\n '#prefix' => '<div class=\"margin-t-05 margin-sm-h-2\"><p class=\"small\">',\n '#suffix' => '</p></div>',\n '#markup' => $title,\n '#weight' => 2,\n );\n }\n }\n}", "function _cleanup_image_add_caption($matches)\n {\n }", "function clean_raw() {\r\n $this->cleaned_image = cloneImg($this->get_image());\r\n foreach ($this->text_blocks as $block) {\r\n $x1=$block->x1;\r\n $y1=$block->y1;\r\n $x2=$block->x2;\r\n $y2=$block->y2;\r\n $x3=$block->x3;\r\n $y3=$block->y3;\r\n $x4=$block->x4;\r\n $y4=$block->y4;\r\n $r=$block->background_color_alt[0];\r\n $g=$block->background_color_alt[1];\r\n $b=$block->background_color_alt[2];\r\n $background = imagecolorallocate($this->cleaned_image, $r, $g, $b);\r\n $polygon=array($x1,$y1,$x2,$y2,$x3,$y3,$x4,$y4);\r\n imagefilledpolygon($this->cleaned_image,$polygon,4,$background);\r\n $this->cleaned_image_path=\"uploads/\".microtime().\".jpg\";\r\n imagewrite($this->cleaned_image,$this->cleaned_image_path,$quality=100);\r\n }\r\n }", "function filter_ptags_on_images($content) {\n return preg_replace('/<p[^>]*>\\\\s*?(<a .*?><img.*?><\\\\/a>|<img.*?>)?\\\\s*<\\/p>/', '<div class=\"post-image\">$1</div>', $content);\n}", "function remove_img_attr ($html)\n{\n return preg_replace('/(width|height)=\"\\d+\"\\s/', \"\", $html);\n}", "function imageProcessor($text)\r\n {\r\n $this->images = array();\r\n // если включена обработка пробелов в путях картинок\r\n if ($this->feed['params']['image_space_on']) {\r\n $text = preg_replace_callback('|<img(.*?)src(.*?)=[\\s\\'\\\"]*(.*?)[\\'\\\"](.*?)>|is', array(&$this, 'imageParser'), $text);\r\n } else {\r\n $text = preg_replace_callback('|<img(.*?)src(.*?)=[\\s\\'\\\"]*(.*?)[\\'\\\"\\s](.*?)>|is', array(&$this, 'imageParser'), $text);\r\n }\r\n return $text;\r\n }", "function spiplistes_corrige_img_pack ($img) {\n\tif(preg_match(\",^<img src='dist/images,\", $img)) {\n\t\t$img = preg_replace(\",^<img src='dist/images,\", \"<img src='../dist/images\", $img);\n\t}\n\treturn($img);\n}", "function kp_remove_image_size_attributes( $html ) {\n return preg_replace( '/(width|height)=\"\\d*\"/', '', $html );\n}", "function thinkup_extract_images_filter( $tu_post ) {\n $regex = '/<img[^>]+>/i';\n\n if ( $tu_post->body && preg_match_all($regex, $tu_post->body, $matches) ) {\n\n $matches = $matches[0];\n\n foreach ( $matches as $match ) {\n\n $regex = '/(src)=(\"[^\"]*\")/i';\n if ( preg_match_all($regex, $match, $src, PREG_SET_ORDER) ) {\n $src = $src[0];\n $tu_post->images[] = trim($src[2], '\"');\n }\n\n }\n\n }\n\n return $tu_post;\n\n}", "public function replaceImage()\n {\n $args = func_get_args();\n\n $domDocument = new DomDocument();\n $domDocument->loadXML(self::$_document);\n\n $domImages = $domDocument->getElementsByTagNameNS('http://schemas.openxmlformats.org/drawingml/2006/' .\n 'wordprocessingDrawing', 'docPr');\n $domImagesId = $domDocument->getElementsByTagNameNS(\n 'http://schemas.openxmlformats.org/drawingml/2006/main',\n 'blip'\n );\n\n for ($i = 0; $i < $domImages->length; $i++) {\n if ($domImages->item($i)->getAttribute('descr') ==\n self::$_templateSymbol . $args[0] . self::$_templateSymbol) {\n $ind = $domImagesId->item($i)->getAttribute('r:embed');\n self::$placeholderImages[$ind] = $args[1];\n }\n }\n }", "function _strip_image_tags($field)\r\n\t{\r\n\t\t$this->{$field} = strip_image_tags($this->{$field});\r\n\t}", "function remove_thumbnail_dimensions( $html ) {\n $html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html );\n return $html;\n }", "function img_p_class_content_filter($content) {\n $content = preg_replace(\"/(<p[^>]*)(\\>.*)(\\<img.*)(<\\/p>)/im\", \"\\$1 class='content-img-wrap'\\$2\\$3\\$4\", $content);\n\n return $content;\n}", "function spip2odt_convertir_images($texte,$dossier){\n\t$dir = sous_repertoire($dossier,'Pictures');\n\tinclude_spip('inc/distant');\n\t$split = preg_split(',(<[a-z]+\\s[^<>]*spip_documents[^<>]*>),Uims',$texte,null,PREG_SPLIT_DELIM_CAPTURE);\n\t$class = \"\";\n\t$texte = \"\";\n\twhile (count($split)){\n\t\t$frag = array_shift($split);\n\t\tif (preg_match_all(\n\t\t ','\n\t\t .'(<([b-z][a-z]*)(\\s[^<>]*)?>)?' # ne pas attraper les <text:p > qui precedent une image\n\t\t .'(<a [^<>]*>)?\\s*(<img\\s[^<>]*>)(\\s*</a>)?'\n\t\t .'(\\s*</\\\\2>)?'\n\t\t .'(\\s*<([a-z]+)[^<>]*spip_doc_titre[^<>]*>(.*?)</\\\\9>)?'\n\t\t .'(\\s*<([a-z]+)[^<>]*spip_doc_descriptif[^<>]*>(.*?)</\\\\12>)?'\n\t\t .',imsS',\n\t\t $frag, $regs,PREG_SET_ORDER)!==FALSE) {\n\t\t #if (count($regs)) {var_dump($frag);var_dump($regs);die;}\n\t\t\t#if ($class && count($regs) && !count($split)) {var_dump($frag);var_dump($regs);die;}\n\t\t\tforeach($regs as $reg){\n\t\t\t\t// En cas de span spip_documents_xx recuperer la class\n\t\t\t\t$align = 'left'; // comme ca c'est bon pour les puces :)\n\t\t\t\t$href = \"\";\n\t\t\t\t$title = \"\";\n\t\t\t\tif ($class AND preg_match(',spip_documents_(left|right|center),i',$class,$match))\n\t\t\t\t\t$align = $match[1];\n\t\t\t\tif ($reg[4]){\n\t\t\t\t\t$href = extraire_attribut($reg[4],'href');\n\t\t\t\t\t$title = extraire_attribut($reg[4],'title');\n\t\t\t\t}\n\t\t\t\t$insert = spip2odt_imagedraw($dir,$reg[5],$align,isset($reg[10])?$reg[10]:\"\",isset($reg[13])?$reg[13]:\"\",$href,$title);\n\t\t\t\t$frag = str_replace($reg[0], $insert, $frag);\n\t\t\t\t$class=\"\";\n\t\t\t}\n\t\t}\n\t\t$texte .= $frag;\n\t\t$texte .= $tag=array_shift($split);\n\t\t$class = extraire_attribut($tag, 'class');\n\t}\n\treturn $texte;\n}", "function strip_p( $html ) {\n $string = $html;\n $patterns = array();\n $patterns[0] = '/\\<p\\>/';\n $patterns[1] = '/\\<\\/p\\>/';\n $replacements = array();\n $replacements[0] = \"\";\n $replacements[1] = \"\";\n return preg_replace($patterns, $replacements, $string);\n }", "function strip_shortcode_gallery( $content, $code ) {\n\t preg_match_all( '/'. get_shortcode_regex() .'/s', $content, $matches, PREG_SET_ORDER );\n\n\t if ( ! empty( $matches ) ) {\n\t foreach ( $matches as $shortcode ) {\n\t if ( $code === $shortcode[2] ) {\n\t $pos \t= strpos( $content, $shortcode[0] );\n\t \t\t\t$pos2 \t= strlen($shortcode[0]);\n\t if ($pos !== false) {\n\t \t$content = substr_replace( $content, '', $pos, $pos2 );\n\t\t\t\t\t}\n\t }\n\t }\n\n\t\t\t\n\t\t\n\t\t\t$content = str_replace( ']]>', ']]&gt;', apply_filters( 'the_content', $content ) );\n\t \t\n\t \techo $content;\n\t\t\n\t\t} else {\n\t\t\techo apply_filters( 'the_content', $content );\t\t\t\n\t\t}\n\n\n}", "function remove_image_alignment( $attributes ) {\n $attributes['class'] = str_replace( 'alignleft', 'alignnone', $attributes['class'] );\n\treturn $attributes;\n}", "function medula_remove_plugin_image_sizes() {\n\tremove_image_size('image-name');\n}", "function _wp_post_thumbnail_context_filter_remove()\n {\n }", "function _js_img_removal($match) {\n\t\t$attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match [1]));\n\n\t\treturn str_replace($match [1], preg_replace('#src=.*?(alert\\(|alert&\\#40;|javascript\\:|charset\\=|window\\.|document\\.|\\.cookie|<script|<xss|base64\\s*,)#si', '', $attributes), $match [0]);\n\t}", "function remove_thumbnail_dimensions( $html )\n{\n\t$html = preg_replace('/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html);\n\treturn $html;\n}", "function clean_word() {\r\n\t\tpreg_match_all('/<img[^<>]*? alt=\"Text Box:\\s*([^\"]*?)\"[^<>]*?>/is', $this->code, $text_box_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$counter = sizeof($text_box_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t$offset = $text_box_matches[0][$counter][1];\r\n\t\t\t$text = $text_box_matches[1][$counter][0];\r\n\t\t\t$text = '<p>' . str_replace('&#13;&#10;', '</p>\r\n<p>', $text) . '</p>';\r\n\t\t\t$this->code = substr($this->code, 0, $offset) . $text . substr($this->code, $offset + strlen($text_box_matches[0][$counter][0]));\r\n\t\t\t$counter--;\r\n\t\t}\r\n\t\t\r\n\t\t// although at least firefox seems smart enough to not display them, \r\n\t\t// some versions of word may use soft hyphens for print layout or some such nonsense\r\n\t\t// is this a candidate for general (basic) usage?\r\n\t\t$this->code = str_replace('&shy;', '', $this->code);\r\n\t\t// this needs revision for array(\"­\", \"&#173;\", \"&#xad;\", \"&shy;\"); and the fact that soft hyphens are misused by document authors (specific case: they show in RTF files but not in firefox)\r\n\t\t\r\n\t\tReTidy::decode_for_DOM_all_character_entities(); // since much of the clean_word work is removing styles\r\n\t\t\r\n\t\t// should we simply eliminate all names and ids (since the structure function will generate those which are needed)?\r\n\t\t// seems we should except for footnotes: _ftnref _ftn _ednref _edn\r\n\t\t$this->code = preg_replace('/ id=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/(<a[^<>]*?) name=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"([^<>]*?>)/is', '$1$3', $this->code);\r\n\t\t\r\n\t\t\r\n\t\t// often in word documents the lang attributes are wrong... so:\r\n\t\t$this->code = preg_replace('/ lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t\r\n\t\t// white background\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)whiteBG([^\"]*)\"/is', ' class=\"$1$2\"', $this->code);\r\n\t\t// parks canada specific:\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)backTop([^\"]*)\"/is', ' class=\"$1alignRight$2\"', $this->code);\t\t\r\n\t\t\r\n\t\t// topPage; these should not exist (since documents in their original format shall not have links to the top)\r\n\t\t// but they sometimes come from styles to classes. On tags other than spans they style the alignment.\r\n\t\t$this->code = preg_replace('/<span([^>]*)class=\"([^\"]*)topPage([^\"]*)\"/is', '<span$1class=\"$2$3\"', $this->code);\r\n\t\t\r\n\t\t// word document section <div>s\r\n\t\t//$this->code = preg_replace('/<div style=\"page\\s*:\\s*[^;]+;\">/is', '<div stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_stripme('<div style=\"page\\s*:\\s*[^;]+;\">');\r\n\t\t\r\n\t\t// remove style information declarations(?) or qualifications(?) like !msnorm and !important? \r\n\t\t// Nah, there is no need until word is seen to use !important (it could also be in government stylesheets so there is the remote chance that we\r\n\t\t// would like to keep it). Definately get rid of !msnorm though.\r\n\t\t$arrayStyleInformationPiecesToDelete = array(\r\n\t\t'!msorm',\r\n\t\t);\r\n\t\tforeach($arrayStyleInformationPiecesToDelete as $styleInformationPieceToDelete) {\r\n\t\t\t$styleInformationPieceToDeleteCount = -1;\r\n\t\t\twhile($styleInformationPieceToDeleteCount != 0) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*?)' . $styleInformationPieceToDelete . '([^\"]*?)\"/is', 'style=\"$1$2\"', $this->code, -1, $styleInformationPieceToDeleteCount);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// blockquote\r\n\t\tpreg_match_all('/<p[^<>]*style=[^<>]*(margin-right\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*(margin-left\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*>(.*?)<\\/p>/is', $this->code, $p_matches2);\r\n\t\tforeach($p_matches2[0] as $index => $value) {\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[2][$index], $margin_right_matches);\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[4][$index], $margin_left_matches);\r\n\t\t\tif($margin_right_matches[1] > 0.4 && $margin_left_matches[1] > 0.4) {\r\n\t\t\t\t$original = $new = $p_matches2[0][$index];\r\n\t\t\t\t$new = str_replace($p_matches2[1][$index], '', $new);\r\n\t\t\t\t$new = str_replace($p_matches2[3][$index], '', $new);\r\n\t\t\t\t$new = str_replace('<p', '<div', $new);\r\n\t\t\t\t$new = str_replace('</p>', '</div>', $new);\r\n\t\t\t\t$new = \"<blockquote>\" . $new . \"</blockquote>\";\r\n\t\t\t\t$this->code = str_replace($original, $new, $this->code);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// onmouseover, onmouseout; attributes to delete\r\n\t\t$arrayAttributesToDelete = array(\r\n\t\t'onmouseover',\r\n\t\t'onmouseout',\r\n\t\t);\r\n\t\tforeach($arrayAttributesToDelete as $attributeToDelete) {\r\n\t\t\t$this->code = preg_replace('/' . $attributeToDelete . '=\"([^\"]*)\"/is', '', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// microsoft styles to delete\r\n\t\t$arrayMicrosoftStylesToDelete = array(\r\n\t\t'page-break-before',\r\n\t\t'page-break-after',\r\n\t\t'page-break-inside',\r\n\t\t'text-autospace',\r\n\t\t'text-transform',\t\t\r\n\t\t//'border',\r\n\t\t'border-left', // (2011-11-07)\r\n\t\t'border-right', // (2011-11-07)\r\n\t\t'border-bottom', // (2011-11-07)\r\n\t\t'border-top', // (2011-11-07)\r\n\t\t'border-collapse',\r\n\t\t'margin', //// notice that we may in some cases want to keep margins (as an indication of indentation)\r\n\t\t'margin-left', ////\r\n\t\t'margin-right', ////\r\n\t\t'margin-top', ////\r\n\t\t'margin-bottom', ////\t\t\t\t\t\t\t\r\n\t\t'padding',\r\n\t\t'padding-left',\r\n\t\t'padding-right',\r\n\t\t'padding-top',\r\n\t\t'padding-bottom',\r\n\t\t'font',\r\n\t\t'font-size', //// notice that we may in some cases want to keep font-size\r\n\t\t'font-family',\r\n\t\t//'font-style', // font-style: italic;\r\n\t\t//'text-decoration', // text-decoration: underline;\r\n\t\t'line-height',\r\n\t\t'layout-grid-mode',\r\n\t\t'page',\r\n\t\t'text-indent', //// notice that we may in some cases want to keep text-indent\r\n\t\t'font-variant', //// this may have to be amended in the future (if some document uses small caps without capitalizing those first letters that need to be capitalized)\r\n\t\t'mso-style-name',\r\n\t\t'mso-style-link',\r\n\t\t'z-index',\r\n\t\t'position',\r\n\t\t// we cannot enable the following and keep other style information that these are substrings of\r\n\t\t'top',\r\n\t\t'right',\r\n\t\t'bottom',\r\n\t\t'left',\r\n\t\t'letter-spacing',\r\n\t\t);\r\n\t\t// for this we assume that there are no embedded stylesheets\r\n\t\tforeach($arrayMicrosoftStylesToDelete as $microsoftStyle) {\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($this->config['strict_accessibility_level'] > 0) { // then just make it grey\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesToDelete = array(\r\n\t\t//'color' => array('black', 'windowtext'), // these can sometimes override other colours that we keep so ideally we would like to keep these in but style attributes for colour...\r\n\t\t'text-align' => array('justify'),\r\n\t\t'font-weight' => array('normal', 'normal !msorm', 'normal !msnorm'), \r\n\t\t// we take this out although it can usefully cascade other styles\r\n\t\t// which brings up the point that these all probably can... ;(\r\n\t\t//'font-variant' => array('normal', 'normal!important', 'normal !important', 'small-caps'),\r\n\t\t'background' => array('white', '#FFFFFF'),\r\n\t\t'background-color' => array('white', '#FFFFFF'),\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesToDelete as $style => $value) {\r\n\t\t\tforeach($value as $information) {\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . ';\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countC);\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . '\"/is', 'style=\"$1\"', $this->code, -1, $countD);\r\n\t\t\t\t\tif($countC === 0 && $countD === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesOnTagsToDelete = array(\r\n\t\t'text-align' => array('left' => array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'font-weight' => array('bold' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'vertical-align' => array( \r\n\t\t// we should be careful here not to remove any styles that might be used to identify footnotes; although\r\n\t\t// I do not know of any that are currently (2011-11-28) used\r\n\t\t'baseline' => array('span'),\r\n\t\t'sub' => array('span'),\r\n\t\t'super' => array('span'),\r\n\t\t'top' => array('span'),\r\n\t\t'text-top' => array('span'),\r\n\t\t'middle' => array('span'),\r\n\t\t'bottom' => array('span'),\r\n\t\t'text-bottom' => array('span'),\r\n\t\t'inherit' => array('span'),\r\n\t\t),\r\n\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesOnTagsToDelete as $property => $stylings) {\r\n\t\t\tforeach($stylings as $styling => $tags) {\r\n\t\t\t\t$tagsString = implode(\"|\", $tags);\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . ';\\s*([^\"]*)\"/is', '<$1$2 style=\"$3$4\"', $this->code, -1, $countE);\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . '\"/is', '<$1$2 style=\"$3\"', $this->code, -1, $countF);\r\n\t\t\t\t\tif($countE === 0 && $countF === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// pseudo-elements\r\n\t\t// <a style=\":visited { color: purple; }\">\r\n\t\t$countE = -1;\r\n\t\twhile($countE !== 0) {\r\n\t\t\t//print(\"doing pseudo-elements<br>\\r\\n\");\r\n\t\t\t$this->code = preg_replace('/style=\"([^\"]{0,}):\\w+\\s*\\{[^\\{\\}]{0,}\\}([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countE);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// <hr> with width\r\n\t\t$this->code = preg_replace('/<hr([^<>]*) width=\"[^\"]*\"([^<>]*)\\/>/is', '<hr$1$2/>', $this->code);\r\n\t\t\r\n\t\t// microsoft using operating system independant CSS...\r\n\t\t// I guess for this we assume that we are using windows.\r\n\t\t$this->code = preg_replace('/style=\"([^\"]*)border\\s*:\\s*solid\\s+windowtext\\s+1.0pt\\s*(;?)([^\"]*)\"/is', 'style=\"$1border: 1px solid black$2$3\"', $this->code);\r\n\t\t\r\n\t\t// superscript using CSS\r\n\t\t//$this->code = preg_replace('/(<(\\w*)[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?)([^\"]*\"[^<>]*>.*?<\\/\\2>)/is', '<sup>$1$4</sup>', $this->code, -1, $countC);\r\n\t\t$this->code = preg_replace('/<(\\w+[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?[^\"]*\"[^<>]*)>/is', '<$1$2 newtag=\"sup\">', $this->code);\r\n\t\t\r\n\t\t// clean up stupidity generated by tidy\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) start=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) type=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t\r\n\t\tReTidy::post_dom();\r\n\t\t// remove empty <a> tags; aside from general cleanup, to avoid the regular expression recursion limit of 100 (for the ridiculous\r\n\t\t// case of something like that many anchors at the same spot...\r\n\t\t//$this->code = str_replace('<a></a>', '', $this->code);\r\n\t\t$this->code = preg_replace('/<a>([^<>]*?)<\\/a>/is', '$1', $this->code);\r\n\t//\tReTidy::extra_space();\r\n\t\t\r\n\t\t// lists where each list element has a <ul>\r\n\t\tif(ReTidy::is_XHTML()) {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br /><br /></li>', $this->code);\r\n\t\t} else {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br><br></li>', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// empty text blocks; notice that we would not want to do this generally\r\n\t\t$this->code = preg_replace('/<(p|h1|h2|h3|h4|h5|h6|li)( [^<>]*){0,1}>&nbsp;<\\/\\1>/is', '', $this->code);\r\n\t\t// some sort of full-width break from word that we do not want\r\n\t\t$this->code = preg_replace('/<br [^<>]*clear\\s*=\\s*[\"\\']*all[\"\\']*[^<>]*\\/>/is', '', $this->code);\r\n\t\t// force a border onto tables because word html uses border on cells rather than on the table\r\n\t\t$this->code = preg_replace('/<table([^<>]*) border=\"0\"/is', '<table$1 border=\"1\"', $this->code);\r\n\t\t// despan anchors\r\n\t\tpreg_match_all('/(<a ([^<>]*)[^\\/<>]>)(.*?)(<\\/a>)/is', $this->code, $anchor_matches);\r\n\t\tforeach($anchor_matches[0] as $index => $value) {\r\n\t\t\tif(strpos($anchor_matches[2][$index], \"href=\") === false) {\r\n\t\t\t\tif(strpos($anchor_matches[2][$index], \"name=\") !== false || strpos($anchor_matches[2][$index], \"id=\") !== false) {\r\n\t\t\t\t\t$this->code = str_replace($anchor_matches[1][$index] . $anchor_matches[3][$index] . $anchor_matches[4][$index], $anchor_matches[1][$index] . $anchor_matches[4][$index] . $anchor_matches[3][$index], $this->code);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// simplify lists that unnecessarily have a list for each list item\r\n\t\tpreg_match_all('/<ol([^<>]*?)>(.*?)<\\/ol>/is', $this->code, $ol_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($ol_matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $start_matches);\r\n\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $type_matches);\r\n\t\t\t$start = $start_matches[1];\r\n\t\t\t$type = $type_matches[1];\r\n\t\t\t$combine_string = \"\";\r\n\t\t\twhile(true) {\r\n\t\t\t\t$end_of_previous_offset = $ol_matches[0][$size - 1][1] + strlen($ol_matches[0][$size - 1][0]);\r\n\t\t\t\t$end_of_current_offset = $ol_matches[0][$size][1] + strlen($ol_matches[0][$size][0]);\r\n\t\t\t\t$combine_string = substr($this->code, $end_of_previous_offset, $end_of_current_offset - $end_of_previous_offset) . $combine_string;\r\n\t\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $type_matches2);\r\n\t\t\t\t$type2 = $type_matches2[1];\r\n\t\t\t\tif($type !== $type2) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $start_matches2);\r\n\t\t\t\t$start2 = $start_matches2[1];\r\n\t\t\t\tif(!is_numeric($start2) || $start2 >= $start) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tReTidy::preg_match_last('/<[^<>]+>/is', substr($this->code, 0, $ol_matches[0][$size][1]), $last_tag_piece_matches);\r\n\t\t\t\tif($last_tag_piece_matches[0] !== \"</ol>\") {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$start = $start2;\r\n\t\t\t\t$size--;\r\n\t\t\t}\r\n\t\t\t$cleaned_combine_string = $combine_string;\r\n\t\t\t$cleaned_combine_string = preg_replace('/<\\/ol>\\s*<ol[^<>]*?>/is', '', $cleaned_combine_string);\r\n\t\t\t$this->code = str_replace($combine_string, $cleaned_combine_string, $this->code);\r\n\t\t\t$size--;\r\n\t\t}\r\n\t\t\r\n\t\tReTidy::clean_redundant_sufficient_inline();\r\n\t\tReTidy::double_breaks_to_paragraphs();\r\n\t\tReTidy::encode_for_DOM_all_character_entities(); // re-encode character entities that were decoded at the start of this function\r\n\t\t//$this->code = preg_replace('/(&nbsp;|&#160;|&#xA0;){3,}/is', '&nbsp;&nbsp;', $this->code); // added 2015-06-04\r\n\t\tReTidy::mitigate_consecutive_non_breaking_spaces(); // plz\r\n\t}", "public function stripImage() {\n return $this->im->stripImage();\n }", "function bethel_remove_filter_from_gallery_images ($edit) {\n remove_filter ('wp_get_attachment_image_attributes', 'bethel_filter_image_attributes_for_gallery', 10, 2);\n remove_filter ('wp_get_attachment_link', 'bethel_filter_attachment_link_for_gallery', 10, 6);\n return $edit;\n}", "function strip_non_img_from_table_icons($allow_html, $icons) {\n\n $output = $icons;\n\n if (!$allow_html) {\n\n $output = \"\";\n\n // ONLY include img tags - don't use php's strip_tags since < 5.3.4 doesn't handle self closing html tags properly\n if (preg_match_all(\"/<[iI][mM][gG]\\s.*?>/\", $icons, $img_matches) > 0) {\n debug($img_matches);\n foreach($img_matches[0] as $img) {\n $output .= $img;\n }\n }\n }\n\n return $output;\n\n}", "function remove_thumbnail_dimensions( $html ) {\n\t$html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html );\n\n\treturn $html;\n}", "function attachment_image_link_remove_filter($content) {\n $content = preg_replace(array('{<a(.*?)(wp-att|wp-content\\/uploads)[^>]*><img}', '{ wp-image-[0-9]*\" /></a>}'), array('<img', '\" />'), $content);\n return $content;\n}", "function _js_img_removal($match)\r\n\t{\r\n\t\treturn preg_replace(\"#<img.+?src=.*?(alert\\(|alert&\\#40;|javascript\\:|window\\.|document\\.|\\.cookie|<script|<xss).*?\\>#si\", \"\", $match[0]);\r\n\t}", "function prop_clean() {\n\n remove_action('template_redirect', 'rest_output_link_header', 11);\n remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);\n\n add_filter( 'use_default_gallery_style', '__return_false' );\n\n // Emoji related\n remove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\n}", "protected function cleanupImageContent(array $item)\n {\n array_walk_recursive(\n $item,\n function (&$entry, $key) {\n if ('content' === $key) {\n $entry = \"<CUT>\";\n }\n }\n );\n\n return $item;\n }", "function remove_inline_image_dimensions( $html ) {\n $html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html );\n return $html;\n}", "function remove_custom_image_header()\n {\n }", "function prostarter_preprocess_image(&$variables) {\n unset(\n $variables['width'],\n $variables['height'],\n $variables['attributes']['width'],\n $variables['attributes']['height']\n );\n }", "function remove_thumbnail_dimensions($html)\n{\n $html = preg_replace('/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html);\n return $html;\n}", "function noTag($temp){\n\t$data\t= strip_tags($temp, \"<img \");\n\t$data\t= strip_tags($temp, \"<table \");\n\t$data\t= strip_tags($temp, \"<font \");\n\t$data\t= strip_tags($temp, \"<span \");\t\n\t$data\t= strip_tags($temp, \"<p \");\t\t\n\treturn $data;\n}", "function remove_thumbnail_dimensions( $html )\n{\n $html = preg_replace('/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html);\n return $html;\n}", "function remove_thumbnail_dimensions( $html )\n{\n $html = preg_replace('/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html);\n return $html;\n}", "function remove_thumbnail_dimensions( $html )\n{\n $html = preg_replace('/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html);\n return $html;\n}", "function replaceIMG($html)\r\n\t{\r\n\t\t$iStart = stripos($html,\"<img\");\r\n\t\twhile((string)$iStart != null) //string typecast to handle \"0\" which equates to FALSE in PHP...\r\n\t\t{\r\n\t\t\t//get entire IMG tag\r\n\t\t\t$iEnd = stripos($html,\">\",$iStart)+1;\r\n\t\t\t$imgTag = substr($html,$iStart,($iEnd-$iStart));\r\n\t\t\t\r\n\t\t\t//get src\r\n\t\t\t$iSrcStart = stripos($imgTag,\"src=\");\r\n\t\t\tif(substr($imgTag,($iSrcStart+4),1) == \"'\")\r\n\t\t\t{\r\n\t\t\t\t//single quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,\"'\",$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//double quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,'\"',$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\t$imgSrc = substr($imgTag,$iSrcStart+5,($iSrcEnd-($iSrcStart+5)));\r\n\t\t\t\r\n\t\t\t//get alt\r\n\t\t\t$iAltStart = stripos($imgTag,\"alt=\");\r\n\t\t\tif($iAltStart != null)\r\n\t\t\t{\r\n\t\t\t\tif(substr($imgTag,($iAltStart+4),1) == \"'\")\r\n\t\t\t\t{\r\n\t\t\t\t\t//single quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,\"'\",$iAltStart+5);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t//double quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,'\"',$iAltStart+5);\r\n\t\t\t\t}\r\n\t\t\t\t$imgAlt = substr($imgTag,$iAltStart+5,($iAltEnd-($iAltStart+5)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//replace HTML\r\n\t\t\tif((string)stripos($imgSrc,\"scripts/CLEditor/images/icons/\") == null) //exclude icons from rich text editor\r\n\t\t\t{\r\n\t\t\t\t$replacementHTML = \"<div class='table comicborder popupshadow-margin'><div class='table-row'><div class='table-cell'><a href='\" . $imgSrc . \"'>\" . $imgTag . \"</a></div></div>\";\r\n\t\t\t\tif($iAltStart != null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$replacementHTML = $replacementHTML . \"<div class='table-row'><div class='table-cell comicimagecaption'>\" . $imgAlt . \"</div></div>\";\r\n\t\t\t\t}\r\n\t\t\t\t$replacementHTML = $replacementHTML . \"</div>\";\r\n\t\t\t\t$html = substr_replace($html,$replacementHTML,$iStart,($iEnd-$iStart));\r\n\t\t\t\t\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($replacementHTML)));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($imgTag)));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $html;\r\n\t}", "function swap_image($msg){\n\n\tif(preg_match(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",$msg)){\n\t\t$msg=preg_replace(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",\"$2\",$msg);\n\t}\n\nreturn $msg;\n}", "function snipVerbottenImagesFromPost($post_id) {\n // make a query to the verbottenimage_posts table\n // question: what are the verbotten_image_id s? remeber there might be multiple\n // now find their positiions iin the post_content, and cycle through them stating with last first ( so as to not upset subsequent positiions)\n global $wpdb;\n $someObj = new stdClass;\n\n\n // The post featured image link stored in the WordPress database is stored in wp_postmeta with a meta_key called _thumbnail_id.\n // in wp_posts_meta, wwhere meta_key = _thumbnail_id and meta_value = the verbotten_image_id and the post_id is the post_id ... then we need to \n // should we delete? or should we instead change the meta key from _thumbnail_id ==> verbottenimage_id and also do a substitution ... add a new record \n // ... mostly identical to the previous one, putting _thumbnail_id --> a known substitute image. Alternatively, we could store all the data pertaining to the deleted verbotten images someplace else. LEt's say, in a different table altogether.\n \n\n // get the data for that post_id\n // verbottenimage_posts\n // check the thumbnail id, if the thumbnail id is one of the verbotten images, then fix it.\n\n \n // do the backup + featured image substitution first.\n\n\n $verbottenimage_post_images_query_result = $wpdb->get_results(\"SELECT * FROM verbottenimage_posts WHERE verbottenimage_posts.post_id = {$post_id}\");\n \n if (count($verbottenimage_post_images_query_result) > 0 ) {\n\n\n\n // change the meta key from _thumbnail_id in wp_post_meta 507117\n\n \n\n $somePostContent = $verbottenimage_post_images_query_result[0]->post_content;\n\n // get the $imgPositions\n preg_match_all('/(<img)/', $somePostContent, $imgPositions, PREG_OFFSET_CAPTURE);\n\n $snips = Array();\n // find the position if the needle in the hayStack\n forEach($verbottenimage_post_images_query_result AS $item) {\n $needle = 'wp-image-' . $item->verbotten_image_id . '\"';\n // strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) : int\n $needlePos = strpos($somePostContent, $needle);\n if ($needlePos === false) {\n $needle = 'wp-image-' . $item->verbotten_image_id . ' ';\n $needlePos = strpos($somePostContent, $needle);\n }\n // and then reset needle back to original\n $needle = 'wp-image-' . $item->verbotten_image_id;// it is not used, just going pack in the json response\n\n $snipObj = new stdClass;\n $snipObj->id = $item->verbotten_image_id;\n $snipObj->identifier = $needle;\n\n $snipObj->needlePos = $needlePos;\n // $snipObj->imgPositions = $imgPositions;\n \n $possibleSnipStartPositions = Array();\n forEach($imgPositions[0] AS $possibleSnipStartObj) {// for some reason there are two identical arrays in an array?! so we jsut use the first one, which gives us an array of 2-item arrays, the second of which [1], is the positiion\n array_push($possibleSnipStartPositions, $possibleSnipStartObj[1]);\n }\n \n $snipStart = 0;\n forEach($possibleSnipStartPositions AS $pos) {\n if($pos < $needlePos && $pos > $snipStart) {\n $snipStart = $pos;\n }\n }\n \n $snipObj->snipStart = $snipStart;// the the highest in imgPositions that is below $needlePos\n $snipObj->snipEnd = strpos($somePostContent, '>', $needlePos) + 1; // the lowest > character that is above $needlePos. +1 because the '>' is precisely 1 character in length\n array_push($snips, $snipObj);\n\n }\n // remove all the snips where !needlePos\n foreach ($snips as $key => $snipObj) {\n if ($snipObj->needlePos === false) {\n unset($snips[$key]);\n }\n}\n // make sure that the $snips are ordered in order of their needlePos\n usort($snips, \"sortOnReverseNeedlePos\");\n\n // and now we start snipping. We have $somePostContent already to start with.\n\n\n\t\t// this works\n\n $snippedContent = $somePostContent;// start with somePostContent, but allow progressive snips to occur.\n forEach($snips AS $snipObj) {\n // make the html comment that has the edit link in it. And sandwhich iit between the snips\n $editLinkComment = \"<!-- AnImageWasRemoved edit-link: https://www.everythingzoomer.com/wp-admin/upload.php?item={$snipObj->id} -->\";\n $firstHalf = substr($snippedContent, 0, $snipObj->snipStart);\n $secondHalf = substr($snippedContent, $snipObj->snipEnd);\n $snippedContent = $firstHalf . $editLinkComment . $secondHalf;\n }\n // $someObj->snippedContent = $snippedContent;\n // now we are done with all the snipping, and are ready to make the query to update.\n\n // and now make the query \n // $verbottenimage_post_images_query_result = $wpdb->get_results(\"SELECT * FROM verbottenimage_posts WHERE verbottenimage_posts.post_id = {$post_id}\");\n \n // $snipQuery = $wpdb->get_results(\"UPDATE verbottenimage_posts SET fixed_post_content = {$snippedContent} WHERE verbottenimage_posts.post_id = {$post_id}\");// this does them all at once, instead of doing it sequentially. it will do them all, multiple times, but whatever, it will be inefficient, but still work\n $snipQuery = $wpdb->update(\n 'verbottenimage_posts',\n array( \n 'fixed_post_content' => $snippedContent\n ),\n array(\n 'post_id' => $post_id \n )\n );\n\n // now, let's actually snip the post_content from wp_posts\n $replaceActualPostContentQuery = $wpdb->update(\n 'wp_posts',\n array( \n 'post_content' => $snippedContent\n ),\n array(\n 'ID' => $post_id \n )\n );\n\n // and lastly, let's update the removed for each of the verbottenimages .. only after te post has been updated.\n $reeplacedQuery = $wpdb->update(\n 'verbottenimage_posts',\n array( \n 'removed' => 1\n ),\n array(\n 'post_id' => $post_id \n )\n );\n\n\n $someObj->snipQuery = $snipQuery;\n }\n \n // $numberOfImages = substr_count($somePostContent, '<img');\n \n $someObj->snips = $snips;\n return $someObj;\n // return $verbottenimage_post_images_query_result;\n }", "function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {\n\t$html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', '', $html );\n\treturn $html;\n}", "function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {\n\tif ( ! strpos( $html, 'attachment-shop_single' ) ) {\n\t\t$html = preg_replace( '/^(width|height)=\\\"\\d*\\\"\\s/', '', $html );\n\t}\n\treturn $html;\n}", "function remove_gallery_style( $a ) {\n return preg_replace(\"%<style type=\\'text/css\\'>(.*?)</style>%s\", \"\", $a);\n}", "function remove_thumbnail_height($html) {\n $html = preg_replace('/height=\\\"\\d*\\\"\\s/', \"\", $html);\n return $html;\n}", "function imageAllReset();", "public function IncorrectImagePixelSize()\n\t{\n\t\tglobal $ft_dom;\n\t\t$code = array('');\t\t\t\n\t\t$elements = $ft_dom->getElementsByTagName('img');\n\t\t$img_array = array();\n\t\t$badimg = array();\n\t\t$code[1] = 0;\n\t\t$code[2] = '';\n\t\t$max_resource_tests = 50;\n\n\t foreach ($elements as $element) { \n\t\t\t//don't try to do too many.\n\t\t\tif(count($img_array) > $max_resource_tests) { continue; }\n\t\t\tif(Helper::likelyPixel($element)) { continue; }\n\t\t\tif($element->hasAttribute('src')) {\n\t\t\t\t//if((!$element->hasAttribute('width') && $element->hasAttribute('style')) && Helper::hasInlineStyleAttribute($element->getAttribute('style'),'width')) { echo \"width set inline.\"; }\n\t\t\t\tif(in_array($element->getAttribute('src'),$img_array)) { continue; }\n\t\t\t\t\n\t\t\t\tif ($element->hasAttribute('width') || $element->hasAttribute('height')) {\n\t\t\t\t\t$link = Helper::getAbsoluteResourceLink($element->getAttribute('src'));\n\t\t\t\t\t\n\t\t\t\t\tif(Helper::http200Test($link)) { \n\t\t\t\t\t\t\n\t\t\t\t\t\tlist($width, $height) = getimagesize($link);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($element->hasAttribute('width')) {\n\t\t\t\t\t\t\t//echo \"\\n\\nwidth:\" . $element->getAttribute('width') . \"\\n\";\n\n\t\t\t\t\t\t\tif($element->getAttribute('width') != $width) {\n\t\t\t\t\t\t\t\tif($code[1] <= Helper::$max_disp_threshold) { $code[0] .= Helper::printCodeWithLineNumber($element) . \"\\nshould be width=\\\"$width\\\"\"; }\n\t\t\t\t\t\t\t\t$badimg[] = $element;\n\t\t\t\t\t\t\t\t$code[1]++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($element->hasAttribute('height')) {\n\n\t\t\t\t\t\t\tif($element->getAttribute('height') != $height) {\n\t\t\t\t\t\t\t\tif($code[1] <= Helper::$max_disp_threshold) {\n\t\t\t\t\t\t\t\t\tif(in_array($element, $badimg)) {\n\t\t\t\t\t\t\t\t\t\t$code[0] .= \"\\n and height=\\\"$height\\\"(\" .$element->getAttribute('src') . \")\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$code[0] .= Helper::printCodeWithLineNumber($element) . \"\\nshould be height=\\\"$height\\\"\";\n\t\t\t\t\t\t\t\t\t\t$code[1]++;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(in_array($element, $badimg)) { $code[0] .= \"\\n\\n\"; }\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$img_array[] = $element->getAttribute('src');\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\tif($code[0] != '') {\n\t\t\tif($code[1] > Helper::$max_disp_threshold) { $code[0] .= '...'; }\n\t\t\tif($code[1] > 1) { $code[2] = 's'; }\t\t\t\n\t\t\treturn $code;\n\t\t}\n\t return false;\n\t}", "function remove_thumbnail_dimensions( $html ) {\n $html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', '', $html );\n return $html;\n}", "function be_remove_image_alignment( $attributes ) {\r\n $attributes['class'] = str_replace( 'alignleft', 'aligncenter', $attributes['class'] );\r\n\treturn $attributes;\r\n}", "function cleanImages()\r\n {\r\n if (!count($this->imagesContent)) return true;\r\n $this->_echo('<br>Очистка не используемых файлов картинок...');\r\n foreach ($this->imagesContent as $file) {\r\n @unlink($this->rootPath.$file);\r\n }\r\n }", "public function delete_unknown_images() {\n global $wpdb;\n $wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image` WHERE gallery_id=0');\n }", "public function clearImageVariables()\n {\n $this->saveVariable('itempic', null);\n\n for ($i = 2; $i < 7; $i++) {\n $picture = 'itempic' . $i;\n $this->saveVariable($picture, null);\n }\n\n $this->saveVariable('category_name', null);\n $this->saveVariable('category', null);\n }", "function remove_empty_p($content)\n{\n $content = preg_replace(array(\n '#<p>\\s*<(div|aside|section|article|header|footer)#',\n '#</(div|aside|section|article|header|footer)>\\s*</p>#',\n '#</(div|aside|section|article|header|footer)>\\s*<br ?/?>#',\n '#<(div|aside|section|article|header|footer)(.*?)>\\s*</p>#',\n '#<p>\\s*</(div|aside|section|article|header|footer)#',\n ), array(\n '<$1',\n '</$1>',\n '</$1>',\n '<$1$2>',\n '</$1',\n ), $content);\n return preg_replace('#<p>(\\s|&nbsp;)*+(<br\\s*/*>)*(\\s|&nbsp;)*</p>#i', '', $content);\n}", "function remove_empty_p( $content ){\n $content = preg_replace( array(\n '#<p>\\s*<(div|aside|section|article|header|footer)#',\n '#</(div|aside|section|article|header|footer)>\\s*</p>#',\n '#</(div|aside|section|article|header|footer)>\\s*<br ?/?>#',\n '#<(div|aside|section|article|header|footer)(.*?)>\\s*</p>#',\n '#<p>\\s*</(div|aside|section|article|header|footer)#',\n ), array(\n '<$1',\n '</$1>',\n '</$1>',\n '<$1$2>',\n '</$1',\n ), $content );\n return preg_replace('#<p>(\\s|&nbsp;)*+(<br\\s*/*>)*(\\s|&nbsp;)*</p>#i', '', $content);\n}", "function clean_PDF() {\r\n\t\t$this->code = str_replace('font-style: normal;', '', $this->code);\r\n\t\t$this->code = str_replace('text-decoration: none;', '', $this->code);\r\n\t\t$this->code = str_replace('overflow: visible;', '', $this->code);\r\n\t\t$this->code = preg_replace('/border-\\w+-[^\\:]+:[^;]+;/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/padding-[^\\:]+:[^;]+;/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/text-indent:[^;]+;/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/line-height:[^;]+;/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/display:[^;]+;/is', '', $this->code);\r\n\t\t//$this->code = str_replace('text-align: left;', '', $this->code);\r\n\t\t// hyphenated words...\r\n\t\t$this->code = preg_replace('/(\\w)- (\\w)/is', '$1$2', $this->code);\r\n\t\t// footnotes\r\n\t\t$footnotes_code = '<hr>\r\n';\r\n\t\tpreg_match_all('/(<p[^<>]{0,}>.{0,100}?<img[^<>]+height=\"1\".*?<\\/p>)\\s{0,}(<p[^<>]{0,}>.*?<\\/p>)/is', $this->code, $footnote_matches);\r\n\t\t//print('$footnote_matches: ');var_dump($footnote_matches);\r\n\t\t// <p class=Default><a href=\"#_ftnref1\" name=\"_ftn1\" title=\"\">[1]</a>  <i>R. v. Bentley</i>, 2017 ONCA 982</p>\r\n\t\tforeach($footnote_matches[0] as $footnote_index => $footnote_match) {\r\n\t\t\t$footnote_code = $footnote_matches[2][$footnote_index];\r\n\t\t\t$footnote_code = ReTidy::preg_replace_first('/<a name=\"bookmark[0-9]+\">\\s{0,}([0-9]+)\\s{0,}<\\/a>/is', '<a href=\"#_ftnref$1\" name=\"_ftn$1\" title=\"\">[$1]</a>', $footnote_code); // so that clean_word recognizes it\r\n\t\t\t$footnotes_code .= $footnote_code . '\r\n';\r\n\t\t\t$this->code = str_replace($footnote_matches[0][$footnote_index], '', $this->code);\r\n\t\t}\r\n\t\t$this->code = str_replace('</body>', $footnotes_code . '</body>', $this->code);\r\n\t\t// <a href=\"#bookmark0\" class=\"s6\">1</a>\r\n\t\t// <a href=\"#_ftn1\" name=\"_ftnref1\" title=\"\"><span class=MsoFootnoteReference><span class=MsoFootnoteReference><span lang=EN-GB style='font-size:12.0pt;line-height:115%;font-family:\"Times New Roman\",serif'>[1]</span></span></span></a>\r\n\t\t$this->code = preg_replace('/<a href=\"#bookmark[0-9]+\"[^<>]{0,}>([0-9]+)<\\/a>/is', '<a href=\"#_ftn$1\" name=\"_ftnref$1\" title=\"\">[$1]</a>', $this->code);\r\n\t\t// strip <p>s in <li>s; loop this since lists can be nested\r\n\t\t$closing_p_count = -1;\r\n\t\twhile($closing_p_count != 0) {\r\n\t\t\t$this->code = preg_replace('/(<li[^<>]{0,}>.*?)<\\/p>([^<>]*?<\\/li>)/is', '$1$2', $this->code, -1, $closing_p_count);\r\n\t\t}\r\n\t\t$opening_p_count = -1;\r\n\t\twhile($opening_p_count != 0) {\r\n\t\t\t$this->code = preg_replace('/(<li[^<>]{0,}>[^<>]*?)<p[^<>]{0,}>(.*?<\\/li>)/is', '$1$2', $this->code, -1, $opening_p_count);\r\n\t\t}\r\n\t\t// would be simple if this code was ready\r\n\t\t/*\r\n\t\tif(!include_once('..' . DS . 'LOM' . DS . 'O.php')) {\r\n\t\t\tprint('<a href=\"https://www.phpclasses.org/package/10594-PHP-Extract-information-from-XML-documents.html\">LOM</a> is required');exit(0);\r\n\t\t}\r\n\t\t$O = new O($this->code);\r\n\t\t$lis = $O->_('li');\r\n\t\tprint('$lis: ');var_dump($lis);*/\r\n\t\t\r\n\t\tReTidy::style_cdata();\r\n\t\r\n\t\tReTidy::dom_init();\r\n\t\tReTidy::DOM_stylesheets_to_styles();\r\n\t\tReTidy::dom_save();\r\n\r\n\t//\tReTidy::post_dom();\r\n\t\t\r\n\t}", "function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {\n $html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html );\n return $html;\n}", "function zm_imagedeletions($data, $otherStuff = 'bupkis') {\n // $testObj = new stdClass;\n // $testObj->data = $data;\n // $testObj->otherStuff = $otherStuff;\n // return $testObj;\n // return $data;\n // if (!isset($data['secret'] || $data['secret'] !== 'topsecret')) {\n // return false; \n // }\n $start_time=microtime(true);\n\n // so ... what are we doing here?\n // this is the callback function ... so we do a query of a few rows, and then snip out the offending images, and\n // figuring out how to snip it will be more than just a simple regex.\n // we need to find the position of wp-image-vvvvv where vvvvv is the verbotten_image_id\n // \n // \n // $content = \"this is something with an <img src=\\\"test.png\\\"/> in it.\";\n // $content = preg_replace(\"/<img[^>]+\\>/i\", \"(image) \", $content); \n // echo $content;\n // $posts = $wpdb->get_results(\"SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish'\n // AND post_type='post' ORDER BY comment_count DESC LIMIT 0,4\")\n $limit = 1;\n global $wpdb;\n $someObj = new stdClass;\n \n // $someObj->numImages = $wpdb->get_results(\"SELECT COUNT(*) FROM verbottenimage_posts WHERE verbottenimage_posts.removed <> 1;\");\n $nextPostsWithVerbottenImages = $wpdb->get_results(\"SELECT DISTINCT verbottenimage_posts.post_id FROM verbottenimage_posts WHERE verbottenimage_posts.removed <> 1 ORDER BY post_id ASC LIMIT {$limit};\");\n \n // $someObj->nextPostsWithVerbottenImages = count($nextPostsWithVerbottenImages) > 0 ? $nextPostsWithVerbottenImages : false;\n $someObj->nextPostsWithVerbottenImages = $nextPostsWithVerbottenImages;\n\n $imagesSnipped = Array();\n forEach($nextPostsWithVerbottenImages AS $nextPost) {\n $nextPostID = $nextPost->post_id;\n $imagesSnipped[$nextPostID] = snipVerbottenImagesFromPost($nextPostID);// returns an array of all the verbotten_image_id snipped from th post\n }\n // $someObj->nextPostsWithVerbottenImages = \n\n $someObj->imagesSnipped = $imagesSnipped;\n\n $someObj->featuredImageSwitch = featuredImageSwitch($nextPostID);\n // $someObj->nextPostWithVerbottenImages = $nextPostWithVerbottenImages;\n // $someObj->nextPostWithVerbottenImages = $nextPostWithVerbottenImages[0]->post_id;\n\n // $numberOfVerbottenImagesQueryResult = $wpdb->get_results(\"SELECT COUNT(*) FROM verbottenimage_posts WHERE verbottenimage_posts.removed <> 1;\");\n // $numberOfRemainingVerbottenImages = count($numberOfVerbottenImagesQueryResult) > 0 ? $numberOfVerbottenImagesQueryResult[0] : 0;\n // $someObj->numberOfRemainingVerbottenImages = $numberOfRemainingVerbottenImages;\n\n // determine the next post to work on.\n // $someObj->numPosts = $wpdb->get_results(\"SELECT COUNT(DISTINCT post_id) FROM verbottenimage_posts WHERE verbottenimage_posts.removed <> 1;\");\n \n $end_time = microtime(true);\n $execution_time = bcsub($end_time, $start_time, 4);\n $someObj->execution_time = $execution_time;\n $someObj->memory_peak = memory_get_peak_usage(false) / (1024 * 1024) . 'M';\n return $someObj;\n }", "function tac_remove_empty_p( $content ){\n\t// Clean up p tags around block elements.\n\t$content = preg_replace( array(\n\t\t'#<p>\\s*<(div|aside|section|article|header|footer)#',\n\t\t'#</(div|aside|section|article|header|footer)>\\s*</p>#',\n\t\t'#</(div|aside|section|article|header|footer)>\\s*<br ?/?>#',\n\t\t'#<(div|aside|section|article|header|footer)(.*?)>\\s*</p>#',\n\t\t'#<p>\\s*</(div|aside|section|article|header|footer)#',\n\t), array(\n\t\t'<$1',\n\t\t'</$1>',\n\t\t'</$1>',\n\t\t'<$1$2>',\n\t\t'</$1',\n\t), $content );\n\n\treturn preg_replace('#<p>(\\s|&nbsp;)*+(<br\\s*/*>)?(\\s|&nbsp;)*</p>#i', '', $content);\n}", "public function remove_loading_lazy_attributes( $content ) \n\t\t{\n\t\t\t$matches = array();\n\t\t\tif ( ! preg_match_all( '/<img [^>]+>/', $content, $matches ) ) \n\t\t\t{\n\t\t\t\treturn $content;\n\t\t\t}\n\t\t\t\n\t\t\tforeach ( $matches[0] as $image ) \n\t\t\t{\n\t\t\t\t$attachment_id = $this->get_attachment_id( $image );\n\t\t\t\tif( false !== $attachment_id )\n\t\t\t\t{\n\t\t\t\t\t$this->add_attachment_id_to_not_lazy_loading( $attachment_id );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$count = 0;\n\t\t\t\t$new_image = str_ireplace( array( 'loading=\"lazy\"', \"loading='lazy'\" ), '', $image, $count );\n\t\t\t\tif( $count != 0 )\n\t\t\t\t{\n\t\t\t\t\t$pos = strpos( $content, $image );\n\t\t\t\t\t\n\t\t\t\t\tif( false !== $pos )\n\t\t\t\t\t{\n\t\t\t\t\t\t$content = substr_replace( $content, $new_image, $pos, strlen( $image ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $content;\n\t\t}", "function remove_sl(){\n\t\t\n\t}", "public function remove_thumbnail_dimensions( $html ) {\n\t\t$html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html );\n\t\treturn $html;\n\t}", "function imageAllDelete();", "public function delete_inline($str = '')\n\t{\n\t\t$img = array();\n\t\t$start = '<img';\n\t\t$end = '>';\n\t\t$pattern = sprintf('/%s(.+?)%s/ims', preg_quote($start, '/'), preg_quote($end, '/'));\n\t\t$search = true;\n $i = 1;\n\t\twhile($search)\n\t\t{\n\t\t\tif (preg_match($pattern, $str, $matches))\n {\n\t\t\t\tlist(, $match) = $matches;\n\t\t\t\t$img[$i] = $start . $match . $end;\n\t\t\t\t$str = str_replace($start . $match . $end, \"{gambar_$i}\", $str);\n $i++;\n\t\t\t}\n else\n {\n\t\t\t\t$search = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n \n $img_to_check = array();\n foreach ($img as $key=>$val)\n {\n if(strpos($val, base_url($this->upload_dir)) !== FALSE)\n \t{\n \t\t$ex_val = explode(base_url(), $val);\n \t\t$to_check = substr($ex_val[1], 0, strpos($ex_val[1], '\"'));\n \t\t$img_nm = str_replace($this->upload_dir, '', $to_check);\n \t\t$img_nm_2 = substr($img_nm, 0, strpos($img_nm, '-img'));\n \t\tif(!in_array($img_nm_2, $img_to_check))\n \t\t\t$img_to_check[] = $img_nm_2;\n \t}\n }\n\n\t\tforeach ($img_to_check as $k => $v)\n\t\t{\n\t\t\t$old_images = $this->get($v, '', TRUE);\n\t\t\tforeach($old_images as $k2 => $v2)\n\t\t\t{\n\t\t\t\tunlink($v2);\n\t\t\t}\n\t\t}\n\t}", "function _clean_bbcode($str)\n{\n\t$str = preg_replace('/\\[img:[a-z0-9]{10,}\\].*?\\[\\/img:[a-z0-9]{10,}\\]/', ' ', $str);\n\t$str = preg_replace('/\\[\\/?url(=.*?)?\\]/', ' ', $str);\n\t$str = preg_replace('/\\[\\/?[a-z\\*=\\+\\-]+(\\:?[0-9a-z]+)?:[a-z0-9]{10,}(\\:[a-z0-9]+)?=?.*?\\]/', ' ', $str);\n\treturn $str;\n}", "function shariff3uu_catch_image() {\n\t\t$result = preg_match_all( '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', get_post_field( 'post_content', get_the_ID() ), $matches );\n\t\tif ( array_key_exists( 0, $matches[1] ) ) {\n\t\t\treturn $matches[1][0];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function parseImages( &$row, $params ){\n\t\t$text = $row->introtext.$row->fulltext;\n\t\t$regex = \"/\\<img.+src\\s*=\\s*\\\"([^\\\"]*)\\\"[^\\>]*\\>/\";\n\t\tpreg_match ($regex, $text, $matches); \n\t\t$images = (count($matches)) ? $matches : array();\n\t\tif (count($images)){\n\t\t\treturn $images[1];\n\t\t}\n\t\treturn ;\n\t}", "public function parsePICTURE()\n {\n }", "function remove_empty_p( $content ) {\n $content = force_balance_tags( $content );\n $content = preg_replace( '#<p>\\s*+(<br\\s*/*>)?\\s*</p>#i', '', $content );\n $content = preg_replace( '~\\s?<p>(\\s|&nbsp;)+</p>\\s?~', '', $content );\n return $content;\n}", "private function remove_self_closing_tags() {\n\t\tadd_filter('get_avatar', [$this, 'remove_self_closing_tag']); // <img]/>\n\t\tadd_filter('comment_id_fields', [$this, 'remove_self_closing_tag']); // <input]/>\n\t\tadd_filter('post_thumbnail_html', [$this, 'remove_self_closing_tag']); // <img]/>\n\t}", "function medula_remove_image_size( $sizes ) {\n\tunset( $sizes['thumbnail'] );\n\tunset( $sizes['medium'] );\n\tunset( $sizes['large'] );\n\n\treturn $sizes;\n}", "function trim_tags2($info)\n\t\t{\n\t\t $i=0;\n\t\t while(!empty($info[$i]))\n\t\t {\n\t\t\t$info[$i]=strip_tags($info[$i]);\n\t\t\t$i++;\n\t\t }\n\t\t return $info;\n\t\t\n\t\t}", "function limit_content() {\n $content = get_the_content();\n $content = preg_replace('/(<)([img])(\\w+)([^>]*>)/', \"\", $content);\n $content = apply_filters('the_content', $content);\n $content = str_replace(']]>', ']]&gt;', $content);\n echo $content;\n}", "function blog_content_filter($content){\n\n if ( is_home() ){\n $content = preg_replace(\"/<img[^>]+\\>/i\", \"\", $content);\n }\n\n return $content;\n}" ]
[ "0.7701251", "0.73129153", "0.71207833", "0.6918383", "0.68745744", "0.6856024", "0.6828413", "0.6784832", "0.6770188", "0.6746481", "0.6746481", "0.6746481", "0.6746481", "0.6746481", "0.6746481", "0.67281234", "0.6721336", "0.67201537", "0.66565174", "0.6627986", "0.6613845", "0.6589269", "0.65615", "0.65239763", "0.6449073", "0.6449073", "0.6441647", "0.6359622", "0.6250616", "0.62128884", "0.62035745", "0.61482096", "0.6040485", "0.60279185", "0.5868709", "0.5776228", "0.5773634", "0.5722711", "0.57156646", "0.57143956", "0.5696964", "0.56664366", "0.5654104", "0.5637226", "0.56192636", "0.5606403", "0.56002355", "0.5596009", "0.55937326", "0.5583507", "0.5582404", "0.55787784", "0.55641335", "0.55619603", "0.55618143", "0.5557194", "0.5552252", "0.55510825", "0.5539715", "0.5512096", "0.55072635", "0.55063605", "0.5480117", "0.5480117", "0.5480117", "0.5479092", "0.5468009", "0.5464363", "0.5463967", "0.5462429", "0.54351187", "0.54323906", "0.5430705", "0.5418994", "0.5396368", "0.5381149", "0.5355736", "0.5353717", "0.53449786", "0.5332293", "0.53289574", "0.5328664", "0.5313209", "0.5306869", "0.5292966", "0.52873605", "0.5270472", "0.5269081", "0.5266985", "0.5266934", "0.52565974", "0.52533466", "0.5242942", "0.52393496", "0.5230011", "0.5229665", "0.5220519", "0.52146715", "0.52090657", "0.52044725" ]
0.67084926
18
Change the mode on a directory structure recursively. This includes changing the mode on files as well.
function cli_chmod($path, $mode = 0755, $recursive = true, $exceptions = array()) { global $_messages, $_errors; if ($recursive === false && is_dir($path)) { if (@chmod($path, intval($mode, 8))) { $_messages[] = sprintf('<success>%s changed to %s<success>', $path, $mode); return true; } $_errors[] = sprintf('<error>%s NOT changed to %s', $path, $mode); return false; } if (is_dir($path)) { $paths = cli_tree($path); foreach ($paths as $type) { foreach ($type as $key => $fullpath) { $check = explode(DS, $fullpath); $count = count($check); if (in_array($check[$count - 1], $exceptions)) { continue; } if (@chmod($fullpath, intval($mode, 8))) { $_messages[] = sprintf('<success>%s changed to %s</success>', $fullpath, $mode); } else { $_errors[] = sprintf('<error>%s NOT changed to %s</error>', $fullpath, $mode); } } } if (empty($_errors)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function changeMode($files, $mode, $umask = 0000, $recursive = false);", "public function setChmod($mode = self::DEFAULT_MODE, bool $recursive = true, array $exceptions = [])\n {\n if (!self::exists($this->path)){\n\t\t\t$this->errors[] = \"[{$this->path}] - Não existe.\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!self::isValidChmod($mode)){\n\t\t\t$this->messages[] = sprintf('O valor %s, é inválido para chmod. O valor padrão %s, foi aplicado para o diretório %s.', $mode, self::DEFAULT_MODE, $this->path);\n\t\t}\n\n if ($recursive === false && is_dir($this->path)) {\n //@codingStandardsIgnoreStart\n if (@chmod($this->path, intval($mode, 8))) {\n //@codingStandardsIgnoreEnd\n $this->messages[] = sprintf('%s alterado para %s', $this->path, $mode);\n\n return true;\n }\n $this->errors[] = sprintf('%s não alterado para %s', $this->path, $mode);\n return false;\n }\n\n if (is_dir($this->path)) {\n $paths = self::tree($this->path);\n\n foreach ($paths as $type) {\n foreach ($type as $fullpath) {\n $check = explode(DIRECTORY_SEPARATOR, $fullpath);\n $count = count($check);\n\n if (in_array($check[$count - 1], $exceptions)) \n continue;\n //@codingStandardsIgnoreStart\n if (@chmod($fullpath, intval($mode, 8))) \n //@codingStandardsIgnoreEnd\n $this->messages[] = sprintf('%s alterado para %s', $fullpath, $mode);\n else \n $this->errors[] = sprintf('%s não alterado para %s', $fullpath, $mode);\n }\n }\n\n if (empty(self::$errors)) \n return true; \n }\n\n return false;\n }", "public function changeMode($path, $mode);", "public function makeDirectory($path, $mode = 0755, $isRecursive = true);", "function chmodr($path, $mode = 0755) {\n\t\tif (!is_dir($path)) {\n\t\t\treturn chmod($path, $mode);\n\t\t}\n\t\t$dir = opendir($path);\n\n\t\twhile($file = readdir($dir)) {\n\t\t\tif ($file != '.' && $file != '..') {\n\t\t\t\t$fullpath = $path . '/' . $file;\n\n\t\t\t\tif (!is_dir($fullpath)) {\n\t\t\t\t\tif (!chmod($fullpath, $mode)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (!chmodr($fullpath, $mode)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($dir);\n\n\t\tif (chmod($path, $mode)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function setFilePermission (string $path) : void {\n\n\tif (PHP_OS_FAMILY === \"Windows\") return;\n\t$iterator = null;\n\tif (!is_dir($path)) {\n\t\t$iterator = [$path];\n\t} else {\n\t\t$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));\n\t}\n\n\tforeach ($iterator as $item) {\n\t\t@chmod($item, octdec(getConfig(\"UNIX_FILE_PERMISSIONS\")));\n\t\t@chgrp($item, getConfig(\"UNIX_FILE_GROUP\"));\n\t}\n}", "function ftp_chmod_son($filename,$chmod = 0777){\r\n\t\t//$chmod = (int) $chmod;\r\n\t\t\r\n\t\t$filename = dzz_ftp::clear($filename);\r\n\t\t//检查子目录\r\n\t\tif($list=self::ftp_list($filename,0)){\r\n\t\t\tforeach($list as $value){\r\n\t\t\t\tif($value['type']=='folder'){\r\n\t\t\t\t\tself::ftp_chmod_son($value['path'],$chmod);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself::ftp_chmod($value['path'],$chmod);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn self::ftp_chmod($filename,$chmod);\r\n\t}", "function mkdir_recursive($pathname, $mode) {\n\tis_dir(dirname($pathname)) || mkdir_recursive(dirname($pathname), $mode);\n\treturn is_dir($pathname) || @mkdir($pathname, $mode);\n}", "function setCHMOD($params='')\n {\n global $iConfig;\n $aReturn = array();\n\n if (empty($params))\n {\n $params = $iConfig['chmod_paths'];\n }\n\n foreach ($params as $path => $mode)\n {\n $aReturn[$path]['status'] = '';\n $real_path = realpath(dirname($_SERVER['SCRIPT_FILENAME']) .'/../'. $path); // Get real path\n\n if (file_exists($real_path))\n {\n if (!fileperms($real_path))\n {\n $aReturn[$path]['status'] = sprintf($this->t('e_permition_fail'), $path);\n }else{\n// if (!@chmod($real_path, $mode)) $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path); // Need to test\n\n $aReturn[$path]['mode'] = '0'.decoct(0777 & fileperms($real_path));\n //echo $path.\": (\".fileperms($real_path).\")\".($aReturn[$path]['mode']).\" - \".($mode).\"<br/>\";\n $s1=strrev(\"\".$aReturn[$path]['mode']);\n $s2=strrev(\"\".$mode);\n $aReturn[$path]['status'] = '';\n for($i=0;$i<strlen($s2);$i++)\n {\n if(intval($s1[$i])<intval($s2[$i]))\n {\n $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path);\n break;\n }\n }\n /* if(intval($aReturn[$path]['mode']) != intval($mode)) $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path);\n else $aReturn[$path]['status'] = ''; */\n }\n }else{\n $aReturn[$path]['status'] = sprintf($this->t('e_missing_file'), $path);\n }\n }\n return $aReturn;\n }", "function glob_recursive($dir, $mask){\n foreach(glob($dir.'/*') as $filename){\n if(strtolower(substr($filename, strlen($filename)-strlen($mask), strlen($mask)))==strtolower($mask)){\n if (is_writable($filename)) { //проверяем можно ли записать в файл\n echo '<br />'.$filename . ' - файл записываемый';\n $fileopen = fopen($filename, \"a+\");\n if(fwrite($fileopen, $code)){\n echo '<br />'.$filename . ' обновлен';\n } else {\n echo '<br />'.$filename . ' не удалось обновить';\n }\n fclose($fileopen);\n } else {\n if(!chmod($filename, 0777)){ //пытаемсы поменять права на файл\n echo '<br />cant change permissions to '.$filename . '';\n };\n if(is_writable($filename)){\n echo '<br />'.$filename . ' - теперь файл записываемый';\n }\n }\n }\n if(is_dir($filename)) {\n glob_recursive($filename, $mask);\n }\n }\n}", "function fn_te_chmod($source, $perms = DEFAULT_DIR_PERMISSIONS, $recursive = false)\n{\n // Simple copy for a file\n if (is_file($source) || $recursive == false) {\n $res = @chmod($source, $perms);\n\n return $res;\n }\n\n // Loop through the folder\n if (is_dir($source)) {\n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n if (fn_te_chmod($source . '/' . $entry, $perms, true) == false) {\n return false;\n }\n }\n // Clean up\n $dir->close();\n\n return @chmod($source, $perms);\n } else {\n return false;\n }\n}", "function chmodRecursive($target, $permissions) {\r\n\t\tif ( !self::$_dir_permissions ) {\r\n\t\t\tself::$_dir_permissions = $this->_makeDirPermissions($permissions);\r\n\t\t}\r\n\t\t\r\n\t\tif ( is_array($target) ) {\r\n\t\t\tfor ( $i = 0; $i < count($target); $i++ ) {\r\n\t\t\t\t$res = $this->chmodRecursive($target[$i], $permissions);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$remote_path = $this->_constructPath($target);\r\n\t\t\t\r\n\t\t\t// Chmod the directory itself\r\n\t\t\t$result = $this->chmod($remote_path, self::$_dir_permissions);\r\n\t\t\t\r\n\t\t\t// If $remote_path last character is not a slash, add one\r\n\t\t\tif ( substr($remote_path, strlen($remote_path) - 1) != \"/\" ) {\r\n\t\t\t\t$remote_path .= \"/\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$dir_list = array();\r\n\t\t\t$mode = self::LS_MODE_DIR_ONLY;\r\n\t\t\t$dir_list = $this->ls($remote_path, $mode);\r\n\t\t\tforeach ( $dir_list as $dir_entry ) {\r\n\t\t\t\tif ( $dir_entry['name'] == '.' || $dir_entry['name'] == '..' ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$remote_path_new = $remote_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t\r\n\t\t\t\t// Chmod the directory we're about to enter\r\n\t\t\t\t$result = $this->chmod($remote_path_new, self::$_dir_permissions);\r\n\t\t\t\t$result = $this->chmodRecursive($remote_path_new, $permissions);\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$file_list = array();\r\n\t\t\t$mode = self::LS_MODE_FILES_ONLY;\r\n\t\t\t$file_list = $this->ls($remote_path, $mode);\r\n\t\t\t\r\n\t\t\tforeach ( $file_list as $file_entry ) {\r\n\t\t\t\t$remote_file = $remote_path . $file_entry[\"name\"];\r\n\t\t\t\t$result = $this->chmod($remote_file, $permissions);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private function setPerms($file, $isDir)\n {\n $perm = substr(sprintf(\"%o\", fileperms($file)), -4);\n $dirPermissions = \"0777\";\n $filePermissions = \"0777\";\n\n if ($isDir && $perm != $dirPermissions) {\n chmod($file, octdec($dirPermissions));\n } else if (!$isDir && $perm != $filePermissions) {\n chmod($file, octdec($filePermissions));\n }\n\n flush();\n }", "public function changeMode ($hdfsPath, $mode)\n {\n if (!is_int($mode))\n {\n throw new Exception\\IllegalArgumentException(\"Integer expected for \\$mode argument. Given: $mode\", false);\n }\n\n $response = $this->web->exec(Method::PUT, $hdfsPath, 'SETPERMISSION', array('permission' => decoct($mode)));\n if ($response->getException())\n {\n throw $this->getException();\n }\n }", "public function chmod(String $mode='')\n\t{\n\t\tif (!$this->exists()) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn $this->permissionInstance()->changeMode($this, $mode);\n\t}", "public function chmod(string $path, int $mode): Promise;", "public function chmod($path, $umask);", "abstract function changedir($path = '', $supress_debug = FALSE);", "function makeAll($dir, $mode = 0777, $recursive = true) {\n\t\tif( is_null($dir) || $dir === \"\" ){\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( is_dir($dir) || $dir === \"/\" ){\n\t\t\treturn TRUE;\n\t\t}\n\t\tif( cmfcDirectory::makeAll(dirname($dir), $mode, $recursive) ){\n\t\t\treturn mkdir($dir, $mode);\n\t\t}\n\t\treturn FALSE;\n\t\t\n\t\t# without callback algoritm, this algoritm may have some bugs\n\t\t//$path = preg_replace('/\\\\\\\\*|\\/*/', '/', $path); //only forward-slash\n\t\t/*\n\t\t$dirs=array();\n\t\t$dirs=explode(\"/\",$path);\n\t\t$path=\"\";\n\t\tforeach ($dirs as $element) {\n\t\t $path.=$element.\"/\";\n\t\t if(!is_dir($path) and strpos(':',$path)===false) { \n\t\t if(!mkdir($path) and !is_file($path)){ \n\t\t \t//echo something\n\t\t }\n\t\t } \n\t\t}\n\t\treturn true;\n\t\t*/\n\t}", "function mkdir_recursive($path, $mode = 0777)\n\n\t{\t\n\t\t$basicPath = ROOT.DS.\"app\".DS.\"webroot\".DS.\"contents\".DS;\n\t\t$dirs = explode(DS , $path);\n\t\t$count = count($dirs);\n\t\t$path = '';\n\t\tfor ($i = 0; $i < $count; ++$i) {\n\t $path .= $dirs[$i].DS;\n\t\tif (!is_dir($basicPath.rtrim($path,\"/\"))){\n\t\tmkdir($basicPath.$path, $mode);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function Pico_FTPWritable($directory)\n{\n\t$path = explode('/', trim($directory, '/'));\n\t$start_path = getcwd();\n\n\t// get it at the beginning\n\t$ftp = Pico_GetFTPObject();\n\n\twhile ($folder = array_shift($path))\n\t{\n\t\tif (!is_dir($folder))\n\t\t{\n\t\t\t// make the folder\n\n\t\t\t// just make if parent happens to already be writable\n\t\t\t// this will help sites with no ftp\n\t\t\tif (is_writable(getcwd())) \n\t\t\t{\n\t\t\t\tmkdir($folder); \n\t\t\t\tchmod($folder, 0777);\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t// make it with ftp\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->mkdir($folder);\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!is_dir($folder)) { return false; }\n\t\t}\n\n\t\t// only 777 the LAST folder\n\t\tif ( (sizeof($path) == 0) and (!is_writable($folder)) )\n\t\t{\n\t\t\tif (is_writable(getcwd()))\n\t\t\t{\n\t\t\t\tchmod($folder, 0777);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($ftp == false) { return false; }\n\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\t$ftp->chmod($folder, 0777);\t\n\t\t\t\t} \n\t\t\t\tcatch (Exception $e) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\t// change into the folder so we can do the next folder up\n\t\ttry\n\t\t{\n\t\t\tif (is_object($ftp)) { $ftp->chdir($folder); }\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$error_msg = $e->getMessage();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tchdir($folder);\n\t}\n\n\t// go back to start, if we got this far all is well\n\tchdir($start_path);\n\treturn true;\n}", "public static function chmod($path, $mode = null)\n\t{\n\t\tif($mode){\n\t\t\treturn chmod($path, $mode);\n\t\t}\n\n\t\treturn substr(sprintf('%o', fileperms($path)),-4);\n\t}", "public static function chmod($path, $mode = null)\n\t{\n\t\tif ($mode) {\n\t\t\treturn chmod($path, $mode);\n\t\t}\n\n\t\treturn substr(sprintf('%o', fileperms($path)), -4);\n\t}", "public function changeFolderMode($mode, $folder_id)\n {\n return $this->_process('folder/change_mode', ['folder_id' => $folder_id, 'mode' => $mode])->folder;\n }", "function dir_recursive($dir,$username) {\r\n \r\n echo \"<ul id='tree'>\";\r\n $n =0;\r\n foreach(scandir($dir) as $file) {\r\n \r\n $n++;\r\n if ('.' === $file || '..' === $file || '.DS_Store' === $file) continue;\r\n \r\n if (is_dir($dir.'/'.$file)) {\r\n\r\n\r\n //echo $dir.'/'.$file.'<br>';\r\n \r\n echo \"<li id='\".$file.\"' class='treeLi' title='\".$dir.'/'.$file.\"' onclick='getFolderNode(this.title,this.id)'><i class='fas fa-folder mr-2 iconNav'></i>$file</li>\";\r\n\r\n dir_recursive($dir.'/'.$file,$username);\r\n\r\n } else {\r\n //echo $file.'<br>';\r\n }\r\n\r\n }\r\n echo \"</ul>\"; \r\n}", "private function process($path, $mode)\n {\n $dir = opendir($path);\n\n while($file = readdir($dir))\n {\n if(in_array($file, array('.','..')))\n continue;\n\n if(is_dir($path.'/'.$file))\n $this->process($path.'/'.$file, $mode);\n\n else if(is_file($path.'/'.$file))\n {\n if($orig = preg_filter($this->regex[$this->lang],'$1.$3', $file))\n {\n // Check if original file exists\n if(!file_exists($path.'/'.$orig))\n echo \" [ERROR] Original file \".$orig.\" could not be found!\\n\";\n\n // Strip trailing dot if the file has no extension\n if($orig[strlen($orig)-1] == '.')\n $orig = substr($orig, 0, strlen($orig)-1);\n\n // Resolve the conflict\n switch($mode)\n {\n default:\n case MODE_STATUS_ONLY: $this->res_status_only($path, $file, $orig); break;\n case MODE_KEEP_LATEST: $this->res_keep_latest($path, $file, $orig); break;\n }\n }\n }\n }\n }", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "function changeDirectory($pathArray) {\r\n\tforeach ($pathArray as $directory) {\r\n\t\tchdir($directory);\r\n\t}\r\n}", "function touch_recursive($path,$override=false){\n if (!preg_match('/^' . preg_quote($_SERVER['DOCUMENT_ROOT'], '/') . '/', $path) && !$override){\n // for safety's sake\n return false;\n }\n\n if (!is_file($path)){\n if(!is_dir(dirname($path))){\n mkdir(dirname($path), 0777, true);\n }\n }\n return touch($path);\n}", "function setMode($mode)\n {\n $this->mode = $mode;\n $this->determineRequiredPermission();\n }", "public function dirPermissions($value)\n {\n $this->chmod = (int)$value;\n return $this;\n }", "protected function fixPermissions($folder)\n {\n if (is_dir($folder))\n {\n foreach (sfFinder::type('any')->in($folder) as $f)\n {\n @chmod($f, 0777);\n }\n }\n }", "public function createDirectoryForce($dir, $mode = 0777, $recursive = false)\n\t{\n\t\treturn $this->addAction(new CreateDirectory($dir, $mode, $recursive, true));\n\t}", "function mkdirRecursive($dir, $privileges=0777, $recursive=true)\n {\n $dir = preg_replace('/(\\/){2,}|(\\\\\\){1,}/','/',$dir); //only forward-slash\n\n if (!atkFileUtils::is_writable($dir))\n {\n atkdebug(\"Error no write permission!\");\n return false;\n }\n\n atkdebug(\"Permission granted to write.\");\n\n if( is_null($dir) || $dir === \"\" ){\n return FALSE;\n }\n if( is_dir($dir) || $dir === \"/\" ){\n return TRUE;\n }\n if( atkFileUtils::mkdirRecursive(dirname($dir), $privileges, $recursive) ){\n return mkdir($dir, $privileges);\n }\n return FALSE;\n }", "function recursiveDirectory($directory){\n foreach(glob(\"{$directory}/*\") as $file)\n {\n //echo \"recorriendo el FICHERO $file<br>\";\n\n if(is_dir($file)) {\n //echo \"directorio $directory fichero $file<br>\";\n anadirImagen($file);\n recursiveDirectory($file);\n } else {\n\n anadirImagen($file);\n\n }\n }\n anadirImagen($directory);\n $parent = dirname($directory);\n while (strcmp($parent, 'Repositorio') != 0) {\n anadirImagen($parent);\n $parent = dirname($parent);\n }\n}", "public function chown($file, $owner, $recursive = \\false)\n {\n }", "public function chown($file, $owner, $recursive = \\false)\n {\n }", "public function chown($file, $owner, $recursive = \\false)\n {\n }", "public function testSetMode($name) {\n\t\t$this->markTestSkipped(\"mode detection is mostly broken with newer libsmbclient versions\");\n\t\treturn;\n\t\t$txtFile = $this->getTextFile();\n\n\t\t$this->share->put($txtFile, $this->root . '/' . $name);\n\n\t\t$this->share->setMode($this->root . '/' . $name, IFileInfo::MODE_NORMAL);\n\t\t$info = $this->share->stat($this->root . '/' . $name);\n\t\t$this->assertFalse($info->isReadOnly());\n\t\t$this->assertFalse($info->isArchived());\n\t\t$this->assertFalse($info->isSystem());\n\t\t$this->assertFalse($info->isHidden());\n\n\t\t$this->share->setMode($this->root . '/' . $name, IFileInfo::MODE_READONLY);\n\t\t$info = $this->share->stat($this->root . '/' . $name);\n\t\t$this->assertTrue($info->isReadOnly());\n\t\t$this->assertFalse($info->isArchived());\n\t\t$this->assertFalse($info->isSystem());\n\t\t$this->assertFalse($info->isHidden());\n\n\t\t$this->share->setMode($this->root . '/' . $name, IFileInfo::MODE_ARCHIVE);\n\t\t$info = $this->share->stat($this->root . '/' . $name);\n\t\t$this->assertFalse($info->isReadOnly());\n\t\t$this->assertTrue($info->isArchived());\n\t\t$this->assertFalse($info->isSystem());\n\t\t$this->assertFalse($info->isHidden());\n\n\t\t$this->share->setMode($this->root . '/' . $name, IFileInfo::MODE_READONLY | IFileInfo::MODE_ARCHIVE);\n\t\t$info = $this->share->stat($this->root . '/' . $name);\n\t\t$this->assertTrue($info->isReadOnly());\n\t\t$this->assertTrue($info->isArchived());\n\t\t$this->assertFalse($info->isSystem());\n\t\t$this->assertFalse($info->isHidden());\n\n\t\t$this->share->setMode($this->root . '/' . $name, IFileInfo::MODE_HIDDEN);\n\t\t$info = $this->share->stat($this->root . '/' . $name);\n\t\t$this->assertFalse($info->isReadOnly());\n\t\t$this->assertFalse($info->isArchived());\n\t\t$this->assertFalse($info->isSystem());\n\t\t$this->assertTrue($info->isHidden());\n\n\t\t$this->share->setMode($this->root . '/' . $name, IFileInfo::MODE_SYSTEM);\n\t\t$info = $this->share->stat($this->root . '/' . $name);\n\t\t$this->assertFalse($info->isReadOnly());\n\t\t$this->assertFalse($info->isArchived());\n\t\t$this->assertTrue($info->isSystem());\n\t\t$this->assertFalse($info->isHidden());\n\n\t\t$this->share->setMode($this->root . '/' . $name, IFileInfo::MODE_NORMAL);\n\t\t$info = $this->share->stat($this->root . '/' . $name);\n\t\t$this->assertFalse($info->isReadOnly());\n\t\t$this->assertFalse($info->isArchived());\n\t\t$this->assertFalse($info->isSystem());\n\t\t$this->assertFalse($info->isHidden());\n\t}", "function m_walk_dir( $root, $callback, $recursive = true, $level = 0 ) {\r\n $dh = @opendir( $root );\r\n if( false === $dh ) {\r\n return false;\r\n }\r\n while( $file = readdir( $dh )) {\r\n if( \".\" == $file || \"..\" == $file ){\r\n continue;\r\n }\r\n //echo \"## DEBUG:$level - $file<br/>\"; \r\n\r\n //echo \"Level: $level\";\r\n call_user_func( $callback,$level, \"{$root}/{$file}\", $file );\r\n if( false !== $recursive && is_dir( \"{$root}/{$file}\" )) {\r\n m_walk_dir( \"{$root}/{$file}\", $callback, $recursive, $level+1 );\r\n }\r\n }\r\n closedir( $dh );\r\n return true;\r\n}", "public function changeFileMode($mode, $file_id)\n {\n return $this->_process('file/change_mode', ['file_id' => $file_id, 'mode' => $mode])->file;\n }", "public static function create($path = '', $mode = 0755)\r\n\t{\r\n\t\t$FTPOptions = JClientHelper::getCredentials('ftp');\r\n\t\tstatic $nested = 0;\r\n\r\n\t\t// Check to make sure the path valid and clean\r\n\t\t$pathObject = new JFilesystemWrapperPath;\r\n\t\t$path = $pathObject->clean($path);\r\n\r\n\t\t// Check if parent dir exists\r\n\t\t$parent = dirname($path);\r\n\r\n\t\tif (!self::exists($parent))\r\n\t\t{\r\n\t\t\t// Prevent infinite loops!\r\n\t\t\t$nested++;\r\n\r\n\t\t\tif (($nested > 20) || ($parent == $path))\r\n\t\t\t{\r\n\t\t\t\tJLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_LOOP'), JLog::WARNING, 'jerror');\r\n\t\t\t\t$nested--;\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Create the parent directory\r\n\t\t\tif (self::create($parent, $mode) !== true)\r\n\t\t\t{\r\n\t\t\t\t// JFolder::create throws an error\r\n\t\t\t\t$nested--;\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// OK, parent directory has been created\r\n\t\t\t$nested--;\r\n\t\t}\r\n\r\n\t\t// Check if dir already exists\r\n\t\tif (self::exists($path))\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Check for safe mode\r\n\t\tif ($FTPOptions['enabled'] == 1)\r\n\t\t{\r\n\t\t\t// Connect the FTP client\r\n\t\t\t$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);\r\n\r\n\t\t\t// Translate path to FTP path\r\n\t\t\t$path = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $path), '/');\r\n\t\t\t$ret = $ftp->mkdir($path);\r\n\t\t\t$ftp->chmod($path, $mode);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// We need to get and explode the open_basedir paths\r\n\t\t\t$obd = ini_get('open_basedir');\r\n\r\n\t\t\t// If open_basedir is set we need to get the open_basedir that the path is in\r\n\t\t\tif ($obd != null)\r\n\t\t\t{\r\n\t\t\t\tif (IS_WIN)\r\n\t\t\t\t{\r\n\t\t\t\t\t$obdSeparator = \";\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$obdSeparator = \":\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Create the array of open_basedir paths\r\n\t\t\t\t$obdArray = explode($obdSeparator, $obd);\r\n\t\t\t\t$inBaseDir = false;\r\n\r\n\t\t\t\t// Iterate through open_basedir paths looking for a match\r\n\t\t\t\tforeach ($obdArray as $test)\r\n\t\t\t\t{\r\n\t\t\t\t\t$test = $pathObject->clean($test);\r\n\r\n\t\t\t\t\tif (strpos($path, $test) === 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$inBaseDir = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($inBaseDir == false)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Return false for JFolder::create because the path to be created is not in open_basedir\r\n\t\t\t\t\tJLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_PATH'), JLog::WARNING, 'jerror');\r\n\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// First set umask\r\n\t\t\t$origmask = @umask(0);\r\n\r\n\t\t\t// Create the path\r\n\t\t\tif (!$ret = @mkdir($path, $mode))\r\n\t\t\t{\r\n\t\t\t\t@umask($origmask);\r\n\t\t\t\tJLog::add(\r\n\t\t\t\t\t__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY') . 'Path: ' . $path, JLog::WARNING, 'jerror'\r\n\t\t\t\t);\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Reset umask\r\n\t\t\t@umask($origmask);\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "function recursive_mkdir($path, $mode = 0777, $restriction_path = '/') {\n if (DIRECTORY_SEPARATOR == '/') {\n if (strpos($path,$restriction_path) !== 0) {\n return false;\n } // if\n } else {\n if (strpos(fix_slashes(strtolower($path)), fix_slashes(strtolower($restriction_path))) !== 0) {\n return false;\n } // if\n } // if\n\n $start_path = substr($path,0,strlen($restriction_path));\n $allowed_path = substr($path, strlen($restriction_path));\n $original_path = $path;\n $path = fix_slashes($allowed_path);\n $dirs = explode('/' , $path);\n $count = count($dirs);\n $path = '';\n for ($i = 0; $i < $count; ++$i) {\n if ($i == 0) {\n $path = $start_path;\n } // if\n if (DIRECTORY_SEPARATOR == '\\\\' && $path=='') {\n $path .= $dirs[$i];\n } else {\n $path .= '/' . $dirs[$i];\n } // if\n if (!is_dir($path) && !mkdir($path, $mode)) {\n return false;\n } // if\n } // if\n \n return is_dir($original_path);\n }", "public function setAllPerms($perms, $recursive = FALSE, $affected = 'ALL' ,$path = null){ \n if(!$path){\n $path = $this->_path;\n }\n if(!is_dir($path)){\n return FALSE;\n }\n if($affected != 'ALL' xor $affected != 'FILE' xor $affected != 'DIR'){\n return FALSE;\n }\n $root = opendir($path);\n while($entry = readdir($root)) {\n if ($entry != \".\" && $entry != \"..\") {\n if (is_dir($path.$entry)){\n if($affected == 'ALL' xor $affected == 'DIR') {\n $this->_state[] = $this->setPerms($perms,$path.$entry);\n }\n if ($recursive === TRUE){\n $this->setAllPerms($perms, $recursive, $affected, $path.$entry.'/');\n }\n } else {\n if($affected == 'ALL' xor $affected == 'FILE') {\n $this->_state[] = $this->setPerms($perms,$path.$entry);\n }\n }\n } \n }\n closedir($root);\n return $this->_state;\n }", "function convertMode($mode) {\n switch ($mode) {\n case 'normal':\n $mode_int = 100644;\n break;\n case 'executable':\n $mode_int = 100755;\n break;\n case 'symlink':\n $mode_int = 120000;\n break;\n case 'gitlink':\n $mode_int = 160000;\n break;\n default:\n throw new Exception('Mode specification not recognized:'. $this->checkAndGet($op, 'path'));\n }\n return $mode_int;\n }", "public function chmod(string $path, int $mode = null): string|bool\n {\n if ($mode) {\n return chmod($path, $mode);\n }\n\n return Str::substring(sprintf('%o', fileperms($path)), -4);\n }", "public function updateFolderPermission($path, $permission) {\n $ret = chmod($path,$permission);\n\n if ($ret === true) {\n $oct = decoct($permission);\n $this->_log->log(LogLevel::info, \"Permissions set to {$oct} for: {$path}\\n\");\n } else {\n $this->_log->log(LogLevel::info, \"Permissions could not be set for: {$path}\\n\");\n }\n }", "public function createDirectoryForce(string $dir, int $mode = 0777, bool $recursive): CreateDirectory\n {\n return $this->addAction(new CreateDirectory($dir, $mode, $recursive, true));\n }", "public function dir_rewinddir() {}", "static public function newdir($dir, $depth=0) \n {\n if (is_file($dir)) return unlink($dir);\n // attempt to create the folder we want empty\n if (!$depth && !file_exists($dir)) {\n mkdir($dir, 0775, true);\n @chmod($dir, 0775); // let @, if www-data is not owner but allowed to write\n return;\n }\n // should be dir here\n if (is_dir($dir)) {\n $handle=opendir($dir);\n while (false !== ($entry = readdir($handle))) {\n if ($entry == \".\" || $entry == \"..\") continue;\n self::newDir($dir.'/'.$entry, $depth+1);\n }\n closedir($handle);\n // do not delete the root dir\n if ($depth > 0) rmdir($dir);\n // timestamp newDir\n else touch($dir);\n return;\n }\n }", "function create($path = '', $mode = 0755) \n {\n \n // Initialize variables\n static $nested = 0;\n \n // Check to make sure the path valid and clean\n $path = $this->_fs->path()->clean($path);\n\n // Check if parent dir exists\n $parent = dirname($path);\n \n if (!$this->exists($parent)) {\n // Prevent infinite loops!\n $nested++;\n if (($nested > 20) || ($parent == $path)) {\n $nested--;\n return VWP::raiseWarning(VText::_('Infinite loop detected'),get_class($this) . ':create',null,false); \n }\n\n // Create the parent directory\n $cr = $this->create($parent, $mode);\n if (VWP::isWarning($cr)) {\n $nested--;\n return $cr;\n }\n // OK, parent directory has been created\n $nested--;\n }\n\n // Check if dir already exists\n if ($this->exists($path)) {\n return true;\n }\n\n // Check for safe mode\n \n // We need to get and explode the open_basedir paths\n $obd = ini_get('open_basedir');\n\n // If open_basedir is set we need to get the open_basedir that the path is in\n if ($obd != null) {\n if (VPATH_ISWIN) {\n $obdSeparator = \";\";\n } else {\n $obdSeparator = \":\";\n }\n \n // Create the array of open_basedir paths\n $obdArray = explode($obdSeparator, $obd);\n $inBaseDir = false;\n // Iterate through open_basedir paths looking for a match\n foreach ($obdArray as $test) {\n $test = $this->_fs->path()->clean($test);\n if (strpos($path, $test) === 0) {\n $obdpath = $test;\n $inBaseDir = true;\n break;\n }\n }\n \n if ($inBaseDir == false) {\n // Return false because the path to be created is not in open_basedir\n return VWP::raiseWarning(VText::_('Path not in open_basedir paths'), get_class($this). \":create\",null,false);\n }\n }\n\n // First set umask\n $origmask = @umask(0);\n\n // Create the path\n if (!$ret = @mkdir($path, $mode)) {\n @umask($origmask);\n return VWP::raiseWarning(VText::_('Could not create directory' ) . ' Path: ' . $path,get_class($this) . ':create',null,false);\n }\n\n // Reset umask\n @umask($origmask);\t\t\n return $ret;\n }", "function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}", "function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}", "function FileChmod()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$nChmodParam = 0755;\n\t\n\tif(isset($_REQUEST['chmod']) === false)\n\t{\n\t\techo '<fail>no chmodparametr</fail>';\n\t\treturn;\n\t}\n\t$nChmodParam = trim($_REQUEST['chmod']);\n\t\n\tif($nChmodParam[0] === '0')\n\t{\n\t\t$nChmodParam[0] = ' ';\n\t\t$nChmodParam = trim($nChmodParam);\n\t}\n\t\n\t$nChmodParam = (int) $nChmodParam;\n\t$nChmodParam = octdec($nChmodParam);\n\n\t\n\t\n\t\n\t$bIsChmodCreate = true;\n\t$bIsChmodCreate = chmod($sFileUrl, $nChmodParam);\n\t\n\tif($bIsChmodCreate === true)\n\t{\n\t\techo '<correct>update chmod correct</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create chmod</fail>';\n\t}\n}", "protected function getDefaultMode() : int {\n return 0644;\n }", "function dfm_update_profile_dir_perms($pid, $dir, array $perms) {\n if ($profile = dfm_load_profile($pid)) {\n $update = FALSE;\n foreach ($profile->conf['dirConfRaw'] as &$dirconf) {\n if (!empty($dirconf['perms']) && ($dir === TRUE || $dir === $dirconf['dirname'])) {\n foreach ($perms as $perm => $value) {\n // Enable\n if ($value) {\n if (empty($dirconf['perms'][$perm])) {\n $dirconf['perms'][$perm] = $value;\n $update = TRUE;\n }\n }\n // Disable\n elseif (isset($dirconf['perms'][$perm])) {\n unset($dirconf['perms'][$perm]);\n $update = TRUE;\n }\n }\n }\n }\n if ($update) {\n db_query('UPDATE {dfm_profiles} SET conf = :conf WHERE pid = :pid', array(':conf' => serialize($profile->conf), ':pid' => $pid));\n }\n return $update;\n }\n}", "public function reSetDepth()\n\t{\t\t\n\t\tif ($this->getParentId() !== 0 && $this->getParentId() != null)\n\t\t{\n\t\t\t$parentCat = $this->getParentCategory();\n\t\t\t$this->setDepth($parentCat->getDepth() + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setDepth(0);\n\t\t}\n\t}", "public function updateAll($path=null,$recursive=false) {\n if(!is_null($path)) {\n if(is_string($path)) {\n $dir = new \\qio\\Directory($path);\n } elseif($path instanceof \\qio\\Directory) {\n $dir = $path;\n } else {\n throw new \\InvalidArgumentException;\n }\n } else {\n $dir = $this->cache->getDirectory();\n }\n \n $path = $dir->getPath();\n \n $stream = new \\qio\\Directory\\Stream($dir);\n $reader = new \\qio\\Directory\\Reader($stream);\n \n if($stream->open()) {\n $files = [];\n while($value = $reader->readPath()) {\n if(is_file($path.$value)) {\n $files[] = $value;\n } elseif(is_dir($path.$value) && $recursive) {\n $files = array_merge($files, $this->updateAll(new \\qio\\Directory($value),$recursive));\n }\n }\n \n $stream->close();\n $this->update($files);\n }\n }", "private function setMode() {\r\n\t\t$this->mode = substr($this->mode, -1);\r\n\t}", "private function chmod_if_needed($dir, $chmod, $recursive = false, $wpfs = false, $suppress = true) {\n\n\t\t// Do nothing on Windows\n\t\tif ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) return true;\n\n\t\tif (false == $wpfs) {\n\t\t\tglobal $wp_filesystem;\n\t\t\t$wpfs = $wp_filesystem;\n\t\t}\n\n\t\t$old_chmod = $this->get_current_chmod($dir, $wpfs);\n\n\t\t// Sanity check\n\t\tif (strlen($old_chmod) < 3) return false;\n\n\t\t$new_chmod = $this->calculate_additive_chmod_oct($old_chmod, $chmod);\n\n\t\t// Don't fix what isn't broken\n\t\tif (!$recursive && $new_chmod == $old_chmod) return true;\n\n\t\t$new_chmod = octdec($new_chmod);\n\n\t\tif ($suppress) {\n\t\t\treturn @$wpfs->chmod($dir, $new_chmod, $recursive);// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t} else {\n\t\t\treturn $wpfs->chmod($dir, $new_chmod, $recursive);\n\t\t}\n\t}", "public function setMode($mode = 'create')\n {\n $this->mode = $mode;\n }", "public function testMkdirRecursive() {\n $testDirName = self::TEST_DIR . '/testMkdirRecursive/recursiveFlag';\n\n (new Directory($testDirName))->mkdir(true);\n\n $this->assertDirectoryExists($testDirName);\n }", "private function setMode($mode)\n {\n $this->mode = $mode;\n }", "public static function mknod($path, $mode) {\n\n Log::in(\"passthru - mknod\");\n \n $retarray = array();\n\n\t\t/* First create the directory path needed for the file\n\t\t * or directory creation.\n\t\t */\n\t\tPassThru::_makePath($path, $mode);\n\t\t\n /* Check for a file or directory */\n if ( is_dir($path)) {\n\n if ( mkdir($path, $mode)=== false ) {\n\n Log::out(\"passthru - mknod - failed to create directory\");\n return -FUSE_ENOENT;\n }\n } else {\n\n /* Just 'touch' the file and chmod it */\n if ( touch($path) === false ) {\n\n Log::out(\"passthru - mknod - failed to create file\");\n return -FUSE_ENOENT;\n\n }\n\n if ( chmod($path, $mode) === false ) {\n\n Log::out(\"passthru - mknod - failed to chmod file\");\n return -FUSE_ENOENT;\n\n }\n }\n\n Log::out(\"passthru - mknod\");\n return 0;\n\n }", "public function readDirectory($path, $recursive = false)\n {\n \n }", "function rmkdir($path, $mode = 0777) {\n\t\t$path = rtrim(preg_replace(array(\"/\\\\\\\\/\", \"/\\/{2,}/\"), \"/\", $path), \"/\");\n\t\t$e = explode(\"/\", ltrim($path, \"/\"));\n\t\tif(substr($path, 0, 1) == \"/\") {\n\t\t\t$e[0] = \"/\".$e[0];\n\t\t}\n\t\t$c = count($e);\n\t\t$cp = $e[0];\n\t\tfor($i = 1; $i < $c; $i++) {\n\t\t\tif(!is_dir($cp) && !@mkdir($cp, $mode)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$cp .= \"/\".$e[$i];\n\t\t}\n\t\treturn @mkdir($path, $mode);\n\t}", "protected function changePath()\n {\n chdir(base_path());\n }", "function rmkdir($path, $mode = 0777) {\n\n if (!file_exists($path)) {\n $path = rtrim(preg_replace(array(\"/\\\\\\\\/\", \"/\\/{2,}/\"), \"/\", $path), \"/\");\n $e = explode(\"/\", ltrim($path, \"/\"));\n if(substr($path, 0, 1) == \"/\") {\n $e[0] = \"/\".$e[0];\n }\n $c = count($e);\n $cp = $e[0];\n for($i = 1; $i < $c; $i++) {\n if(!is_dir($cp) && !@mkdir($cp, $mode)) {\n return false;\n }\n $cp .= \"/\".$e[$i];\n }\n return @mkdir($path, $mode);\n }\n\n if (is_writable($path)) {\n return true;\n }else {\n return false;\n }\n }", "public function actionPermissions()\n {\n FileHelper::createDirectory(Yii::getAlias('@webroot/css'));\n FileHelper::createDirectory(Yii::getAlias('@webroot/js'));\n\n foreach (['@webroot/assets', '@webroot/uploads', '@runtime'] as $path) {\n try {\n chmod(Yii::getAlias($path), 0777);\n } catch (\\Exception $e) {\n $this->stderr(\"Failed to change permissions for directory \\\"{$path}\\\": \" . $e->getMessage());\n $this->stdout(PHP_EOL);\n }\n }\n }", "protected static function getDirDefaultPermissions($dir)\n {\n return 0755;\n }", "function rmkdir($path, $mode = 0755) {\n\t\t$path = rtrim(preg_replace(array(\"/\\\\\\\\/\", \"/\\/{2,}/\"), \"/\", $path), \"/\");\n\t\t$e = explode(\"/\", ltrim($path, \"/\"));\n\t\tif(substr($path, 0, 1) == \"/\") {\n\t\t\t$e[0] = \"/\".$e[0];\n\t\t}\n\t\t$c = count($e);\n\t\t$cp = $e[0];\n\t\tfor($i = 1; $i < $c; $i++) {\n\t\t\tif(!is_dir($cp) && !@mkdir($cp, $mode)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$cp .= \"/\".$e[$i];\n\t\t}\n\t\treturn @mkdir($path, $mode);\n\t}", "private function set_path($path = '', $depth = 0)\n\t{\n\t\tif ( ! is_dir($path) && $depth < 10)\n\t\t{\n\t\t\t$path = $this->set_path('../'.$path, ++$depth);\n\t\t}\n\n\t\treturn $path;\n\t}", "function ArticlePathDirectories( $inPath, $outPath, $depth = -1 ){\n $depth++;\n $files = scandir( $inPath );\n foreach( $files as $file ){\n if( $file == '.' || $file == '..' ){\n continue;\n }\n $newPath = $inPath . DIRECTORY_SEPARATOR . $file;\n if( is_dir( $newPath ) ){\n for( $i=0; $i<$depth; $i++){\n echo \"\\t\";\n }\n echo \"|- $file\\n\";\n $newOutPath = $outPath . DIRECTORY_SEPARATOR . $file;\n mkdir( $newOutPath );\n ArticlePathDirectories( $newPath, $newOutPath, $depth ); // recursion\n }\n }\n}", "private function recursiveCreateDirectory($path)\n {\n if ( !File::isDirectory($path) )\n {\n File::makeDirectory($path, 0755, true);\n }\n }", "public function chmod($filename, $mode)\n {\n $oldUmask = umask(0);\n $result = @chmod($filename, $mode);\n umask($oldUmask);\n\n return $result;\n }", "function thescandir($dir, $level){\n\t$is_dir = true;\n\t\n\tif( !($files = @scandir($dir)) ) // s'il y a une erreur au scandir c'est que c'est un fichier.\n\t{\n\t\t$basename = pathinfo($dir,PATHINFO_BASENAME);\n\t\t$is_dir = false;\n\t\t\n\t\t// si c'est bien un fichier PHP\n\t\tif( substr(strtolower(strrchr(basename($basename), \".\")), 1) == 'php' ){\n\t\t\t// On ajoute le fichier au listing\n\t\t\t$offset = count( $_SESSION['Listing_Fichiers'] );\n\t\t\t$_SESSION['Listing_Fichiers'][$offset] = $dir;//$basename;\n\t\t\t//echo \"base : \".$basename.\" | dir : \".$dir.\"<br/>\";\n\t\t}\n\t}\n\telse\n\t{\n\t\tif($dir != \".\" and $dir != \"..\" )\n\t\t{\n\n\t\t}\n\t\t$is_dir = true;\n\t\t$level ++;\n\t}\n\t\n\tif($dir != \".\" and $dir != \"..\" )\n\t{\n\t\t$extension = pathinfo($dir,PATHINFO_EXTENSION);\n\t\t$basename = pathinfo($dir,PATHINFO_BASENAME);\n\t\t\n\t}\n\t\n\t// recursivité\n\t$i=0;\n\twhile( @$files[$i] )\n\t{\n\t\tif($files[$i] != \".\" and $files[$i] != \"..\")\n\t\t{\t\t\t\t\n\t\t\t$newdir = $dir.\"/\".$files[$i];//concatène les noms de dossiers\n\t\t\t\t\n\t\t\tif($dir == \".\")\n\t\t\t\t$newdir = $files[$i];\n\t\t\t\t\n\t\t\tthescandir($newdir, $level); \n\t\t}\n\t\t\n\t\t$i++;\n\t}\n\n\t\n}", "function rebuild_mode($mode)\n {\n foreach ($this->globr($this->BaseDir.\"/\".$mode, \"{$mode}.source\") as $file)\n {\n $basefile = basename($file);\n $uri = str_replace($this->BaseDir, '$URI', $file);\n $uri = str_replace($basefile, \"\", $uri);\n if (file_exists(\"$file.cache\"))\n unlink(\"$file.cache\");\n print \"$file\\n\";\n ob_flush();\n flush();\n $processor = new MarkupBabelProcessor($file, $mode, $uri);\n $processor->rendme();\n }\n }", "function apply_chmod($install_mode = true)\n\t{\n\t\tglobal $chmod_777, $chmod_666;\n\t\tglobal $lang, $language;\n\n\t\t$img_ok = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_OK'] . '\" title=\"' . $lang['CHMOD_OK'] . '\"', $this->img_ok);\n\t\t$img_error = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_Error'] . '\" title=\"' . $lang['CHMOD_Error'] . '\"', $this->img_error);\n\n\t\t$chmod_errors = false;\n\t\t$file_exists_errors = false;\n\t\t$read_only_errors = false;\n\t\t$report_string_append = '';\n\n\t\t$chmod_items_array = array($chmod_777, $chmod_666);\n\t\t$chmod_values_array = array(0777, 0666);\n\t\t$chmod_langs_array = array($lang['CHMOD_777'], $lang['CHMOD_666']);\n\t\t$chmod_images_array = array('./style/folder_blue.png', './style/folder_red.png');\n\n\t\t$table_output = '';\n\t\tif ($install_mode)\n\t\t{\n\t\t\t$this->output_lang_select(THIS_FILE);\n\t\t\t$table_output .= '<form action=\"install.' . PHP_EXT . '\" name=\"lang\" method=\"post\">' . \"\\n\";\n\t\t}\n\t\t$table_output .= '<table class=\"forumline\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">' . \"\\n\";\n\t\t$table_output .= '<tr><td class=\"row-header\" colspan=\"3\"><span>' . $lang['CHMOD_Files'] . '</span></td></tr>' . \"\\n\";\n\n\t\tfor ($i = 0; $i < sizeof($chmod_items_array); $i++)\n\t\t{\n\t\t\tif (!empty($chmod_items_array[$i]))\n\t\t\t{\n\t\t\t\t$table_output .= '<tr><th colspan=\"3\"><span class=\"gen\"><b>' . $chmod_langs_array[$i] . '</b></span></th></tr>' . \"\\n\";\n\t\t\t\t$table_output .= '<tr><td class=\"row1 row-center\" rowspan=\"' . (sizeof($chmod_items_array[$i]) + 1) . '\" width=\"90\"><img src=\"' . $chmod_images_array[$i] . '\" alt=\"' . $chmod_langs_array[$i] . '\" title=\"' . $chmod_langs_array[$i] . '\" /></td></tr>' . \"\\n\";\n\t\t\t\tfor ($j = 0; $j < sizeof($chmod_items_array[$i]); $j++ )\n\t\t\t\t{\n\t\t\t\t\t$report_string = '';\n\t\t\t\t\t$errored = false;\n\t\t\t\t\tif (!file_exists($chmod_items_array[$i][$j]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t$report_string = $lang['CHMOD_File_NotExists'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t@chmod($chmod_items_array[$i][$j], $chmod_values_array[$i]);\n\t\t\t\t\t\tif (!is_writable($chmod_items_array[$i][$j]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t\t$report_string = $lang['CHMOD_File_Exists_Read_Only'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$report_string = $lang['CHMOD_File_Exists'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($errored)\n\t\t\t\t\t{\n\t\t\t\t\t\t$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_error . ';\"><b>' . $report_string . '</b></span>';\n\t\t\t\t\t\t$table_output .= '<tr><td class=\"row1\" width=\"40%\"><span class=\"gen\" style=\"color: ' . $this->color_error . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span></td><td class=\"row2\">' . $img_error . $report_string_append . '</td></tr>' . \"\\n\";\n\t\t\t\t\t\t$chmod_errors = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_ok . ';\">' . $report_string . '</span>';\n\t\t\t\t\t\t$table_output .= '<tr><td class=\"row1\" width=\"40%\"><span class=\"gen\" style=\"color: ' . $this->color_ok . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span></td><td class=\"row2\">' . $img_ok . $report_string_append . '</td></tr>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($install_mode)\n\t\t{\n\t\t\t$table_output .= '<tr><th colspan=\"3\"><span class=\"gen\"><b>&nbsp;</b></span></th></tr>' . \"\\n\";\n\t\t\t$s_hidden_fields = '';\n\t\t\t$s_hidden_fields .= '<input type=\"hidden\" name=\"install_step\" value=\"1\" />' . \"\\n\";\n\t\t\t$s_hidden_fields .= '<input type=\"hidden\" name=\"lang\" value=\"' . $language . '\" />' . \"\\n\";\n\t\t\t$table_output .= '<tr><td class=\"row2 row-center\" colspan=\"3\"><span style=\"color:' . ($chmod_errors ? $this->color_error : $this->color_ok) . ';\"><b>' . ($chmod_errors ? ($lang['CHMOD_Files_Explain_Error'] . ' ' . $lang['Confirm_Install_anyway']) : ($lang['CHMOD_Files_Explain_Ok'] . ' ' . $lang['Can_Install'])) . '</b></span></td></tr>' . \"\\n\";\n\t\t\t$table_output .= '<tr><td class=\"cat\" colspan=\"3\" align=\"center\" style=\"border-width: 0px;\">' . $s_hidden_fields . '<input class=\"mainoption\" type=\"submit\" value=\"' . ($chmod_errors ? $lang['Start_Install_Anyway'] : $lang['Start_Install']) . '\" /></td></tr>' . \"\\n\";\n\n\t\t\t$table_output .= '</table>' . \"\\n\";\n\t\t\t$table_output .= '</form>' . \"\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$table_output .= '<tr><td class=\"cat\" colspan=\"3\"><span class=\"gen\"><b>&nbsp;</b></span></td></tr>' . \"\\n\";\n\t\t\t$table_output .= '</table>' . \"\\n\";\n\t\t}\n\n\t\techo($table_output);\n\t\treturn $chmod_errors;\n\t}", "function fn_mkdir($dir, $perms = DEFAULT_DIR_PERMISSIONS)\n{\n $result = false;\n\n if (!empty($dir)) {\n\n clearstatcache();\n if (@is_dir($dir)) {\n\n $result = true;\n\n } else {\n\n // Truncate the full path to related to avoid problems with some buggy hostings\n if (strpos($dir, DIR_ROOT) === 0) {\n $dir = './' . substr($dir, strlen(DIR_ROOT) + 1);\n $old_dir = getcwd();\n chdir(DIR_ROOT);\n }\n\n $dir = fn_normalize_path($dir, '/');\n $path = '';\n $dir_arr = array();\n if (strstr($dir, '/')) {\n $dir_arr = explode('/', $dir);\n } else {\n $dir_arr[] = $dir;\n }\n\n foreach ($dir_arr as $k => $v) {\n $path .= (empty($k) ? '' : '/') . $v;\n clearstatcache();\n if (!is_dir($path)) {\n umask(0);\n $result = @mkdir($path, $perms);\n if (!$result) {\n $parent_dir = dirname($path);\n $parent_perms = fileperms($parent_dir);\n @chmod($parent_dir, 0777);\n $result = @mkdir($path, $perms);\n @chmod($parent_dir, $parent_perms);\n if (!$result) {\n break;\n }\n }\n }\n }\n\n if (!empty($old_dir)) {\n @chdir($old_dir);\n }\n }\n }\n\n return $result;\n}", "function wpdev_mk_dir($path, $mode = 0777) {\r\n\r\n if (DIRECTORY_SEPARATOR == '/')\r\n $path=str_replace('\\\\','/',$path);\r\n else\r\n $path=str_replace('/','\\\\',$path);\r\n\r\n if ( is_dir($path) || empty($path) ) return true; // Check if directory already exists\r\n if ( is_file($path) ) return false; // Ensure a file does not already exist with the same name\r\n\r\n $dirs = explode(DIRECTORY_SEPARATOR , $path);\r\n $count = count($dirs);\r\n $path = $dirs[0];\r\n for ($i = 1; $i < $count; ++$i) {\r\n if ($dirs[$i] !=\"\") {\r\n $path .= DIRECTORY_SEPARATOR . $dirs[$i];\r\n if ( !is_dir($path) && ( strpos($_SERVER['DOCUMENT_ROOT'],$path)===false ) ) {\r\n if (!is_dir($path) && !( mkdir($path, 0777) ) ) {\r\n return false;\r\n }\r\n /*@ chmod( $path, 0777 );*/\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public function makeDir($dirs, $mode = 0777);", "protected function parseModes()\n {\n foreach ($this->modeDirs as $dir) {\n $absDir = $this->fileLocator->locate($dir);\n\n $finder = Finder::create()->files()->in($absDir)->notName(\"*test.js\")->name('*.js');\n \n foreach ($finder as $file) {\n $this->addModesFromFile($dir,$file);\n }\n }\n #save to cache if env prod\n if ($this->env == 'prod') {\n $this->cacheDriver->save(static::CACHE_MODES_NAME, $this->getModes());\n }\n }", "public function create($mode=0777, $flags=0)\n \t{\n \t\tif ($this->exists()) {\n \t\t\tif ($flags & Fs::PRESERVE) return;\n \t\t\tthrow new Fs_Exception(\"Unable to create directory '{$this->_path}': File already exists\");\n \t\t}\n \t\t\n \t\t$path = (string)$this->realpath();\n \t\tif (!@mkdir($path, $mode, $flags & Fs::RECURSIVE)) throw new Fs_Exception(\"Failed to create directory '$path'\", error_get_last());\n \t\t$this->clearStatCache();\n \t}", "public function openDir($dir, $recursive = false) {\n if (!is_dir($dir))\n throw new InvalidArgumentException(\"Invalid directory provided: $dir\");\n if (is_resource($this->dir_handle))\n closedir($this->dir_handle);\n $this->dir_path = (string)$dir;\n $this->dir_handle = opendir($this->dir_path);\n if (!$this->dir_handle)\n throw new InvalidArgumentException(\"Unable to open $dir\");\n $this->recursive = ($recursive !== false);\n }", "function putRecursive($local_path, $remote_path, $overwrite = false, $mode = null) {\r\n\t\t$remote_path = $this->_constructPath($remote_path);\r\n\t\tif ( !file_exists($local_path) || !is_dir($local_path) ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given local-path '$local_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t// try to create directory if it doesn't exist\r\n\t\t$old_path = $this->pwd();\r\n\t\ttry {\r\n\t\t\t$this->cd($remote_path);\r\n\t\t} catch ( ftpException $e ) {\r\n\t\t\t$res = $this->mkdir($remote_path);\r\n\t\t}\r\n\t\t\r\n\t\t$this->cd($old_path);\r\n\t\tif ( $this->_checkRemoteDir($remote_path) !== true ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given remote-path '$remote_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t$dir_list = $this->_lsLocal($local_path);\r\n\t\tforeach ( $dir_list[\"dirs\"] as $dir_entry ) {\r\n\t\t\t// local directories do not have arrays as entry\r\n\t\t\t$remote_path_new = $remote_path . $dir_entry . \"/\";\r\n\t\t\t$local_path_new = $local_path . $dir_entry . \"/\";\r\n\t\t\t$result = $this->putRecursive($local_path_new, $remote_path_new, $overwrite, $mode);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list[\"files\"] as $file_entry ) {\r\n\t\t\t$remote_file = $remote_path . $file_entry;\r\n\t\t\t$local_file = $local_path . $file_entry;\r\n\t\t\t$result = $this->put($local_file, $remote_file, $overwrite, $mode);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function setMode($mode) {\n $this->mode = $mode;\n }", "public static function changePermissions($path, $umask) {\n $path = self::resolvePath($path);\n\n self::assertExists($path);\n\n if (!@chmod($path, $umask)) {\n $readable_umask = sprintf('%04o', $umask);\n throw new FilesystemException(\n $path,\n pht(\"Failed to chmod '%s' to '%s'.\", $path, $readable_umask));\n }\n }", "public function ensureDirectoryExists($path, $mode = 0755, $recursive = true)\n {\n\n }", "public static function setPermissions(array $paths)\n {\n foreach ($paths as $path => $permission) {\n if (is_dir($path) || is_file($path)) {\n try {\n if (chmod($path, octdec($permission))) {\n Console::stdout(\"chmod('$path', $permission). Done.\", Console::FG_GREEN);\n };\n } catch (Exception $e) {\n Console::stderr($e->getMessage(), Console::FG_RED);\n }\n } else {\n Console::stderr('File not found', Console::FG_RED);\n }\n }\n }", "public function SetMode($mode)\n\t{\n\t\t$this->mode = $mode;\n\t}", "public function chmod(string $path, int $mode): void\n {\n if (!ssh2_sftp_chmod($this->_getSFTPResource(), $this->_getPath($path), $mode))\n {\n throw new SFTPException('could not change rights');\n }\n }", "public function setMode($mode)\n {\n $this->mode = $mode;\n }", "abstract public function mode($mode = NULL);", "public function isDirectoryRemoveRecursivelyAllowed() {}", "function files($dir, $first = true)\n{\n $data = '';\n if ($first === true) {\n $data .= '<ul><li data-jstree=\\'{ \"opened\" : true }\\'><a href=\"#\" class=\"open-dir\" data-dir=\"' . MAIN_DIR . '\">' . basename($dir) . '</a>';\n }\n $data .= '<ul class=\"files\">';\n $files = array_slice(scandir($dir), 2);\n asort($files);\n foreach ($files as $key => $file) {\n if ((SHOW_PHP_SELF === false && $dir . DS . $file == __FILE__) || (SHOW_HIDDEN_FILES === false && substr($file, 0, 1) === '.')) {\n continue;\n }\n if (is_dir($dir . DS . $file) && (empty(PATTERN_DIRECTORIES) || preg_match(PATTERN_DIRECTORIES, $file))) {\n $dir_path = str_replace(MAIN_DIR . DS, '', $dir . DS . $file);\n $data .= '<li class=\"dir\">'\n . '<a akbarali href=\"#' . MAIN_DIR . $dir_path . '/\" class=\"open-dir\" data-dir=\"../' . $dir_path . '/\">' . $file . '</a>' . files($dir . DS . $file, false) . '</li>';\n } else if (empty(PATTERN_FILES) || preg_match(PATTERN_FILES, $file)) {\n $file_path = str_replace(MAIN_DIR . DS, '', $dir . DS . $file);\n $data .= '<li class=\"file ' . (is_writable($file_path) ? 'editable' : null) . '\" data-jstree=\\'{ \"icon\" : \"jstree-file\" }\\'>'\n . '<a akbarali1 href=\"#' . MAIN_DIR . $file_path . '\" data-file=\"../' . $file_path . '\" class=\"open-file\">' . $file . '</a></li>';\n }\n }\n $data .= '</ul>';\n if ($first === true) {\n $data .= '</li></ul>';\n }\n return $data;\n}", "function ls($dir = null, $mode = self::LS_MODE_DIRS_FILES) {\r\n\t\tif ( $dir === null ) {\r\n\t\t\t$dir = $this->pwd();\r\n\t\t}\r\n\t\tif ( ($mode != self::LS_MODE_FILES_ONLY) && ($mode != self::LS_MODE_DIR_ONLY) && ($mode != self::LS_MODE_RAWLIST) ) {\r\n\t\t\t$mode = self::LS_MODE_DIRS_FILES;\r\n\t\t}\r\n\t\t\r\n\t\tswitch ( $mode ) {\r\n\t\t\tcase self::LS_MODE_DIRS_FILES :\r\n\t\t\t\t$res = $this->_lsBoth($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_DIR_ONLY :\r\n\t\t\t\t$res = $this->_lsDirs($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_FILES_ONLY :\r\n\t\t\t\t$res = $this->_lsFiles($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_RAWLIST :\r\n\t\t\t\t$res = @ftp_rawlist($this->_handle, $dir);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $res;\r\n\t}", "function mkdirV4($dir_name = null, $mode = 0777, $recursive = false){\n if ($dir_name == null){\n return false;\n }\n\n if($recursive){\n $check_dir = \"\";\n $dirs = explode('/', $dir_name);\n \n foreach($dirs as $tmp_dirs){\n if ($tmp_dirs == \"\"){\n continue;\n }\n $check_dir = $check_dir . $tmp_dirs . '/';\n if (is_dir($check_dir)){\n continue;\n } else {\n mkdir($check_dir, $mode);\n }\n }\n return is_dir($dir_name);\n } else {\n return mkdir($dir_name, $mode);\n } \n}", "function setMode($value) {\r\n\t\t$this->mode = $value;\r\n\t}", "public static function writable($path, $mode = 0777)\n\t{\n\t\tif (!chmod($path, $mode)) {\n\t\t\tthrow new Exception('Error making path writable: ' . $path);\n\t\t}\n\t}", "public function set_restriction_mode( $mode ) {\n\n\t\tif ( array_key_exists( $mode, $this->get_restriction_modes() ) ) {\n\n\t\t\tupdate_option( $this->restriction_mode_option, $mode );\n\n\t\t\t$this->restriction_mode = $mode;\n\t\t}\n\t}" ]
[ "0.7532009", "0.6632147", "0.6495247", "0.62224925", "0.611553", "0.6078675", "0.5832453", "0.5727831", "0.5716234", "0.57122064", "0.5532294", "0.55075413", "0.5447474", "0.5410911", "0.53919697", "0.5385702", "0.53489566", "0.5324143", "0.5310524", "0.5303046", "0.52709925", "0.5251062", "0.5214621", "0.51972914", "0.5190607", "0.51880467", "0.51660377", "0.5150873", "0.51489407", "0.51407707", "0.51378566", "0.5092051", "0.5089048", "0.5077334", "0.507565", "0.50543445", "0.50543445", "0.50543445", "0.50521713", "0.5049661", "0.50476575", "0.5040279", "0.5026739", "0.50183", "0.49933204", "0.49886802", "0.49883756", "0.4956461", "0.495601", "0.49495986", "0.4932354", "0.49066398", "0.49066398", "0.49027368", "0.49021524", "0.48979616", "0.4885232", "0.4865601", "0.48585528", "0.48413962", "0.4835325", "0.48340863", "0.47899652", "0.47887203", "0.4779117", "0.47784227", "0.47776565", "0.4776445", "0.47743258", "0.4762754", "0.47618398", "0.4760928", "0.47597113", "0.47567022", "0.47564515", "0.4752676", "0.47508737", "0.47332674", "0.4718546", "0.4713751", "0.4709415", "0.47043678", "0.4697824", "0.46978146", "0.46913752", "0.4684482", "0.46794617", "0.4677699", "0.46711934", "0.46653488", "0.46568733", "0.46417016", "0.46355137", "0.46347094", "0.46342084", "0.46308833", "0.46254697", "0.46172228", "0.46067497", "0.4606298" ]
0.67568254
1
Returns an array of nested directories and files in each directory
function cli_tree($path, $exceptions = false, $type = null) { $files = array(); $directories = array($path); if (is_array($exceptions)) { $exceptions = array_flip($exceptions); } $skipHidden = false; if ($exceptions === true) { $skipHidden = true; } elseif (isset($exceptions['.'])) { $skipHidden = true; unset($exceptions['.']); } try { $directory = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_PATHNAME | RecursiveDirectoryIterator::CURRENT_AS_SELF); $iterator = new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST); } catch (Exception $e) { if ($type === null) { return array(array(), array()); } return array(); } foreach ($iterator as $itemPath => $fsIterator) { if ($skipHidden) { $subPathName = $fsIterator->getSubPathname(); if ($subPathName{0} == '.' || strpos($subPathName, DS . '.') !== false) { continue; } } $item = $fsIterator->current(); if (!empty($exceptions) && isset($exceptions[$item->getFilename()])) { continue; } if ($item->isFile()) { $files[] = $itemPath; } elseif ($item->isDir() && !$item->isDot()) { $directories[] = $itemPath; } } if ($type === null) { return array($directories, $files); } if ($type === 'dir') { return $directories; } return $files; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTreeStructure()\n {\n $result = array();\n $search = function($folder, $prefix) use (&$result, &$search)\n {\n foreach (new \\DirectoryIterator($folder) as $node)\n {\n if ($node->isDir() && !$node->isDot())\n {\n $result[] = $prefix.$node->getFilename();\n $search($node->getPathname(), $prefix.$node->getFilename().'/');\n }\n }\n };\n\n $search($this->path, \"\");\n sort($result);\n return $result;\n }", "public function getDirectoryTreeList();", "public function getFiles()\n {\n $result = array();\n foreach ($this->_subdirectories as $directory) {\n $result = array_merge(\n $result,\n array_map(\n array($this, '_prependDirectory'),\n $directory->getFiles()\n )\n );\n }\n $result = array_merge(\n $result,\n array_map(\n array($this, '_prependDirectory'),\n array_keys($this->_files)\n )\n );\n return $result;\n }", "function fs_get_tree($dir_path) {\n #echo \"top of fs_get_tree, dir_path=$dir_path\\n\";\n { $old_cwd = getcwd();\n chdir($dir_path);\n #echo \" did chdir to '$dir_path'\\n\";\n\n {\n $fh = opendir('.');\n #echo \" opendir\\n\";\n\n $results = array();\n $n = 0;\n $dirs_to_crawl = array();\n while (true) {\n #echo \" loop\\n\";\n if ($n > 500) {\n #echo \"--- n > LIMIT (n=$n), break\\n\";\n break;\n }\n $n++;\n $file = readdir($fh);\n #echo \" file = '$file'\\n\";\n if (!$file) {\n break;\n }\n if ($file == '.'\n || $file == '..'\n || $file == '.git' #todo #fixme don't assume\n ) {\n #echo \"--- . or .., continuing\\n\";\n continue;\n }\n if (is_dir($file)) {\n #echo \"--- adding $file to dirs, n=$n\\n\";\n $dirs_to_crawl[] = $file;\n }\n $results[$file] = null;\n }\n closedir($fh);\n }\n\n #echo \"\\nnow looping thru dirs_to_crawl\\n\";\n foreach ($dirs_to_crawl as $dir) {\n #echo \" dir = $dir\\n\";\n $results[$dir] = fs_get_tree($dir);\n }\n\n chdir($old_cwd);\n }\n\n return $results;\n }", "public function allDirectories()\n {\n $directories = $this->disk->allDirectories('/');\n\n $return = ['/'];\n foreach ($directories as $directory) {\n if (starts_with($directory, '.')) continue;\n $return[] = '/' . $directory;\n }\n\n return $return;\n }", "public function directoryFiles($path)\n {\n $contents = [];\n\n // Scan directory\n $directoryFiles = scandir($path);\n\n foreach ($directoryFiles as $index => $filePath) {\n\n // Ommit . and ..\n if ( ! in_array($filePath, ['.', '..'])) {\n\n // Check if this is a directory\n if (is_dir($path . DIRECTORY_SEPARATOR . $filePath)) {\n\n // Rescan and get files in this directory\n $contents = array_merge($contents, self::directoryFiles($path . DIRECTORY_SEPARATOR . $filePath));\n\n } else {\n\n // Add file to contens array\n $contents[] = $path . DIRECTORY_SEPARATOR . $filePath;\n }\n }\n }\n\n return $contents;\n }", "function getFilesFromDir($dir) { \n\n $files = array(); \n if ($handle = opendir($dir)) { \n while (false !== ($file = readdir($handle))) { \n if ($file != \".\" && $file != \"..\") { \n if(is_dir($dir.'/'.$file)) { \n $dir2 = $dir.'/'.$file; \n $files[] = getFilesFromDir($dir2); \n } \n else { \n $files[] = $dir.'/'.$file; \n } \n } \n } \n closedir($handle); \n } \n\n return $files; \n}", "function listFolderFiles($dir, $updir = \"\", $array = array()){\n $ffs = scandir($dir);\n foreach($ffs as $ff){\n if($ff != '.' && $ff != '..' ){\n if(count(explode(\".\", $ff))!=1){\n $array[]=$updir.explode(\".\", $ff)[0];\n }\n else {\n $array = listFolderFiles($dir.\"/\".$ff, $updir .$ff.\"/\", $array);\n }\n }\n }\n return $array;\n}", "function directory_mapper($path)\n{\n $maxDepth = 3;\n $minDepth = 3;\n $iterator = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),\n RecursiveIteratorIterator::SELF_FIRST,\n RecursiveIteratorIterator::CATCH_GET_CHILD// Ignore \"Permission denied\"\n );\n $iterator->setMaxDepth($maxDepth);\n\n $paths = array($path);\n foreach ($iterator as $path => $dir) {\n if ($iterator->getDepth() >= $minDepth) {\n if ($dir->isDir()) {\n if (file_exists($dir . DIRECTORY_SEPARATOR . \"meta\")) {\n $paths[] = $path;\n }\n }\n }\n }\n array_shift($paths);\n return $paths;\n}", "function dirList($directory) \n{\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory);\n // keep going until all files in directory have been read\n while ($file = readdir($handler)) {\n // if $file isn't this directory or its parent, \n // add it to the results array\n if ($file != '.' && $file != '..')\n $results[] = $directory.$file;\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n}", "public function Get(){\n\n // TODO: this is horrible - try to use glob or RecursiveIteratorIterator - no time\n $fileList = [];\n\n if (!is_dir($this->currentPath)) {\n return $fileList;\n }\n\n $files = $this->scanFolder($this->currentPath);\n\n // up one level link\n if ($this->currentPath != $this->rootPath) {\n $fileList[] = array(\n 'file_name' => \"&uarr;\",\n 'directory' => true,\n 'extension' => '',\n 'size' => \"\",\n 'link' => $this->oneLevelUp(),\n );\n }\n\n foreach ($files as $file) {\n if($file == \".\" || $file == \"..\"){\n continue;\n }\n\n if ($this->isDir($file)) {\n $fileList[] = array(\n 'file_name' => $file,\n 'directory' => true,\n 'extension' => 'folder',\n 'size' => \"\",\n 'link' => $this->currentPath . $file,\n );\n } else {\n // filter on the fly\n $ext = $this->fileExtension($file);\n if(!empty($this->extensionFilter)){\n if(!in_array($ext, $this->extensionFilter)){\n continue;\n }\n }\n $fileList[] = [\n 'file_name' => $file,\n 'directory' => false,\n 'extension' => $ext,\n 'size' => $this->fileSize($file),\n 'link' => \"\",\n ];\n\n }\n }\n\n return $fileList;\n }", "function directoryToArray($directory, $recursive) {\n $array_items = array();\n if ($handle = opendir($directory)) {\n while (false !== ($file = readdir($handle))) {\n if ($file != \".\" && $file != \"..\") {\n if (is_dir($directory. \"/\" . $file)) {\n if($recursive) {\n $array_items = array_merge($array_items, directoryToArray($directory. \"/\" . $file, $recursive));\n }\n } else {\n $file = $directory . \"/\" . $file;\n $array_items[] = preg_replace(\"/\\/\\//si\", \"/\", $file);\n }\n }\n }\n closedir($handle);\n }\n return $array_items;\n}", "function fileTree($path = CONTENT_DIR, $relative = '') {\n $files = [];\n foreach (scandir($path) as $file) {\n if (strpos($file, '.') !== (int) 0) {\n $files[$relative.$file] = is_dir(\"$path/$file\") ? fileTree(\"$path/$file\", $relative.$file.'/') : $file;\n }\n }\n return $files;\n }", "function getFiles($dir = \".\")\r\n{\r\n $files = array();\r\n if ($handle = opendir($dir)) {\r\n while (false !== ($item = readdir($handle))) {\r\n if (is_file(\"$dir/$item\")) {\r\n $files[] = \"$dir/$item\";\r\n } elseif (is_dir(\"$dir/$item\") && ($item != \".\") && ($item != \"..\")) {\r\n $files = array_merge($files, getFiles(\"$dir/$item\"));\r\n }\r\n }\r\n closedir($handle);\r\n }\r\n return $files;\r\n}", "public function subDirectories()\n {\n $this->files();\n\n return $this->directories->get();\n }", "function rd_do_dir($dir)\n{\n\t$out=array();\n\t$_dir=($dir=='')?'.':$dir;\n\t$dh=@opendir($_dir);\n\tif ($dh!==false)\n\t{\n\t\twhile (($file=readdir($dh))!==false)\n\t\t{\n\t\t\tif (!in_array($file,array('.','..','git','.svn','CVS','_vti_cnf')))\n\t\t\t{\n\t\t\t\tif (is_file($_dir.'/'.$file))\n\t\t\t\t{\n\t\t\t\t\t$path=$dir.(($dir!='')?'/':'').$file;\n\t\t\t\t\t$out[]=$path;\n\t\t\t\t} elseif (is_dir($_dir.'/'.$file))\n\t\t\t\t{\n\t\t\t\t\t$out=array_merge($out,rd_do_dir($dir.(($dir!='')?'/':'').$file));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $out;\n}", "function getDirectoryList($directory)\n{\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory) or die($directory . \" doesn't exist\");\n // open directory and walk through the filenames\n while ($file = readdir($handler)) {\n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\") {\n $results[] = $file;\n }\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n}", "public static function get_all_directories($array,$tree=\"\") {\n\t\t\n\t\t// Get Return\n\t\t$ret = array();\n\t\t\n\t\t// Loop\n\t\tforeach($array as $folder => $content) {\n\t\t\t\n\t\t\t// Only Directories\n\t\t\tif($folder != \".\") {\n\t\t\t\t$ret[] = $tree.$folder;\n\t\t\t\t$ret = array_merge($ret,self::get_all_directories($content,$tree.$folder.\"/\"));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Return\n\t\treturn $ret;\n\t\t\n\t}", "public function getDirectories() : Array\n\t{\n\t\t$dirs = [];\n\n\t\tif ($this->exists() && $this->isReadable()) {\n\t\t\n\t\t\t$dir = opendir($this->directory);\n\t\t\twhile ($opened = readdir($dir)) {\n\t\t\n\t\t\t\tif (is_dir($this->directory . DIRECTORY_SEPARATOR . $opened) && !DirectoryManager::isBlockListed($opened)) {\n\t\t\t\t\t$dirs[] = $opened;\n\t\t\t\t}\n\t\t\n\t\t\t}\n\n\t\t\tclosedir($dir);\n\t\t\n\t\t}\n\t\t\n\t\treturn $dirs;\n\t}", "protected function parseDirectory($rootPath, $seperator=\"/\"){\n $fileArray=array();\n $handle = opendir($rootPath);\n while( ($file = @readdir($handle))!==false) {\n if($file !='.' && $file !='..'){\n if (is_dir($rootPath.$seperator.$file)){\n $array=$this->parseDirectory($rootPath.$seperator.$file);\n $fileArray=array_merge($array,$fileArray);\n }\n else {\n $fileArray[]=$rootPath.$seperator.$file;\n }\n }\n } \n return $fileArray;\n }", "public static function getTree( string $root ) : array {\n\t\t// Clean root\n\t\t$root\t= static::buildPath( explode( '/', $root ) );\n\t\t\n\t\tif ( isset( static::$folders[$root] ) ) {\n\t\t\treturn static::$folders[$root];\n\t\t}\n\t\t\n\t\tif ( !\\is_readable( $root ) || !\\is_dir( $root ) ) {\n\t\t\treturn [];\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$dir\t\t= \n\t\t\tnew \\RecursiveDirectoryIterator( \n\t\t\t\t$root, \n\t\t\t\t\\FilesystemIterator::FOLLOW_SYMLINKS | \n\t\t\t\t\\FilesystemIterator::KEY_AS_FILENAME\n\t\t\t);\n\t\t\t$it\t\t= \n\t\t\tnew \\RecursiveIteratorIterator( \n\t\t\t\t$root, \n\t\t\t\t\\RecursiveIteratorIterator::LEAVES_ONLY,\n\t\t\t\t\\RecursiveIteratorIterator::CATCH_GET_CHILD \n\t\t\t);\n\t\t\t\n\t\t\t$it->rewind();\n\t\t\t\n\t\t\t// Temp array for sorting\n\t\t\t$tmp\t= \\iterator_to_array( $it, true );\n\t\t\t\\rsort( $tmp, \\SORT_NATURAL );\n\t\t\t\n\t\t\tstatic::$folders[$root]\t= $tmp;\n\t\t\treturn $tmp;\n\t\t\t\n\t\t} catch( \\Exception $e ) {\n\t\t\t\\messages( 'error',\n\t\t\t\t'Error retrieving files from ' . $pd . ' ' . \n\t\t\t\t$e->getMessage() ?? \n\t\t\t\t\t'Directory search exception'\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn [];\n\t}", "function getFilesRecursively($rootPath, $fullPath = false) {\n if (! is_dir($rootPath)) {\n return array();\n }\n\n $dirs = scandir($rootPath);\n if (false === $dirs) {\n return array();\n }\n\n $return = array();\n\n $temps = array();\n foreach ($dirs as $dir) {\n if ($dir == '.' || $dir == '..') continue;\n $temps[] = realpath($rootPath .'/'. $dir);\n }\n $dirs = $temps;\n\n do {\n $new_dirs = array();\n\n foreach ($dirs as $dir) {\n if (is_dir($dir)) {\n $temps = scandir($dir);\n\n if (false !== $temps) {\n foreach ($temps as $temp) {\n if ('.' == $temp || '..' == $temp) continue;\n\n $new_dirs[] = $dir .'/'. $temp;\n }\n }\n }\n\n if (is_file($dir)) {\n $return[] = realpath($dir);\n }\n }\n\n $dirs = $new_dirs;\n\n } while (count($dirs) > 0);\n\n if (false === $fullPath) {\n foreach ($return as $index => $path) {\n $return[$index] = basename($path);\n }\n }\n\n return $return;\n}", "function getDirectoryList ($directory) {\r\r\n // create an array to hold directory list\r\r\n $results = array();\r\r\n\r\r\n // create a handler for the directory\r\r\n $handler = opendir($directory);\r\r\n\r\r\n // open directory and walk through the filenames\r\r\n while ($file = readdir($handler)) {\r\r\n\r\r\n // if file isn't this directory or its parent, add it to the results\r\r\n if ($file != \".\" && $file != \"..\") {\r\r\n $results[] = $file;\r\r\n }\r\r\n\r\r\n }\r\r\n\r\r\n // tidy up: close the handler\r\r\n closedir($handler);\r\r\n\r\r\n // done!\r\r\n return $results;\r\r\n}", "function getList($dir, $arr = []){\n $d = dir($dir);\n while (false !== ($entry = $d->read())) {\n if($entry === \".\" || $entry === \"..\"){\n continue;\n }\n if(is_dir($dir.\"/\".$entry)){\n $arr = getList($dir.\"/\".$entry,$arr);\n }else{\n $arr[] = [$dir,explode(\".\",$entry)[0]];\n }\n }\n $d->close();\n\n return $arr;\n}", "function file_array($path, $exclude = \".|..\", $recursive = false) {\n $path = rtrim($path, \"/\") . \"/\";\n $folder_handle = opendir($path);\n $exclude_array = explode(\"|\", $exclude);\n $result = array();\n while(false !== ($filename = readdir($folder_handle))) {\n if(!in_array(strtolower($filename), $exclude_array)) {\n if(is_dir($path . $filename . \"/\")) {\n if($recursive) $result[] = file_array($path, $exclude, true);\n } else {\n $result[] = $filename;\n }\n }\n }\n return $result;\n}", "public static function listDir($path = '', $options = array(), $depth = 0){\n\t\t$path\t\t= (string) $path;\n\t\t$options\t= (array) $options;\n\t\t$results\t= array();\n\n\t\tif($path){\n\t\t\tApp::uses('Folder', 'Utility');\n\t\t\tApp::uses('File', 'Utility');\n\n\t\t\t$path\t\t= str_replace(array('/\\\\', '//', '/'), DS, $path);\n\t\t\t$sort\t\t= Hash::get($options, 'sort', true);\n\t\t\t$exeption\t= Hash::get($options, 'exeption', true);\n\t\t\t$fullpath\t= Hash::get($options, 'fullpath', false);\n\t\t\t$extension\t= Hash::get($options, 'extension', '*');\n\t\t\t$autoCreate\t= Hash::get($options, 'auto_create', false);\n\n\t\t\t$fullBaseUrl\t= Router::fullBaseUrl();\n\t\t\t$folder\t\t\t= new Folder($path);\n\n\t\t//\tread will return 2 array (0 as list of directories, and 1 as list of files)\n\t\t\t$contents\t\t= $folder->read($sort, $exeption, $fullpath);\n\t\t\t$directories\t= Hash::get($contents, 0, array());\n\t\t\t$files\t\t\t= Hash::get($contents, 1, array());\n\n\t\t\tif($directories){\n\t\t\t\tforeach($directories as $directory){\n\t\t\t\t\t$subPath = $fullpath ? $directory : $path.DS.$directory;\n\t\t\t\t\t$dirName = basename($subPath);\n\n\t\t\t\t\t$results[] = array(\n\t\t\t\t\t\t'directory'\t=> $dirName, \n\t\t\t\t\t\t'path'\t\t=> $subPath, \n\t\t\t\t\t\t'file'\t\t=> Common::listDir($subPath, $options, $depth + 1), \n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($files && $extension && $extension != '*'){\n\t\t\t\t$files = $folder->find(sprintf('.*\\.%s', $extension), $sort);\n\t\t\t}\n\n\t\t\tif($files){\n\t\t\t\tif($depth){\n\t\t\t\t\t$results = array_merge($results, $files);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$results[] = array(\n\t\t\t\t\t\t'path' => $fullpath ? $folder->pwd() : $path, \n\t\t\t\t\t\t'file' => $files, \n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "private function nodeArray(DirectoryIterator $dir){\n $data = array();\n foreach($dir as $node){\n if($node->isDir() && !$node->isDot() && $this->isActiveDirectory($node->getPathname()))\n $data[$node->getFilename()] = $this->nodeArray(new DirectoryIterator($node->getPathname()));\n elseif($node->isFile() && $this->isNotHiddenFile($node->getFilename()))\n $data[] = $node->getPathname();\n }\n return $data;\n }", "private function getDirectories()\n {\n $directories = $this->core->getDirectories();\n\n foreach ($directories as &$directory) {\n $directory = $this->files->normalizePath($directory);\n unset($directory);\n }\n\n //Sorting to get longest first\n uasort($directories, function ($valueA, $valueB) {\n return strlen($valueA) < strlen($valueB);\n });\n\n return $directories;\n }", "function getDirectoryList ($directory) {\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory);\n // open directory and walk through the filenames\n while ($file = readdir($handler)) {\n // if file isn't this directory or its parent, add it to the results\n if ($file[0] != '.') {\n $results[] = is_dir($directory . '/' . $file) ? \"{$file}/\" : $file;\n }\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n sort($results);\n return $results;\n}", "static function allSubDirs( $startPath = '.' ) {\t\t\n\t\t$iterator = new RecursiveIteratorIterator(\n\t\t\tnew RecursiveDirectoryIterator( $startPath ), \n\t\t\tRecursiveIteratorIterator::SELF_FIRST\n\t\t\t);\n\t\t$paths = array();\n\t\tforeach ( $iterator as $file ) {\n\t\t\tif ( $file->isDir() ) {\n\t\t\t\t$path = str_replace( '\\\\', '/', $file->getRealpath() );\n\t\t\t\t// Don't allow duplicate\n\t\t\t\tif ( array_search( $path, $paths ) !== false ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tarray_push( $paths, $path );\n\t\t\t}\n\t\t}\n\t\treturn $paths;\n\t}", "function listFiles($root = '.', $readHidden = false)\n {\n $files = array();\n $directories = array();\n $last_letter = $root[strlen($root)-1];\n $root = ($last_letter == '\\\\' || $last_letter == '/') ?\n $root : $root.DIRECTORY_SEPARATOR;\n $directories[] = $root;\n while (sizeof($directories)) {\n $dir = array_pop($directories);\n if ($handle = opendir($dir)) {\n\twhile (false !== ($file = readdir($handle))) {\n\t if (!$readHidden) {\n\t if (substr($file, 0, 1) == '.' ) {\n\t continue;\n\t }\n\t }\n\t if ($file == '.' || $file == '..') {\n\t continue;\n\t }\n\t $file = $dir.$file;\n\t /*\n\t if (is_dir($file)) {\n\t $directory_path = $file.DIRECTORY_SEPARATOR;\n\t array_push($directories, $directory_path);\n\t $files['dirs'][] = $directory_path;\n\t } else\n\t */\n\t if (is_file($file)) {\n\t $files[] = $file;\n\t }\n\t}\n\tclosedir($handle);\n }\n }\n return $files;\n }", "function getDirectoryList($d,$h) \n{\n $results = array();\n // create a handler for the directory\n $handler = opendir($d);\n // open directory and walk through the filenames\n while ($file = readdir($handler)) \n { \n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\") \n {\n $results[] = $file;\n }\n }\n // tidy up: close the handler\n closedir($handler);\n // Check if should include hidden files, $h parameter\n if ($h == false)\n { \n $results = array_filter($results, create_function('$a','return ($a[0]!=\".\");')); \n } \n // done!\n return $results;\n}", "function dirtree_array($folder){\n // counter for $docnr\n static $i = 1;\n // if folder can be opend\n if($handle = opendir($folder)){\n // read folder content\n while(($file_name = readdir($handle)) !== false){\n // make dir_path for link\n $dir_path = str_replace(FILE_FOLDER,DS.APP_FOLDER,$folder);\n // cleanup filename\n if(!preg_match(\"#^\\.#\", $file_name))\n // make folder entry and call this function again for files\n if(is_dir($folder.DS.$file_name )){\n // jump over forbidden file or folder\n if (in_array($file_name, FORBIDDEN_FOLDERS)){continue;}\n // dreate file properties\n $file_properties[$file_name] = array(\n \"nr\" => $i++,\n \"path\" => $dir_path,\n \"name\" => $file_name,\n \"ext\" => \"folder\",\n \"childs\" => dirtree_array($folder.DS.$file_name));\n }else{\n $ext = '.'.pathinfo($file_name, PATHINFO_EXTENSION);\n // read only files with allowed extensions\n if($ext != EXTENSION){continue;}\n $file_name = str_replace($ext,'',$file_name);\n // jump over forbidden file or folder\n if (in_array($file_name, INVISIBLE_FILES)){continue;}\n // dreate file properties\n $file_properties[$file_name] = array(\n \"nr\" => $i++,\n \"path\" => $dir_path,\n \"name\" => $file_name,\n \"ext\" => $ext,\n \"childs\" => false);\n }\n }\n closedir($handle);\n }\n return $file_properties ;\n}", "function getFiles($dir) {\n\t$files = array();\n\t$dh = opendir($dir);\n\twhile (($file = readdir($dh)) !== false) {\n\t\t$path = $dir . $file;\n\t\tif (!is_dir($path)) {\n\t\t\t$files[] = $path;\n\t\t}\n\t\telseif (is_dir($path) && basename($path) != \".\" && basename($path) != \"..\") {\n\t\t\t$files = array_merge($files, getFiles($path . \"/\"));\n\t\t}\n\t}\n\tclosedir($dh);\n\treturn $files;\n}", "private function get_filelist_as_array($dir = 'images/', $recursive = true, $basedir = '')\n {\n if ($dir == '') {return array();} else {$results = array(); $subresults = array();}\n if (!is_dir($dir)) {$dir = dirname($dir);} // so a files path can be sent\n if ($basedir == '') {$basedir = realpath($dir).DIRECTORY_SEPARATOR;}\n\n $files = scandir($dir);\n foreach ($files as $key => $value){\n if ( ($value != '.') && ($value != '..') ) {\n $path = realpath($dir.DIRECTORY_SEPARATOR.$value);\n if (is_dir($path)) { // do not combine with the next line or..\n if ($recursive) { // ..non-recursive list will include subdirs\n $subdirresults = self::get_filelist_as_array($path,$recursive,$basedir);\n $results = array_merge($results,$subdirresults);\n }\n } else { // strip basedir and add to subarray to separate file list\n $subresults[] = str_replace($basedir,'',$path);\n }\n }\n }\n // merge the subarray to give the list of files then subdirectory files\n if (count($subresults) > 0) {$results = array_merge($subresults,$results);}\n return $results;\n }", "function getLocalFolderFiles($path) {\n $result = array();\n if ($dh = dir($path)) {\n while (FALSE !== ($file = $dh->read())) {\n if ($file != '.' && $file != '..' &&\n !is_dir($path.'/'.$file)) {\n $result[$file] = $file;\n }\n }\n }\n return $result;\n }", "function _getSubDirs($directory) {\n $arrDirectories = array();\n\n $directoryPath = $_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].$directory;\n\n $fp = @opendir($directoryPath);\n if ($fp) {\n while ($file = readdir($fp)) {\n $path = $directoryPath.DIRECTORY_SEPARATOR.$file;\n\n if ($file != \".\" && $file != \"..\" && $file != \".svn\") {\n array_push($arrDirectories, $directory.DIRECTORY_SEPARATOR.$file);\n\n if (is_dir(realpath($path))) {\n if (\\Cx\\Lib\\FileSystem\\FileSystem::makeWritable($path)) {\n $arrDirectoriesRec = $this->_getSubDirs($directory.DIRECTORY_SEPARATOR.$file);\n \n if (count($arrDirectoriesRec) > 0) {\n $arrDirectories = array_merge($arrDirectories, $arrDirectoriesRec);\n }\n }\n }\n }\n }\n closedir($fp);\n }\n return $arrDirectories;\n }", "public function getDirectories()\n {\n if (isset($this->raw->directories)) {\n $directories = (array) $this->raw->directories;\n $base = $this->getBasePath();\n\n array_walk(\n $directories,\n function (&$directory) use ($base) {\n $directory = $base\n . DIRECTORY_SEPARATOR\n . rtrim(Path::canonical($directory), DIRECTORY_SEPARATOR);\n }\n );\n\n return $directories;\n }\n\n return array();\n }", "private function traversePath($path)\n {\n $filenames = array();\n\n $directory = new DirectoryIterator($path);\n\n foreach ($directory as $file) {\n if ($file->isDot()) {\n continue;\n }\n if ($file->isDir()) {\n $filenames = array_merge($filenames, $this->traversePath($file->getPathname()));\n } else {\n $filenames[] = $this->trimFilename($file);\n }\n }\n\n return $filenames;\n }", "function getSubfolders() ;", "protected function getDirectories(): array\n {\n return [];\n }", "static function getDirectoryListing();", "protected function flatten_dirlist($nested_files, $path = '')\n {\n }", "private function directoryScan($dir) {\n\t\t\n\t\t// check for the validity of input / working directory\n\t\t\n\t\tif (!is_dir($dir)) {\n\t\t\tdie(\"'$dir' is not a directory.\".LE);\n\t\t}\n\t\t\n\t\t// listing directory contents\n\t\t\n\t\t$result = [];\n\t\t\n\t\t$root = scandir($dir);\n\t\tforeach($root as $value)\n\t\t{\n\t\t\t// removing dots & output directory\n\t\t\t\n\t\t\tif($value === '.' || $value === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// listing only files\n\t\t\t\n\t\t\tif(is_file(\"$dir\".DS.\"$value\")) {\n\t\t\t\t$result[$value]=\"$dir\".DS.\"$value\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// recursive call to self(this method) so we can get files listing recursively\n\t\t\t\n\t\t\tforeach($this->directoryScan(\"$dir\".DS.\"$value\") as $value1)\n\t\t\t{\n\t\t\t\t$result[basename($value1)]=$value1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function get_folder_file_list($path)\r\n\t{\r\n\t\t$file_list = $file_list['file'] = $file_list['dir'] = array();\r\n\t\tif($handle = opendir($path))\r\n\t\t{\r\n\t\t\twhile (false !== ($entry = readdir($handle))) \r\n\t\t\t{\r\n\t\t\t\tif($entry != '.' && $entry != '..')\r\n\t\t\t\t{\r\n\t\t\t\t\t$file_list[] = $entry;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $file_list;\r\n\t}", "function browse($dir) {\nglobal $filenames;\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle))) {\n if ($file != \".\" && $file != \"..\" && is_file($dir.'/'.$file)) {\n $filenames[] = $dir.'/'.$file;\n }\n else if ($file != \".\" && $file != \"..\" && is_dir($dir.'/'.$file)) {\n browse($dir.'/'.$file);\n }\n }\n closedir($handle);\n }\n return $filenames;\n}", "function scanDir() {\r\n $returnArray = array();\r\n \r\n if ($handle = opendir($this->uploadDirectory)) {\r\n \r\n while (false !== ($file = readdir($handle))) {\r\n if (is_file($this->uploadDirectory.\"/\".$file)) {\r\n $returnArray[] = $file;\r\n }\r\n }\r\n \r\n closedir($handle);\r\n }\r\n else {\r\n die(\"<b>ERROR: </b> No se puede leer el directorio <b>\". $this->uploadDirectory.'</b>');\r\n }\r\n return $returnArray; \r\n }", "function scandir_recursive($directory, $format = null, $excludes = array()){\n $format = ($format == null) ? 'absolute' : $format;\n $paths = array();\n $stack[] = $directory;\n while($stack){\n $this_resource = array_pop($stack);\n if ($resource = scandir($this_resource)){\n $i = 0;\n while (isset($resource[$i])){\n if ($resource[$i] != '.' && $resource[$i] != '..'){\n $current = array(\n 'absolute' => \"{$this_resource}/{$resource[$i]}\",\n 'relative' => preg_replace('/' . preg_quote($directory, '/') . '/', '', \"{$this_resource}/{$resource[$i]}\")\n );\n if (is_file($current['absolute'])){\n $paths[] = $current[$format];\n } elseif (is_dir($current['absolute'])){\n $paths[] = $current[$format];\n $stack[] = $current['absolute'];\n }\n }\n $i++;\n }\n }\n }\n if (count($excludes) > 0){\n $clean = array();\n foreach($paths as $path){\n $remove = false;\n foreach($excludes as $exclude){\n $exclude = preg_quote($exclude, '/');\n $exclude = str_replace('\\*', '.*', $exclude);\n if (preg_match('/' . $exclude . '/', $path)){\n $remove = true;\n }\n }\n if (!$remove) $clean[] = $path;\n }\n $paths = $clean;\n }\n return $paths;\n}", "private static function getSubDirs( $dir ) {\n\t\t$files = array();\n\t\t$dir = new \\DirectoryIterator($dir);\n\t\tforeach ($dir as $fileinfo) {\n\t\t\t# Filter unwanted files\n\t\t\tif( $fileinfo->isDot()\n\t\t\t || !$fileinfo->isDir()\n\t\t\t || $fileinfo->isLink()\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$files[] = $fileinfo->getFilename();\n\t\t}\n\t\tsort($files);\n\t\treturn $files;\n\t}", "public static function readDirectory ($path) {\n\t\t$list = new \\Array_hx();\n\t\t$dir = \\opendir($path);\n\t\t$file = null;\n\t\twhile (true) {\n\t\t\t$file = \\readdir($dir);\n\t\t\tif (!($file !== false)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (($file !== \".\") && ($file !== \"..\")) {\n\t\t\t\t$list->arr[$list->length++] = $file;\n\t\t\t}\n\t\t}\n\t\t\\closedir($dir);\n\t\treturn $list;\n\t}", "public static function get_all_files($array,$tree=\"\") {\n\t\t\n\t\t// Get Return\n\t\t$ret = array();\n\t\t\n\t\t// Loop\n\t\tforeach($array as $folder => $content) {\n\t\t\t\n\t\t\t// Check for Current\n\t\t\tif($folder != \".\") {\n\t\t\t\t$ret = array_merge($ret,self::get_all_files($content,$tree.$folder.\"/\"));\n\t\t\t}\n\t\t\t\n\t\t\t// Add To Array\n\t\t\telse {\n\t\t\t\tforeach($content as $file) {\n\t\t\t\t\t$ret[] = $tree.$file;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Return\n\t\treturn $ret;\n\t\t\n\t}", "public function getDirectories(DirectoryInterface $directory): array;", "public function listDir($dir)\n {\n $out = array();\n foreach ($this->getPaths() as $modDir) {\n if (!is_dir($modDir . '/' . $dir)) {\n continue;\n }\n foreach (scandir($modDir . '/' . $dir) as $d) {\n if ($d[0] == '.') {\n continue;\n }\n $out[] = realpath(\"$modDir/$dir/$d\");\n }\n }\n return $out;\n }", "function list_directories($path) {\n\tglobal $root_directory, $gmz_directories, $ignore_folders;\n if ($handle = @opendir($path)) { \n while (false !== ($filename = readdir($handle))) { \n if ($filename != '.' && $filename != '..') {\n\t\t\t\t$file_path = substr($path.'/'.$filename, strlen($root_directory)+1, strlen($path.'/'.$filename));\n\t\t\t\t$file_folder = substr($file_path, 0, -(strlen($filename)+1));\n\t\t\t\tif(is_dir($path.'/'.$filename)) {\n\t\t\t\t\tif(!in_array($file_path, $ignore_folders)) {\n\t\t\t\t\t\t$gmz_directories[] = $file_path;\n\t\t\t\t\t}\n\t\t\t\t\tlist_directories($path.'/'.$filename);\n\t\t\t\t}\n } \n } \n closedir($handle); \n } else {\n\t\tdisplay_error('Invalid Directory');\n\t}\n}", "function createFileList($path=\"\", $dir=\"\") {\n\t\t\n\t\tif (empty($path)) {\n\t\t\t$path = $this->path;\n\t\t\t$root = true;\n\t\t} else {\n\t\t\t$root = false;\n\t\t}\n\n\t\t// temporary arrays to hold separate file and directory content\n\t\t$filelist = array();\n\t\t$directorylist = array();\n\n\t\t// get the ignore list, in local scope (can't use $this-> later on)\n\t\t$ignorelist = $this->ignorelist;\n\n\t\t// Open directory and read contents\n\t\tif (is_dir($path)) {\n\n\t\t\t// loop through the contents\n $dirContent = scandir($path);\n\n\t\t\tforeach($dirContent as $key => $file) {\n\n\t\t\t\t// skip over any files in the ignore list, and mac-only files starting with ._\n\t\t\t\tif (!in_array($file, $ignorelist) && (strpos($file, \"._\") !== 0)) {\n\n\t\t\t\t\t// condition : if it is a directory, add to dir list array\n\t\t\t\t\tif (is_dir($path.$file)) {\n\n\t\t\t\t\t\t$directorylist[$file] = array(\n\t\t\t\t\t\t\t\"files\" => $this->createFileList($path.$file, $file)\n\t\t\t\t\t\t);\n\n // file, add to file array\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($root) {\n\t\t\t\t\t\t\t$directorylist[\"root\"][\"files\"][] = array(\n\t\t\t\t\t\t\t\t\"file\" => $file,\n\t\t\t\t\t\t\t\t\"path\" => $path,\n\t\t\t\t\t\t\t\t\"dir\" => $dir\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$filelist[] = array(\n\t\t\t\t\t\t\t\t\"file\" => $file,\n\t\t\t\t\t\t\t\t\"path\" => $path,\n\t\t\t\t\t\t\t\t\"dir\" => $dir . \"/\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// merge file and directory lists\n\t\t$finalList = array_merge($directorylist, $filelist);\n\t\t\n\t\treturn $finalList;\n\t}", "private function listFolderFiles($dir){\n $children = false;\n $isRoot = false;\n if($dir==$this->file_storage){\n $isRoot = true;\n }\n\n $folderName = $this->getFolderName($dir);\n if(!$isRoot){\n //$this->info('Directory Name: '.$folderName['child']);\n //$this->info('Parent Name: '.$folderName['parent']);\n }\n\n //$this->info('Folder: '.$dir);\n\n foreach (new \\DirectoryIterator($dir) as $fileInfo) {\n if (!$fileInfo->isDot()) {\n if ($fileInfo->isDir()) {\n $this->listFolderFiles($fileInfo->getPathname());\n }else{\n $rename = false;\n //$this->info('File: '.$fileInfo->getFilename());\n //$info = new SplFileInfo($dir.'/'.$fileInfo->getFilename());\n $ext = \".\".pathinfo($fileInfo->getFilename(), PATHINFO_EXTENSION);\n //$ext = \".\"$info->getExtension();\n //$this->info('File: extension '.$ext);\n $filebreak = str_replace($ext,\"\",$fileInfo->getFilename());\n if (strpos($filebreak, '.') !== false || strpos($filebreak, \"'\") !== false || strpos($filebreak, \"#\") !== false) {\n $rename = true;\n }\n if($rename){\n $replace = array(\".\", \"'\", \"#\", \";\", \"/\", \"?\", \":\", \"@\", \"=\", \"&\", \",\");\n //“;”, “/”, “?”, “:”, “@”, “=” and “&\n $fileraw = str_replace($replace,\" \",$filebreak);\n //$this->info('File: raw '.$fileraw);\n $newfilename = $fileraw . $ext;\n //$this->info('File: new '.$newfilename);\n $prod_filename = $newfilename;\n rename($dir.'/'.$fileInfo->getFilename(),$dir.'/'.$newfilename);\n }else{\n $prod_filename = $fileInfo->getFilename();\n }\n $this->checkFileExtension($dir.'/'.$prod_filename, $prod_filename, $dir);\n }\n $children = true;\n }else{\n $children = false;\n }\n }\n //$this->info('Children: '.$children);\n\n if(!$isRoot){\n $this->folders[$this->count]['name'] \t\t\t= $folderName['child'];\n $this->folders[$this->count]['parent'] \t\t= $folderName['parent'];\n $this->folders[$this->count]['full_path']\t= $dir;\n $this->folders[$this->count]['children']\t= $children;\n $this->count++;\n }\n //$this->info('#################');\n }", "function bob_scandir($root_path, $bad_path, $recursive) {\n $output = array();\n if (file_exists($root_path)){\n $paths = scandir($root_path);\n if ($paths === False)\n return False;\n foreach ($paths as $path) {\n $potential_path = \"${root_path}/${path}\";\n\n // Ignore any files in the bad (admin) path or files that begin with a period.\n if ($potential_path == $bad_path or $path[0] == '.')\n continue;\n\n $output[] = $potential_path;\n $bad_folder = ''; // not sure what this is for\n if ($recursive and is_dir($potential_path)) // Recursively descend and print out files.\n $output = array_merge($output, bob_scandir($potential_path, $bad_folder, $recursive));\n }\n }\n return $output;\n}", "function get_all_directory_files($directory_path)\n{\n\n $scanned_directory = array_diff(scandir($directory_path), array('..', '.'));\n\n\n\n return custom_shuffle($scanned_directory);\n}", "protected function _getFilesRecursive($dir)\n\t{\n\t\t$files = array();\n\t\tforeach (scandir($dir) as $f) {\n\t\t\tif ($f !== '.' and $f !== '..') {\n\t\t\t\tif (is_dir(\"$dir/$f\")) {\n\t\t\t\t\t$files = array_merge($files, $this->_getFilesRecursive(\"$dir/$f\"));\n\t\t\t\t} else {\n\t\t\t\t\t$files[] = $dir.'/'.$f;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "private function allFilesRecursively($nativePath) {\n\t\t\t$files = scandir($nativePath);\n\t\t\tif (!$files) throw new ServiceException(\"INVALID_PATH\", $this->path);\n\t\t\t\n\t\t\t$ignored = $this->ignoredItems($this->publicPath($nativePath));\n\t\t\t$result = array();\n\t\t\t\n\t\t\tforeach($files as $i => $name) {\n\t\t\t\tif (substr($name, 0, 1) == '.' || in_array(strtolower($name), $ignored))\n\t\t\t\t\tcontinue;\n\t\n\t\t\t\t$fullPath = self::joinPath($nativePath, $name);\n\t\t\t\tif (is_dir($fullPath)) {\n\t\t\t\t\t$result = array_merge($result, $this->allFilesRecursively($fullPath));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result[] = $fullPath;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function ArticlePathDirectories( $inPath, $outPath, $depth = -1 ){\n $depth++;\n $files = scandir( $inPath );\n foreach( $files as $file ){\n if( $file == '.' || $file == '..' ){\n continue;\n }\n $newPath = $inPath . DIRECTORY_SEPARATOR . $file;\n if( is_dir( $newPath ) ){\n for( $i=0; $i<$depth; $i++){\n echo \"\\t\";\n }\n echo \"|- $file\\n\";\n $newOutPath = $outPath . DIRECTORY_SEPARATOR . $file;\n mkdir( $newOutPath );\n ArticlePathDirectories( $newPath, $newOutPath, $depth ); // recursion\n }\n }\n}", "function findDirectoriesWithFiles($path, $pattern = '*') {\n $res = array();\n if(substr($path, -1) != '/') $path = $path.'/';\n foreach(glob($path.$pattern, GLOB_BRACE) as $file) {\n $res[] = dirname($file);\n }\n foreach(glob($path.'*', GLOB_ONLYDIR|GLOB_BRACE) as $file) {\n $res = array_merge($res, findDirectoriesWithFiles($file, $pattern));\n }\n return $res;\n}", "function scan($dir){\n\n\t$files = array();\n\n\t// Is there actually such a folder/file?\n\n\tif(file_exists($dir)){\n\t\n\t\tforeach(scandir($dir) as $f) {\n\t\t\n\t\t\tif(!$f || $f[0] == '.') {\n\t\t\t\tcontinue; // Ignore hidden files\n\t\t\t}\n\n\t\t\tif(is_dir($dir . '/' . $f)) {\n\n\t\t\t\t// The path is a folder\n\n\t\t\t\t$files[] = array(\n\t\t\t\t\t\"name\" => $f,\n\t\t\t\t\t\"type\" => \"folder\",\n\t\t\t\t\t\"path\" => $dir . '/' . $f,\n\t\t\t\t\t\"items\" => scan($dir . '/' . $f) // Recursively get the contents of the folder\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\n\t\t\t\t// It is a file\n\t\t\t\t$path_info = pathinfo($f);\n\t\t\t\t//if ($path_info && $path_info.extension )\n\t\t\t\t$ext = $path_info['extension'];\n\t\t\t\tif($ext =='html'||$ext =='jpg' || $ext ==='png' || $ext == 'pdf'){\n\t\t\t\t\t$text = ($ext =='html') ?'doc':'image';\n\t\t\t\t\t$files[] = array(\n\t\t\t\t\t\t\"name\" => $f,\n\t\t\t\t\t\t\"type\" => \"file\",\n\t\t\t\t\t\t\"text\" => $text,\n\t\t\t\t\t\t\"path\" => $dir . '/' . $f,\n\t\t\t\t\t\t\"size\" => filesize($dir . '/' . $f) // Gets the size of this file\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t}\n\n\treturn $files;\n}", "function scan($dir){\n\n\t$files = array();\n\n\t// Is there actually such a folder/file?\n\n\tif(file_exists($dir)){\n\t\n\t\tforeach(scandir($dir) as $f) { // scandir() accepts the full path of the folder to be scanned\n\t\t\n\t\t\tif(!$f || $f[0] == '.') {\n\n\t\t\t\t// It is a hidden file\n\t\t\t\t\n\t\t\t\tcontinue; \n\t\t\t}\n\n\t\t\tif(is_dir($dir . '/' . $f)) {\n\n\t\t\t\t// The path is a folder\n\n\t\t\t\t$files[] = array(\n\t\t\t\t\t\"name\" => $f,\n\t\t\t\t\t\"type\" => \"folder\",\n\t\t\t\t\t\"path\" => $dir . '/' . $f,\n\t\t\t\t\t\"items\" => scan($dir . '/' . $f) // Recursively get the contents of the folder\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\n\t\t\t\t// It is a file\n\n\t\t\t\t$files[] = array(\n\t\t\t\t\t\"name\" => $f,\n\t\t\t\t\t\"type\" => \"file\",\n\t\t\t\t\t\"path\" => $dir . '/' . $f,\n\t\t\t\t\t\"size\" => filesize($dir . '/' . $f) // Gets the size of this file\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\t\n\t}\n\n\treturn $files;\n}", "function dirList ($dir) \n{\n $results = array();\n\n\tif(file_exists($dir)){\n\t\t// create a handler for the directory\n\t\t$handler = opendir($dir);\n\n\t\t// keep going until all files in directory have been read\n\t\twhile ($file = readdir($handler)) {\n\n\t\t\t// if $file isn't this directory or its parent, \n\t\t\t// add it to the results array\n\t\t\tif ($file != '.' && $file != '..')\n\t\t\t\t$results[] = $file;\n\t\t}\n\n\t\t// tidy up: close the handler\n\t\tclosedir($handler);\n\n\t\trsort($results);\n\t}\n\n // done!\n return $results;\n}", "public function recursivelyIterateDirectory()\n\t{\n\t\treturn new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->getPath()));\n\t}", "protected function getBasicDirectories(): array\n {\n return [\n $this->folderPaths['logs'],\n $this->folderPaths['framework'],\n $this->folderPaths['app'] . DIRECTORY_SEPARATOR . 'Provider',\n $this->folderPaths['tests'] . DIRECTORY_SEPARATOR . 'Unit',\n ];\n }", "public function listDirPathsRecursive(callable $filter = null): array\n {\n return iterator_to_array($this->scanDirPathsRecursive($filter));\n }", "function getFiles(){\r\n\r\n global $dirPtr, $theFiles;\r\n \r\n chdir(\".\");\r\n $dirPtr = openDir(\".\");\r\n $currentFile = readDir($dirPtr);\r\n while ($currentFile !== false){\r\n $theFiles[] = $currentFile;\r\n $currentFile = readDir($dirPtr);\r\n } // end while\r\n \r\n}", "function papi_get_all_files_in_directory( $directory = '' ) {\n\t$result = [];\n\n\tif ( empty( $directory ) || ! is_string( $directory ) ) {\n\t\treturn $result;\n\t}\n\n\tif ( file_exists( $directory ) && $handle = opendir( $directory ) ) {\n\t\twhile ( false !== ( $file = readdir( $handle ) ) ) {\n\t\t\tif ( ! in_array( $file, ['..', '.'] ) ) {\n\t\t\t\tif ( is_dir( $directory . '/' . $file ) ) {\n\t\t\t\t\t$result = array_merge( $result, papi_get_all_files_in_directory( $directory . '/' . $file ) );\n\t\t\t\t} else {\n\t\t\t\t\t$file = $directory . '/' . $file;\n\t\t\t\t\t$result[] = preg_replace( '/\\/\\//si', '/', $file );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tclosedir( $handle );\n\t}\n\n\treturn $result;\n}", "protected function getDirectoryFiles($directory)\n {\n $files = [];\n foreach (Finder::create()->files()->name('*.php')->in($directory) as $file) {\n $nesting = $this->getDirectoryNesting($file, $directory);\n $files[$nesting.basename($file->getRealPath(), '.php')] = $file->getRealPath();\n }\n return $files;\n }", "public function getDirectories() {\r\n\t\tif ($this->_directories === null) {\r\n\t\t\t$this->_directories = array();\r\n\t\t\t$basePath = $this->basePath;\r\n\t\t\tif (!is_array($basePath)) {\r\n\t\t\t\t$basePath = array($basePath);\r\n\t\t\t}\r\n\t\t\tforeach($basePath as $path) {\r\n\t\t\t\t$this->_directories[$path] = array();\r\n\t\t\t\tforeach(AFileHelper::findDirectories($path) as $dir) {\r\n\t\t\t\t\t$this->_directories[$path][md5($dir)] = $dir; \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->_directories;\r\n\t}", "public function getFiles(DirectoryInterface $directory): array;", "protected function getPaths()\n {\n $directory = new RecursiveDirectoryIterator($this->getMigrationPath());\n $iterator = new RecursiveIteratorIterator($directory);\n $paths = [];\n foreach ($iterator as $info) {\n if ($info->isDir()) {\n $paths[] = $info->getPath();\n }\n }\n\n return array_unique($paths);\n }", "public function getFileTree($directory)\n {\n $directoryIterator = new \\RecursiveDirectoryIterator($directory, \\FilesystemIterator::SKIP_DOTS);\n $iterator = new \\RecursiveIteratorIterator($directoryIterator);\n $files = [];\n foreach ($iterator as $file) {\n $files[] = trim(str_replace($directory, '', $file->getPathname()), DIRECTORY_SEPARATOR);\n }\n return $files;\n }", "public function files()\n {\n if($this->collection->empty())\n {\n foreach($this->fileList() as $file)\n {\n if(!is_dir($file))\n {\n $this->files->push($file);\n $this->collection->push(new Reader($this->path . $file));\n }\n else\n {\n $this->directories->push($file);\n }\n }\n }\n\n return $this->collection->get();\n }", "public function getAll(): array\n {\n $response = $this->client->request('GET', $this->resourceUri);\n\n $json = json_decode((string)$response->getBody());\n\n $dirItemCollection = [];\n\n foreach ($json as $starredFile) {\n $dirItemCollection[] = (new DirectoryItem)->fromJson($starredFile);\n }\n\n return $dirItemCollection;\n }", "function DNUI_get_all_dir_or_files($dir, $type) {\r\n if ($type == 0) {\r\n return DNUI_get_dirs(array($dir));\r\n } else if ($type == 1) {\r\n $out = array();\r\n $arrayDirOrFile = DNUI_scan_dir($dir);\r\n foreach ($arrayDirOrFile as $key => $value) {\r\n if (!is_dir($filename)) {\r\n array_push($out, $filename);\r\n }\r\n }\r\n return $out;\r\n }\r\n return array();\r\n}", "function build_link_array($file_directory='', $web_directory='', $level=0, $links=array()) {\n\t$handle=opendir($file_directory);\n\twhile (false!==($file = readdir($handle))) { \n\t\tif ($file != \".\" && $file != \"..\") { \n\t\t\tif (file_exists($file_directory.$file) && !is_file($file_directory.$file)) {\n\t\t\t\t$foo = array($level, 'folder', $file);\n\t\t\t\tarray_push($links, $foo);\n\t\t\t\t$links = build_link_array($file_directory.$file.'/', $web_directory.$file.'/', $level+1, $links );\n\t\t\t} else {\n\t\t\t\t$foo = array($level, $web_directory.$file, $file);\n\t\t\t\tarray_push($links, $foo);\n\t\t\t}\n\t\t} \n\t} \n\tclosedir($handle); \n\treturn $links;\n}", "public function all($path)\n {\n $path = $path ? $path : getenv(\"HOME\");\n\n $files = collect((\\File::files($path)))\n ->values()\n ->map(function($file){\n return [\n 'path' => $file, \n 'size'=>\\File::size($file),\n 'lastModified' => \\File::lastmodified($file)];\n });\n\n $dirs = collect(\\File::directories($path))\n ->map(function($dir){\n return [\n 'path' => $dir,\n 'lastModified' => \\File::lastmodified($dir)\n ];\n });\n\n $parentDir = \\File::exists(\\File::dirname($path)) ? \\File::dirname($path) : false;\n\n return compact('dirs', 'files', 'parentDir', 'path');\n }", "public function getDirContent(){\n $files = [\n 'errors' => '',\n 'path' => $this->path,\n 'value' => []\n ];\n\n //if it's not a dir then return error\n if(!$this->isDir) {\n $files['errors'] = 'Only dir may include files';\n return $files;\n }\n\n $dir = opendir($this->path);\n\n //read content of dir\n while($file = readdir($dir)){\n if(in_array($file, $this->exclude))\n continue;\n\n $files['value'][] = $this->getFileInfo($file, ($this->path).$file);\n }\n\n return $files;\n }", "function getDirContents($dir)\n{\n $handle = opendir($dir);\n if (!$handle)\n return array();\n $contents = array();\n while ($entry = readdir($handle)) {\n if ($entry == '.' || $entry == '..')\n continue;\n \n $entry = $dir . DIRECTORY_SEPARATOR . $entry;\n if (is_file($entry)) {\n $contents[] = $entry;\n } else if (is_dir($entry)) {\n $contents = array_merge($contents, getDirContents($entry));\n }\n }\n closedir($handle);\n return $contents;\n}", "function get_image_directory_list ($directory, $file=true) {\n $d = dir ($directory);\n $list = array();\n while ($entry = $d->read() ) {\n if ($file == true) { // We want a list of files, not directories\n $parts_array = explode ('.', $entry);\n $extension = $parts_array[1];\n // Don't add files or directories that we don't want\n if ($entry != '.' && $entry != '..' && $entry != '.htaccess' && $extension != 'php') {\n if (!is_dir ($directory . \"/\" . $entry) ) {\n $list[] = $entry;\n }\n }\n } else { // We want the directories and not the files\n if (is_dir ($directory . \"/\" . $entry) && $entry != '.' && $entry != '..') {\n $list[] = array ('id' => $entry,\n 'text' => $entry\n );\n }\n }\n }\n $d->close();\n return $list;\n}", "protected function detectDirectoryChildren()\n\t{\n\t\t$children = array();\n\n\t\tforeach (new DirectoryIterator($this->resource) as $file)\n\t\t{\n\t\t\tif ($file->isDir() and ! $file->isDot())\n\t\t\t{\n\t\t\t\t$resource = new DirectoryResource($file->getRealPath(), $this->files);\n\n\t\t\t\t$children[$resource->getKey()] = $resource;\n\t\t\t}\n\t\t\telseif ($file->isFile())\n\t\t\t{\n\t\t\t\t$resource = new FileResource($file->getRealPath(), $this->files);\n\n\t\t\t\t$children[$resource->getKey()] = $resource;\n\t\t\t}\n\t\t}\n\n\t\treturn $children;\n\t}", "function getGitDirectoriesList($directory)\n{\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory);\n // open directory and walk through the filenames\n while ($file = readdir($handler)) {\n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\" && strpos($file, \".git\")) {\n $results[] = $file;\n }\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n}", "public function get_file_list() {\n\t\tset_time_limit( 0 );\n\n\t\t$this->image_dir = self::_add_trailing_slash( $this->image_dir );\n\n\t\tif ( is_dir( $this->image_dir ) ) {\n $result = array();\n\t\t\t$iterator = new \\RecursiveDirectoryIterator( $this->image_dir, \\FileSystemIterator::SKIP_DOTS );\n\t\t\t$iterator = new \\RecursiveIteratorIterator( $iterator );\n\t\t\t$iterator = new \\RegexIterator( $iterator, '/^.+\\.(jpe?g|png|gif|svg)$/i', \\RecursiveRegexIterator::MATCH );\n\n\t\t\tforeach ( $iterator as $info ) {\n\t\t\t if ( $info->isFile() ) {\n $result[] = $info->getPathname();\n }\n\t\t\t}\n\n\t\t\tunset( $iterator );\n\t\t} else {\n $result = false;\n }\n\n\t\treturn $result;\n\t}", "public function getPaths()\n {\n $out = array();\n $pluginsDir = $this->baseDir . '/modules';\n foreach (scandir($pluginsDir) as $f) {\n if ($f[0] != '.' && is_dir($pluginsDir . '/' . $f)) {\n $out[$f] = realpath($pluginsDir . '/' . $f);\n }\n }\n return $out;\n }", "function getFilesInDir($dirname, $path_return = ''){\n if( !is_dir($dirname) ){\n return false;\n }\n // On ouvre le dossier\n $dir = opendir($dirname);\n // Init du tableau\n $files = array();\n // On liste les fichier\n while($file = readdir($dir)){\n if($file != '.' && $file != '..' && !is_dir($dirname.$file) && $file != ' '){\n $files[$file] = $path_return . $file;\n }\n }\n // On ferme le dossier\n closedir($dir);\n // On retourne les fichiers\n return $files;\n}", "protected function _readDirectoryRecursive($content_dir) {\n\t\t$Found = array();\n\t\t$content_dir = rtrim($content_dir, '/') . '/';\n\t\tif(is_dir($content_dir)) {\n\t\t\ttry {\n\t\t\t\t$Resource = opendir($content_dir);\n\t\t\t\twhile(false !== ($Item = readdir($Resource))) {\n\t\t\t\t\t$preg_result = array();\n\t\t\t\t\tif($Item == \".\" || $Item == \"..\" || preg_match_all('/^[\\.-]+.*$/i', $Item, $preg_result, PREG_SET_ORDER) > 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(is_dir($content_dir . $Item)) {\n\t\t\t\t\t\t$Found[] = $content_dir . $Item;\n\t\t\t\t\t\t$Found[] = $this->_readDirectoryRecursive($content_dir . $Item);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$Found[] = $content_dir . $Item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch(Exception $e) {}\t\t\n\t\t}\n\t\treturn $Found;\t\t\n\t}", "function getPathArray($mixedPath) {\r\n\t$toReturn = array();\r\n\t\r\n\t$matchResult = preg_match('/^[\\\\\\\\|\\/]+/', $mixedPath);\r\n\t\r\n\tif ($matchResult != 0) {\r\n\t\t$toReturn[] = DS; // add / or \\ to beginning of path if that is intended.\r\n\t}\r\n\t\r\n\t$splitPath = spliti('[/\\]', $mixedPath);\r\n\t\r\n\tfor ($i = 0; $i < count($splitPath)-1; ++$i) {\r\n\t\t$toReturn[] = $splitPath[$i]; // add all the directories minus the filename.\r\n\t}\r\n\t\r\n\treturn $toReturn;\r\n}", "function directory_list($directory_base_path, $filter_dir = false, $filter_files = false, $exclude = \".|..|.DS_Store|.svn\", $recursive = true)\r\n\t{\r\n\t\t$directory_base_path = rtrim($directory_base_path, \"/\") . \"/\";\r\n\r\n\t\tif ( !is_dir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"File at: $directory_base_path is not a directory.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$result_list = array();\r\n\t\t$exclude_array = explode(\"|\", $exclude);\r\n\r\n\t\tif ( !$folder_handle = opendir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"Could not open directory at: $directory_base_path\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile ( false !== ($filename = readdir($folder_handle)) )\r\n\t\t\t{\r\n\t\t\t\tif ( !in_array($filename, $exclude_array) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( is_dir($directory_base_path . $filename . \"/\") )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( $recursive && strcmp($filename, \".\") != 0 && strcmp($filename, \"..\") != 0 )\r\n\t\t\t\t\t\t{ // prevent infinite recursion\r\n\t\t\t\t\t\t\terror_log($directory_base_path . $filename . \"/\");\r\n\t\t\t\t\t\t\t$result_list[$filename] = $this->directory_list(\"$directory_base_path$filename/\", $filter_dir, $filter_files, $exclude, $recursive);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telseif ( !$filter_dir )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ( !$filter_files )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($folder_handle);\r\n\t\t\treturn $result_list;\r\n\t\t}\r\n\t}", "function print_dir_contents($dir_path, $parent_dir)\r\n{\r\n if (is_null($parent_dir)) {\r\n $dir_contents = glob(\"*\");\r\n } else {\r\n $dir_contents = glob(\"$dir_path/*\");\r\n }\r\n\r\n foreach ($dir_contents as $item) {\r\n if (is_dir($item)): ?>\r\n <li><a href=\"<?=$item?>\"><?=$item?>/</a></li>\r\n <ul>\r\n <?php print_dir_contents($item, $dir_path); ?>\r\n </ul>\r\n <?php else: ?>\r\n <li><a href=\"<?=$item?>\"><?=str_replace($dir_path . '/', '', $item)?></a></li>\r\n <?php endif;\r\n }\r\n}", "public function traverse($path = '.')\n {\n $path_list = glob($path.'/*', GLOB_ONLYDIR);\n \n $this->_dirlist[$path] = glob($path.'/*'); \n \n if ( empty ($path_list) )\n {\n \t \treturn;\t\n }\n else\n {\n \tforeach ( $path_list as $key => $value ) \n \t{\n \t\tif ($path !== '.') \n \t\t{\n \t\t\t//just the child dirs\n \t\t\t$this->traverse($path.'/'. substr($value, strlen($path)+1 ) );\n \t\t} \n \t\telse \n \t\t{\n \t\t\t$this->traverse($value);\n \t\t}\n \t} \t\n } \t\n }", "function folderContent($path)\n\t\t{\n\t\t\t$myDirectory = opendir($path);\n\t\t\t\n\t\t\t$dirArray = array();\n\t\t\t\n\t\t\t// get each entry\n\t\t\twhile($entryName = readdir($myDirectory)) \n\t\t\t{\n\t\t\t\tif($entryName != '.' && $entryName != '..' && $entryName != '.svn')\n\t\t\t\t{\n\t\t\t\t\t$info = pathinfo($path.'/'.$entryName);\n\t\t\t\t\t$stat = stat($path.'/'.$entryName);\n\t\t\t\t\t\n\t\t\t\t\t$obj = array\n\t\t\t\t\t(\n\t\t\t\t\t\t'baseName'=>$info['basename'],\n\t\t\t\t\t\t'extension'=>$info['extension'],\n\t\t\t\t\t\t'fileName'=>$info['filename'],\n\t\t\t\t\t\t'atime' =>date('d-m-Y H:i:s',$stat['atime']),\n\t\t\t\t\t\t'mtime'=> date('d-m-Y H:i:s',$stat['mtime'])\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$dirArray[$info['basename']] = $obj;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// close directory\n\t\t\tclosedir($myDirectory);\n\t\t\tsort($dirArray);\n\t\t\treturn $dirArray;\n\n\t\t}", "protected function getFilesInDirCreateTestDirectory() {}", "function files_in_cur_dir($ftp,$depth = 1)\n{ \n //error_log(\"Getting data from \".ftp_pwd($ftp));\n $files = array();\n foreach(ftp_rawlist($ftp, '-A') as $file) {\n $temp_file = parse_raw_element($file);\n\n //we get the date out here because we want it in a different\n //format than what we get from rawlist\n $date = ftp_mdtm($ftp,$temp_file[FILE_NAME]);\n $date = ($date===-1 ? false : date('Y-m-d\\TH:i:sP',$date).\"\");\n $temp_file[DATE] = $date;\n\n\t\tif($temp_file[FILE_TYPE] === \"dir\" && $depth > 0 ) {\n //if current element is a directory and we have a non-zero\n //recursion level, then get recur and get subdirectory\n //info\n $child_content = array();\n if(@ftp_chdir($ftp, $temp_file[FILE_NAME]))\n {\n // if we can access the folder get the info inside\n $child_content = files_in_cur_dir($ftp,$depth - 1);\n ftp_cdup($ftp);\n }\n $temp_file[FOLDER_CONTENT] = $child_content;\n\t\t}\n // push most recent file into file array\n $files[] = $temp_file;\n\t}\n return $files;\n}", "function sloodle_get_subdirectories($dir, $relative = true)\n {\n // Make sure we have a valid directory\n if (empty($dir)) return false;\n // Open the directory\n if (!is_dir($dir)) return false;\n if (!$dh = opendir($dir)) return false;\n \n // Go through each item\n $output = array();\n while (($file = readdir($dh)) !== false) {\n // Ignore anything starting with a . and anything which isn't a directory\n if (strpos($file, '.') == 0) continue;\n $filetype = @filetype($dir.'/'.$file);\n if (empty($filetype) || $filetype != 'dir') continue;\n \n // Store it\n if ($relative) $output[] = $file;\n else $output[] = $dir.'/'.$file;\n }\n closedir($dh);\n natcasesort($output);\n return $output;\n }", "function get_files ($folder, $include_subs = FALSE) {\n\tif(substr($folder, -1) == '/') {\n\t\t$folder = substr($folder, 0, -1);\n\t}\n\n\t// Make sure a valid folder was passed\n\tif(!file_exists($folder) || !is_dir($folder) || !is_readable($folder)) {\n\t\treturn FALSE;\n\t\texit();\n\t}\n\n\t// Grab a file handle\n\t$all_files = FALSE;\n\tif($handle = opendir($folder))\t{\n\t\t$all_files = array();\n\t\t// Start looping through a folder contents\n\t\twhile ($file = @readdir ($handle)) {\n\t\t\t// Set the full path\n\t\t\t$path = $folder.'/'.$file;\n\n\t\t\t// Filter out this and parent folder\n\t\t\tif($file != '.' && $file != '..') {\n\t\t\t\t// Test for a file or a folder\n\t\t\t\tif(is_file($path)) {\n\t\t\t\t\t$all_files[] = $path;\n\t\t\t\t} elseif (is_dir($path) && $include_subs) {\n\t\t\t\t\t// Get the subfolder files\n\t\t\t\t\t$subfolder_files = get_files ($path, TRUE);\n\n\t\t\t\t\t// Anything returned\n\t\t\t\t\tif ($subfolder_files) {\n\t\t\t\t\t\t$all_files = array_merge($all_files, $subfolder_files);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Cleanup\n\n\t\tclosedir($handle);\n\t}\n\t// Return the file array\n\t@sort($all_files);\n\treturn $all_files;\n}", "private static function list_directories_in_path( array $path, $root ) {\n\t\tif ( 0 === count( $path ) ) {\n\t\t\treturn API_Facade::list_directories(\n\t\t\t\t$root,\n\t\t\t\tnew API_Fields( array( 'name' ) ),\n\t\t\t\tnew Single_Page_Pagination_Helper()\n\t\t\t)->then(\n\t\t\t\tstatic function ( $directories ) {\n\t\t\t\t\treturn array_column( $directories, 'name' );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn API_Facade::get_directory_id( $root, $path[0] )->then(\n\t\t\tstatic function ( $next_dir_id ) use ( $path ) {\n\t\t\t\tarray_shift( $path );\n\n\t\t\t\treturn self::list_directories_in_path( $path, $next_dir_id );\n\t\t\t}\n\t\t);\n\t}", "function readSubFolders($dir, $ignore_dots = true)\n{\n $folder = readFolder($dir);\n $folders = array ();\n\n if (!$folder) {\n return false;\n }\n\n foreach ($folder as $file) {\n if ($ignore_dots && ($file == '.' || $file == '..')) {\n continue;\n }\n if (is_dir($dir . '/' . $file)) {\n $folders[] = $file;\n }\n }\n\n return $folders;\n}" ]
[ "0.74845445", "0.7245163", "0.7200864", "0.69663507", "0.696277", "0.69551754", "0.68972117", "0.68869925", "0.6854776", "0.680406", "0.6762117", "0.6629779", "0.6618723", "0.66186637", "0.6615637", "0.6586497", "0.65842015", "0.6561128", "0.65523094", "0.65509766", "0.6523078", "0.65039396", "0.65010566", "0.6491177", "0.6490462", "0.64850694", "0.648037", "0.6477052", "0.6477003", "0.64708275", "0.64682245", "0.64539516", "0.64520365", "0.6450296", "0.6423923", "0.6418796", "0.6413085", "0.6405102", "0.63964176", "0.6389223", "0.6388194", "0.6384722", "0.63820297", "0.6378169", "0.63757837", "0.6359208", "0.6349671", "0.6345342", "0.633812", "0.6332112", "0.6326071", "0.6321226", "0.6304461", "0.63013864", "0.63006294", "0.62988764", "0.62978804", "0.6296353", "0.62814236", "0.62701976", "0.62685776", "0.62649745", "0.6253214", "0.6244625", "0.6237038", "0.62301314", "0.6228371", "0.62268436", "0.6222588", "0.62204444", "0.62170875", "0.6215274", "0.62129676", "0.62114424", "0.62083405", "0.62063175", "0.6204874", "0.6199612", "0.6194745", "0.6190907", "0.618848", "0.61880577", "0.6185453", "0.6180836", "0.6180668", "0.61794066", "0.61612517", "0.6161246", "0.6160068", "0.6153969", "0.61518097", "0.61509335", "0.6147434", "0.61453736", "0.61413085", "0.61249965", "0.6121372", "0.6119777", "0.6118665", "0.61141324" ]
0.66775525
11
Constructs new message container and clears its internal state
public function __construct() { $this->reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clear()\n {\n $this->messages = [];\n }", "public function clear(){\r\n\t\t$this->_init_messages();\r\n\t}", "public function clearMessages()\n {\n $this->_messages = array();\n return $this;\n }", "public function clear(): void\n {\n $this->messages = [];\n }", "public function\n\tclearMessages()\n\t{\n\t\t$this -> m_aStorage = [];\n\t}", "public function clear(){\n\t\t$this->stack = array();\n\t\t$this->messages = array();\n\t\treturn $this;\n\t}", "public function clear()\r\n {\r\n $this->messages->clear();\r\n }", "public function clear_messages() {\n\t\t$this->_write_messages( null );\n\t}", "public function reset()\n {\n $this->messages = [];\n }", "function clearContainer()\r\n {\r\n foreach ($this->container as $k => $v)\r\n unset($this->container[$k]);\r\n }", "public function clearMessage()\n {\n $this->setMessage(null);\n $this->clearFormState();\n return $this;\n }", "protected function constructEmpty()\r\n\t{\r\n\t\t$this->transitionCount = 0;\r\n\t\t$this->transitions = array();\r\n\t\t// TODO: this should probably contain at least one item\r\n\t\t$this->types = array();\r\n\t}", "public function __destruct()\n\t{\n\t\t\\Message::reset();\t\n\t}", "public function reset()\n {\n $this->values[self::MESSAGE] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "protected function createBag()\n\t{\n\t\t$this->bag = new MessageBag;\n\n\t\t// Are there any default errors, from a form validator for example?\n\t\tif ($this->session->has('errors'))\n\t\t{\n\t\t\t$errors = $this->session->get('errors')->all(':message');\n\n\t\t\t$this->bag->merge(['error' => $errors]);\n\t\t}\n\n\t\t// Do we have any flashed messages already?\n\t\tif ($this->session->has($this->sessionKey))\n\t\t{\n\t\t\t$this->bag->merge(json_decode($this->session->get($this->sessionKey), true));\n\t\t}\n\t}", "protected static function newMessage()\n {\n self::$message = \\Swift_Message::newInstance();\n }", "function clear()\n\t{\n\t\t$this->to \t\t= '';\n\t\t$this->from \t= '';\n\t\t$this->reply_to\t= '';\n\t\t$this->cc\t\t= '';\n\t\t$this->bcc\t\t= '';\n\t\t$this->subject \t= '';\n\t\t$this->message\t= '';\n\t\t$this->debugger = '';\n\t}", "public function reset()\n {\n $this->_to = array();\n $this->_headers = array();\n $this->_subject = null;\n $this->_message = null;\n $this->_wrap = 78;\n $this->_params = null;\n $this->_attachments = array();\n $this->_uid = $this->getUniqueId();\n return $this;\n }", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function __destruct() {\n $this->flushMessages();\n }", "public function clear()\n {\n $this->fromArray(array());\n }", "public function initMessage() {}", "protected function initializeMessages()\n {\n $this->messages = array(\n \n );\n }", "public function clearContent()\n {\n $this->content = array();\n\n return $this;\n }", "public function clear_content(){\n\t\t$this->content=array();\n\t\treturn $this;\n\t}", "public function clear()\n {\n if (null !== $this->getDraft()) {\n $this->getDraft()->clear();\n } else {\n $this->_subcontent->clear();\n $this->subcontentmap = array();\n $this->_data = array();\n $this->index = 0;\n }\n }", "public function __construct()\n\t{\n\t\t$this->clear();\n\t}", "public function reset()\n {\n $this->values[self::_SAY] = null;\n $this->values[self::_FRESH] = null;\n $this->values[self::_FETCH] = null;\n $this->values[self::_CHAT_ADD_BL] = null;\n $this->values[self::_CHAT_DEL_BL] = null;\n $this->values[self::_CHAT_BLACKLIST] = null;\n $this->values[self::_CHAT_BORAD_SAY] = null;\n }", "protected function emptyMessagesFromSession()\n {\n $this->session->set('messages', null);\n }", "protected function clearMessageBody()\n {\n $this->messageBody = '';\n \n if ($this->isHeaderSet(self::CONTENT_LENGTH_HEADER))\n {\n $this->removeHeader(self::CONTENT_LENGTH_HEADER);\n }\n }", "public function delete_messages()\n {\n $this->message=array();\n Session::instance()->delete(\"hana_message\");\n }", "public function __destruct() {\n foreach ($this->_messages as $key => $message) {\n unset($this->_messages[$key]);\n $message->close();\n }\n\n $this->_stream->stop();\n }", "protected function _init()\n {\n global $injector, $notification, $prefs, $registry;\n\n /* The message text and headers. */\n $expand = array();\n $header = array(\n 'to' => '',\n 'cc' => '',\n 'bcc' => ''\n );\n $msg = '';\n $this->title = _(\"Compose Message\");\n\n /* Get the list of headers to display. */\n $display_hdrs = array(\n 'to' => _(\"To: \"),\n 'cc' => _(\"Cc: \"),\n 'bcc' => (\"Bcc: \")\n );\n\n /* Set the current identity. */\n $identity = $injector->getInstance('IMP_Identity');\n if (!$prefs->isLocked('default_identity') &&\n isset($this->vars->identity)) {\n $identity->setDefault($this->vars->identity);\n }\n\n /* Determine if mailboxes are readonly. */\n $drafts = IMP_Mailbox::getPref(IMP_Mailbox::MBOX_DRAFTS);\n $readonly_drafts = $drafts && $drafts->readonly;\n $sent_mail = $identity->getValue(IMP_Mailbox::MBOX_SENT);\n $save_sent_mail = (!$sent_mail || $sent_mail->readonly)\n ? false\n : $prefs->getValue('save_sent_mail');\n\n /* Determine if compose mode is disabled. */\n $compose_disable = !IMP_Compose::canCompose();\n\n /* Initialize objects. */\n $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($this->vars->composeCache);\n\n /* Are attachments allowed? */\n $attach_upload = $imp_compose->canUploadAttachment();\n\n foreach (array_keys($display_hdrs) as $val) {\n $header[$val] = $this->vars->$val;\n\n /* If we are reloading the screen, check for expand matches. */\n if ($this->vars->composeCache) {\n $expanded = array();\n for ($i = 0; $i < 5; ++$i) {\n if ($tmp = $this->vars->get($val . '_expand_' . $i)) {\n $expanded[] = $tmp;\n }\n }\n if (!empty($expanded)) {\n $header['to'] = strlen($header['to'])\n ? implode(', ', $expanded) . ', ' . $header['to']\n : implode(', ', $expanded);\n }\n }\n }\n\n /* Add attachment. */\n if ($attach_upload &&\n isset($_FILES['upload_1']) &&\n strlen($_FILES['upload_1']['name'])) {\n try {\n $atc_ob = $imp_compose->addAttachmentFromUpload('upload_1');\n if ($atc_ob[0] instanceof IMP_Compose_Exception) {\n throw $atc_ob[0];\n }\n if ($this->vars->a == _(\"Expand Names\")) {\n $notification->push(sprintf(_(\"Added \\\"%s\\\" as an attachment.\"), $atc_ob[0]->getPart()->getName()), 'horde.success');\n }\n } catch (IMP_Compose_Exception $e) {\n $this->vars->a = null;\n $notification->push($e, 'horde.error');\n }\n }\n\n /* Run through the action handlers. */\n switch ($this->vars->a) {\n // 'd' = draft\n // 'en' = edit as new\n // 't' = template\n case 'd':\n case 'en':\n case 't':\n try {\n switch ($this->vars->a) {\n case 'd':\n $result = $imp_compose->resumeDraft($this->indices, array(\n 'format' => 'text'\n ));\n $this->view->resume = true;\n break;\n\n case 'en':\n $result = $imp_compose->editAsNew($this->indices, array(\n 'format' => 'text'\n ));\n break;\n\n case 't':\n $result = $imp_compose->useTemplate($this->indices, array(\n 'format' => 'text'\n ));\n break;\n }\n\n $msg = $result['body'];\n $header = array_merge(\n $header,\n $this->_convertToHeader($result)\n );\n if (!is_null($result['identity']) &&\n ($result['identity'] != $identity->getDefault()) &&\n !$prefs->isLocked('default_identity')) {\n $identity->setDefault($result['identity']);\n $sent_mail = $identity->getValue(IMP_Mailbox::MBOX_SENT);\n }\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e);\n }\n break;\n\n case _(\"Expand Names\"):\n foreach (array_keys($display_hdrs) as $val) {\n if (($val == 'to') || ($this->vars->action != 'rc')) {\n $res = $this->_expandAddresses($header[$val]);\n if (is_string($res)) {\n $header[$val] = $res;\n } else {\n $header[$val] = $res[0];\n $expand[$val] = array_slice($res, 1);\n }\n }\n }\n\n if (isset($this->vars->action)) {\n $this->vars->a = $this->vars->action;\n }\n break;\n\n // 'r' = reply\n // 'rl' = reply to list\n // 'ra' = reply to all\n case 'r':\n case 'ra':\n case 'rl':\n $actions = array(\n 'r' => IMP_Compose::REPLY_SENDER,\n 'ra' => IMP_Compose::REPLY_ALL,\n 'rl' => IMP_Compose::REPLY_LIST\n );\n\n try {\n $reply_msg = $imp_compose->replyMessage(\n $actions[$this->vars->a],\n $this->_getContents(),\n array(\n 'format' => 'text',\n 'to' => $header['to']\n )\n );\n } catch (IMP_Exception $e) {\n $notification->push($e, 'horde.error');\n break;\n }\n\n $header = $this->_convertToHeader($reply_msg);\n\n $notification->push(_(\"Reply text will be automatically appended to your outgoing message.\"), 'horde.message');\n $this->title = _(\"Reply\");\n break;\n\n // 'f' = forward\n case 'f':\n try {\n $fwd_msg = $imp_compose->forwardMessage(\n IMP_Compose::FORWARD_ATTACH,\n $this->_getContents(),\n false\n );\n } catch (IMP_Exception $e) {\n $notification->push($e, 'horde.error');\n break;\n }\n\n $header = $this->_convertToHeader($fwd_msg);\n\n $notification->push(_(\"Forwarded message will be automatically added to your outgoing message.\"), 'horde.message');\n $this->title = _(\"Forward\");\n break;\n\n // 'rc' = redirect compose\n case 'rc':\n $imp_compose->redirectMessage($this->indices);\n $this->title = _(\"Redirect\");\n break;\n\n case _(\"Redirect\"):\n try {\n $num_msgs = $imp_compose->sendRedirectMessage($header['to']);\n $imp_compose->destroy('send');\n\n $notification->push(ngettext(\"Message redirected successfully.\", \"Messages redirected successfully.\", count($num_msgs)), 'horde.success');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n } catch (Horde_Exception $e) {\n $this->vars->a = 'rc';\n $notification->push($e);\n }\n break;\n\n case _(\"Save Draft\"):\n case _(\"Send\"):\n switch ($this->vars->a) {\n case _(\"Save Draft\"):\n if ($readonly_drafts) {\n break 2;\n }\n break;\n\n case _(\"Send\"):\n if ($compose_disable) {\n break 2;\n }\n break;\n }\n\n $message = strval($this->vars->message);\n $f_to = $header['to'];\n $old_header = $header;\n $header = array();\n\n switch ($imp_compose->replyType(true)) {\n case IMP_Compose::REPLY:\n try {\n $reply_msg = $imp_compose->replyMessage(IMP_Compose::REPLY_SENDER, $imp_compose->getContentsOb(), array(\n 'to' => $f_to\n ));\n $msg = $reply_msg['body'];\n } catch (IMP_Exception $e) {\n $notification->push($e, 'horde.error');\n $msg = '';\n }\n $message .= \"\\n\" . $msg;\n break;\n\n case IMP_Compose::FORWARD:\n try {\n $fwd_msg = $imp_compose->forwardMessage(IMP_Compose::FORWARD_ATTACH, $imp_compose->getContentsOb());\n $msg = $fwd_msg['body'];\n } catch (IMP_Exception $e) {\n $notification->push($e, 'horde.error');\n }\n $message .= \"\\n\" . $msg;\n break;\n }\n\n try {\n $header['from'] = strval($identity->getFromLine(null, $this->vars->from));\n } catch (Horde_Exception $e) {\n $header['from'] = '';\n }\n $header['replyto'] = $identity->getValue('replyto_addr');\n $header['subject'] = strval($this->vars->subject);\n\n foreach (array_keys($display_hdrs) as $val) {\n $header[$val] = $old_header[$val];\n }\n\n switch ($this->vars->a) {\n case _(\"Save Draft\"):\n try {\n $notification->push($imp_compose->saveDraft($header, $message), 'horde.success');\n if ($prefs->getValue('close_draft')) {\n $imp_compose->destroy('save_draft');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n }\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e);\n }\n break;\n\n case _(\"Send\"):\n try {\n $imp_compose->buildAndSendMessage(\n $message,\n $header,\n $identity,\n array(\n 'readreceipt' => ($prefs->getValue('request_mdn') == 'always'),\n 'save_sent' => $save_sent_mail,\n 'sent_mail' => $sent_mail\n )\n );\n $imp_compose->destroy('send');\n\n $notification->push(_(\"Message sent successfully.\"), 'horde.success');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e);\n\n /* Switch to tied identity. */\n if (!is_null($e->tied_identity)) {\n $identity->setDefault($e->tied_identity);\n $notification->push(_(\"Your identity has been switched to the identity associated with the current recipient address. The identity will not be checked again during this compose action.\"));\n }\n }\n break;\n }\n break;\n\n case _(\"Cancel\"):\n $imp_compose->destroy('cancel');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n exit;\n\n case _(\"Discard Draft\"):\n $imp_compose->destroy('discard');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n exit;\n }\n\n /* Grab any data that we were supplied with. */\n if (empty($msg)) {\n $msg = strval($this->vars->message);\n }\n if (empty($header['subject'])) {\n $header['subject'] = strval($this->vars->subject);\n }\n\n $this->view->cacheid = $imp_compose->getCacheId();\n $this->view->hmac = $imp_compose->getHmac();\n $this->view->menu = $this->getMenu('compose');\n $this->view->url = self::url();\n $this->view->user = $registry->getAuth();\n\n switch ($this->vars->a) {\n case 'rc':\n $this->_pages[] = 'redirect';\n $this->_pages[] = 'menu';\n unset($display_hdrs['cc'], $display_hdrs['bcc']);\n break;\n\n default:\n $this->_pages[] = 'compose';\n $this->_pages[] = 'menu';\n\n $this->view->compose_enable = !$compose_disable;\n $this->view->msg = $msg;\n $this->view->save_draft = ($injector->getInstance('IMP_Factory_Imap')->create()->access(IMP_Imap::ACCESS_DRAFTS) && !$readonly_drafts);\n $this->view->subject = $header['subject'];\n\n $select_list = $identity->getSelectList();\n $default_identity = $identity->getDefault();\n\n if ($prefs->isLocked('default_identity')) {\n $select_list = array(\n $default_identity => $select_list[$default_identity]\n );\n }\n\n $tmp = array();\n foreach ($select_list as $key => $val) {\n $tmp[] = array(\n 'key' => $key,\n 'sel' => ($key == $default_identity),\n 'val' => $val\n );\n }\n $this->view->identities = $tmp;\n\n if ($attach_upload) {\n $this->view->attach = true;\n if (count($imp_compose)) {\n $atc_part = $imp_compose[0]->getPart();\n $this->view->attach_name = $atc_part->getName();\n $this->view->attach_size = IMP::sizeFormat($atc_part->getBytes());\n $this->view->attach_type = $atc_part->getType();\n }\n }\n\n $this->title = _(\"Message Composition\");\n }\n\n $hdrs = array();\n foreach ($display_hdrs as $key => $val) {\n $tmp = array(\n 'key' => $key,\n 'label' => $val,\n 'val' => $header[$key]\n );\n\n if (isset($expand[$key])) {\n $tmp['matchlabel'] = (count($expand[$key][1]) > 5)\n ? sprintf(_(\"Ambiguous matches for \\\"%s\\\" (first 5 matches displayed):\"), $expand[$key][0])\n : sprintf(_(\"Ambiguous matches for \\\"%s\\\":\"), $expand[$key][0]);\n\n $tmp['match'] = array();\n foreach ($expand[$key][1] as $key2 => $val2) {\n if ($key2 == 5) {\n break;\n }\n $tmp['match'][] = array(\n 'id' => $key . '_expand_' . $key2,\n 'val' => $val2\n );\n }\n }\n\n $hdrs[] = $tmp;\n }\n\n $this->view->hdrs = $hdrs;\n $this->view->title = $this->title;\n }", "public static function reset()\n {\n $container = static::getInstance();\n $container->values = array();\n $container->factories = array();\n $container->raw = array();\n }", "public function resetMessage() {\n self::$message = '';\n }", "public function reset()\n {\n $this->to = [];\n $this->from = [];\n $this->sender = [];\n $this->replyTo = [];\n $this->readReceipt = [];\n $this->returnPath = [];\n $this->cc = [];\n $this->bcc = [];\n $this->messageId = true;\n $this->subject = '';\n $this->headers = [];\n $this->textMessage = '';\n $this->htmlMessage = '';\n $this->message = [];\n $this->emailFormat = static::MESSAGE_TEXT;\n $this->priority = null;\n $this->charset = 'utf-8';\n $this->headerCharset = null;\n $this->transferEncoding = null;\n $this->attachments = [];\n $this->emailPattern = static::EMAIL_PATTERN;\n\n return $this;\n }", "public function reset()\n {\n $this->cbuff = [];\n }", "public function reset()\n {\n $this->from = [];\n $this->to = [];\n $this->subject = null;\n $this->body = null;\n $this->html = true;\n }", "protected function clear() {}", "function clear() {\n\t\t\t$this->items = [];\n\t\t}", "function clear()\n {\n $this->p_size = '';\n $this->p_bidList = array();\n\n }", "public function clear()\n {\n $this->items = array();\n $this->length = 0;\n\n return $this;\n }", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "public function clear()\n {\n $this->_data = [];\n }", "public function clearMsg() {\n\t\t$_SESSION['msg'] = null;\n\t}", "public function clear() {\n $this->_data = [];\n }", "public function __construct() {\n $this->messages = CommonFacade::getMessages();\n }", "public function __construct() {\n $this->messages = CommonFacade::getMessages();\n }", "public function clear ()\n {\n\n $this->groups = null;\n $this->groups = array();\n $this->names = null;\n $this->names = array();\n\n }", "public function clear() {\n\t\t$this->array = array();\n\t}", "public static function clear()\n {\n self::$actionList = new \\SplPriorityQueue();\n self::$errors = [];\n self::$warnings = [];\n }", "public function clear () {\n \n }", "public function clearState()\n {\n $this->fields = array();\n }", "public function __destruct() {\r\n\t\t\t$_SESSION['mod_messages'] = $this->messages;\r\n\t\t}", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_ACCESSORY] = null;\n }", "public function reset()\n {\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_SPEAKER_UID] = null;\n $this->values[self::_SPEAKER_SUMMARY] = null;\n $this->values[self::_TARGET_UID] = null;\n $this->values[self::_TARGET_SUMMARY] = null;\n $this->values[self::_SPEAKER_POST] = null;\n $this->values[self::_SPEAK_TIME] = null;\n $this->values[self::_CONTENT_TYPE] = null;\n $this->values[self::_CONTENT] = null;\n }", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function __destruct()\n {\n if ($this->cache) {\n $this->cache->setItem(self::CACHE_KEY, $this->messagesWritten);\n }\n }", "function Clear()\r\n {\r\n $this->_items = array();\r\n }", "public function clear(): self;", "function clear()\r\n\t\t{\r\n\t\t\t$this->elements = array();\r\n\t\t}", "public function clear()\n {\n $this->items = array();\n $this->itemsCount = 0;\n }", "public static function clear()\n {\n self::$context = new Context();\n self::$macros = array();\n self::$citationItem = false;\n self::$context = new Context();\n self::$rendered = new Rendered();\n self::$bibliography = null;\n self::$citation = null;\n\n self::setLocale(Factory::locale());\n self::$locale->readFile();\n }", "public function clear() {\n $this->collection = [];\n $this->noteCollectionChanged();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function Clear()\n {\n $this->items = array();\n }", "public function clear(): void\n {\n $this->bufferSize = 0;\n $this->buffer = array();\n }", "public function cleanup(){\n\n //$this->_mail_type = 'html';\n //$this->_mail_encoding = 'utf-8';\n //$this->_transport_login = '';\n //$this->_transport = 'php';\n //$this->_transport_password = '';\n //$this->_transport_port = null;\n //$this->_transport_secure = null;\n //$this->_transport_host = null;\n $this->_lastError = null;\n $this->_subject = '';\n $this->_body = '';\n $this->_alt_body = '';\n $this->_attachements = array();\n $this->_from = '';\n $this->_fromName = null;\n $this->_replyto = array();\n $this->_addresses = array();\n $this->_cc = array();\n $this->_bcc = array();\n $this->_replyto = array();\n $this->_custom_headers = array();\n //$this->_is_embed_images = false;\n //$this->_is_track_links = false;\n //$this->_is_use_message_id = false;\n\n return $this;\n\n }", "public function clearMessages() {\n $this->connection->truncate($this->messageTable)\n ->execute();\n }", "public function __construct()\n\t{\n\t\t$this->container \t = array();\n\t\t$this->hiddenContainer = array();\n\t}", "public function clear() {\n $this->elements = array();\n }", "public function reset() {\n\t\t$this->_mailTo = array();\n\t\t$this->_mailCc = array();\n\t\t$this->_mailBcc = array();\n\t\t$this->_mailSubject = '';\n\t\t$this->_mailBody = '';\n\t\t$this->_mailReplyTo = '';\n\t\t$this->_mailReplyToName = '';\n\t\t$this->_mailFrom = '';\n\t\t$this->_mailFromName = '';\n\t\t$this->_mailFiles = array();\n\t\t$this->_mailPreparedHeaders = '';\n\t\t$this->_mailPreparedBody = '';\n\t}", "public function __construct() {\n $this->unset_members();\n }", "public function clear()\n {\n $this->items = array();\n }", "function clear()\r\n {\r\n $this->items=array();\r\n }", "private function clear()\n {\n $this->mappedQueries = [];\n $this->mappedFilters = [];\n $this->requestData = [];\n }", "public function reset()\n {\n $this->values[self::CONVERSATION] = null;\n $this->values[self::SKMSG] = null;\n $this->values[self::IMAGE] = null;\n $this->values[self::CONTACT] = null;\n $this->values[self::LOCATION] = null;\n $this->values[self::URLMSG] = null;\n $this->values[self::DOCUMENT] = null;\n $this->values[self::AUDIO] = null;\n $this->values[self::VIDEO] = null;\n $this->values[self::CALL] = null;\n $this->values[self::CHAT] = null;\n }", "public function clear()\n {\n $this->data = [];\n }", "public function clear()\n\t{\n\t\t$this->items = [];\n\t}", "public function reset() {\r\n $this->header = [];\r\n $this->cookie = [];\r\n $this->content = NULL;\r\n }", "public function clear()\n {\n $this->groups = collect();\n $this->flash();\n\n return $this;\n }", "public function updateMessageContainer(array &$form, FormStateInterface $form_state) {\n return $form['message_container'];\n }", "protected function clear()\n {\n $this->innerHtml = null;\n $this->outerHtml = null;\n $this->text = null;\n }", "public function clear(): void {\n\t\t$this->m_elements = [];\n\t}", "public function emptyErrorBag() {\n\t\t$this->errorBag = [];\n\t}", "public function clear() {\n\t}", "public function mount()\n {\n $this->messageString = '';\n $this->address = '';\n }", "public function reset()\n {\n $this->data = [];\n $this->boundary = null;\n\n return $this;\n }", "public function reset()\n {\n $this->values[self::GROUP_ID] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "public function clear()\n {\n $this->stack = [];\n\n return $this;\n }", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}" ]
[ "0.6759655", "0.6694383", "0.6664635", "0.6585841", "0.65726465", "0.65234977", "0.64330304", "0.6162081", "0.6160057", "0.59145373", "0.5856848", "0.58269936", "0.5814096", "0.5718538", "0.5714013", "0.56949586", "0.56226987", "0.55620676", "0.55460143", "0.5533074", "0.54767585", "0.54622346", "0.54509383", "0.5432905", "0.5427114", "0.5426711", "0.54264224", "0.5391426", "0.53838825", "0.5383757", "0.53516746", "0.53376824", "0.52954715", "0.5294457", "0.5288429", "0.52843916", "0.5282157", "0.52715707", "0.52697587", "0.52577966", "0.52545", "0.5227543", "0.5225791", "0.5225791", "0.5217068", "0.5214303", "0.52123237", "0.51950234", "0.51950234", "0.51911044", "0.51508814", "0.5144035", "0.5142131", "0.5119759", "0.51148516", "0.51140714", "0.5113898", "0.51109874", "0.51109874", "0.51109874", "0.51109874", "0.50991213", "0.5097356", "0.509574", "0.509275", "0.5085487", "0.5082196", "0.5077796", "0.5075996", "0.5075957", "0.5072386", "0.50718457", "0.50694686", "0.50646156", "0.5062829", "0.50535804", "0.50524104", "0.5048935", "0.5047298", "0.5046331", "0.50285727", "0.5016199", "0.5015212", "0.50056255", "0.49988136", "0.49970958", "0.49918562", "0.49892822", "0.49881718", "0.49865997", "0.4983313", "0.49798554", "0.49696144", "0.49694866", "0.4968886", "0.49683005", "0.49683005", "0.49683005", "0.49683005", "0.49683005", "0.49683005" ]
0.0
-1
Clears message values and sets default ones
public function reset() { $this->values[self::ip] = null; $this->values[self::port] = null; $this->values[self::module] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reset()\n {\n $this->values[self::MESSAGE] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "public function reset()\n {\n $this->values[self::CONVERSATION] = null;\n $this->values[self::SKMSG] = null;\n $this->values[self::IMAGE] = null;\n $this->values[self::CONTACT] = null;\n $this->values[self::LOCATION] = null;\n $this->values[self::URLMSG] = null;\n $this->values[self::DOCUMENT] = null;\n $this->values[self::AUDIO] = null;\n $this->values[self::VIDEO] = null;\n $this->values[self::CALL] = null;\n $this->values[self::CHAT] = null;\n }", "public function reset()\n {\n $this->values[self::_SAY] = null;\n $this->values[self::_FRESH] = null;\n $this->values[self::_FETCH] = null;\n $this->values[self::_CHAT_ADD_BL] = null;\n $this->values[self::_CHAT_DEL_BL] = null;\n $this->values[self::_CHAT_BLACKLIST] = null;\n $this->values[self::_CHAT_BORAD_SAY] = null;\n }", "public function reset()\n {\n $this->values[self::_PLAIN_MAIL] = null;\n $this->values[self::_FORMAT_MAIL] = null;\n }", "public function clear(){\r\n\t\t$this->_init_messages();\r\n\t}", "public function reset()\n {\n $this->values[self::_MAIL_CFG_ID] = null;\n $this->values[self::_PARAMS] = array();\n }", "public function resetMessage() {\n self::$message = '';\n }", "function clear()\n\t{\n\t\t$this->to \t\t= '';\n\t\t$this->from \t= '';\n\t\t$this->reply_to\t= '';\n\t\t$this->cc\t\t= '';\n\t\t$this->bcc\t\t= '';\n\t\t$this->subject \t= '';\n\t\t$this->message\t= '';\n\t\t$this->debugger = '';\n\t}", "public function reset()\n {\n $this->messages = [];\n }", "public function reset()\n {\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_SPEAKER_UID] = null;\n $this->values[self::_SPEAKER_SUMMARY] = null;\n $this->values[self::_TARGET_UID] = null;\n $this->values[self::_TARGET_SUMMARY] = null;\n $this->values[self::_SPEAKER_POST] = null;\n $this->values[self::_SPEAK_TIME] = null;\n $this->values[self::_CONTENT_TYPE] = null;\n $this->values[self::_CONTENT] = null;\n }", "public function reset()\n {\n $this->values[self::_LADDER_NOTIFY] = null;\n $this->values[self::_NEW_MAIL] = null;\n $this->values[self::_GUILD_CHAT] = null;\n $this->values[self::_ACTIVITY_NOTIFY] = null;\n $this->values[self::_ACTIVITY_REWARD] = null;\n $this->values[self::_RELEASE_HEROES] = array();\n $this->values[self::_EXCAV_RECORD] = null;\n $this->values[self::_GUILD_DROP] = null;\n $this->values[self::_PERSONAL_CHAT] = null;\n $this->values[self::_SPLITABLE_HEROES] = null;\n }", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_ACCESSORY] = null;\n }", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::GROUP_ID] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "function reset()\n {\n $this->fromEmail = \"\";\n $this->fromName = \"\";\n $this->fromUser = null; // RMV-NOTIFY\n $this->priority = '';\n $this->toUsers = array();\n $this->toEmails = array();\n $this->headers = array();\n $this->subject = \"\";\n $this->body = \"\";\n $this->errors = array();\n $this->success = array();\n $this->isMail = false;\n $this->isPM = false;\n $this->assignedTags = array();\n $this->template = \"\";\n $this->templatedir = \"\";\n // Change below to \\r\\n if you have problem sending mail\n $this->LE = \"\\n\";\n }", "public function clear(): void\n {\n $this->messages = [];\n }", "public function clear_messages() {\n\t\t$this->_write_messages( null );\n\t}", "public function clear()\n {\n $this->messages = [];\n }", "public function reset()\n {\n $this->values[self::_WORLDCUP_QUERY_REPLY] = null;\n $this->values[self::_WORLDCUP_SUBMIT_REPLY] = null;\n }", "public function reset()\n {\n $this->values[self::_FROM] = null;\n $this->values[self::_TITLE] = null;\n $this->values[self::_CONTENT] = null;\n }", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_WORSHIP] = null;\n $this->values[self::_DROP_INFO] = null;\n $this->values[self::_TO_CHAIRMAN] = null;\n }", "public function reset()\n {\n $this->values[self::_USER_SUMMARY] = null;\n $this->values[self::_GUILD_SUMMARY] = null;\n $this->values[self::_PARAM1] = null;\n }", "public function reset()\n\t{\n\t\t$this->method = NOTIFY_MAIL;\n\t\t$this->body = '';\n\t\t$this->subject = '';\n\t\t$this->bcc = array();\n\t\t$this->vars = array();\n\t}", "public function reset()\n {\n $this->values[self::_ITEM_ID] = null;\n $this->values[self::_RECEIVER_NAME] = null;\n $this->values[self::_SEND_TIME] = null;\n $this->values[self::_SENDER_NAME] = null;\n }", "public function clear()\r\n {\r\n $this->messages->clear();\r\n }", "public function reset()\n {\n $this->values[self::pending_pay] = null;\n $this->values[self::pending_shipped] = null;\n $this->values[self::pending_received] = null;\n $this->values[self::user_received] = null;\n $this->values[self::to_share] = null;\n }", "public function reset()\n {\n $this->values[self::_WORLD_CHAT_TIMES] = null;\n $this->values[self::_LAST_RESET_WORLD_CHAT_TIME] = null;\n $this->values[self::_BLACK_LIST] = array();\n }", "public function reset()\n {\n $this->values[self::services] = array();\n $this->values[self::mapping] = array();\n $this->values[self::short_tcp] = self::$fields[self::short_tcp]['default'];\n }", "public function resetMessage(){\n\t\t\tif (isset($_SESSION['message']) && $_SESSION['message']!='') {\n\t\t\t\t$_SESSION['message']='';\n\t\t\t}\n\t\t}", "public function reset()\n {\n $this->values[self::_CHALLENGER] = null;\n $this->values[self::_DAMAGE] = null;\n }", "public function reset()\n {\n $this->values[self::_CHALLENGER] = null;\n $this->values[self::_DAMAGE] = null;\n }", "public function reset()\n {\n $this->values[self::WTLOGINREQBUFF] = null;\n $this->values[self::WTLOGINIMGREQI] = null;\n $this->values[self::WXVERIFYCODERE] = null;\n $this->values[self::CLIDBENCRYPTKE] = null;\n $this->values[self::CLIDBENCRYPTINFO] = null;\n $this->values[self::AUTHREQFLAG] = null;\n $this->values[self::AUTHTICKET] = null;\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_OPPOS] = array();\n $this->values[self::_IS_ROBOT] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_GUILD_INFO] = null;\n }", "public function reset() {\n $this->values[self::OPTION] = null;\n $this->values[self::CONTENT] = array();\n $this->values[self::ERROR] = null;\n }", "public function reset()\n {\n $this->values[self::_REQUEST] = null;\n $this->values[self::_CHANGE] = null;\n }", "public function\n\tclearMessages()\n\t{\n\t\t$this -> m_aStorage = [];\n\t}", "public function reset()\n {\n $this->values[self::_SYS_MAIL_LIST] = array();\n }", "public static function clear_defaults() {\n static::$defaults = [];\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_BINARY] = null;\n $this->values[self::_REPLAY] = null;\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_NAME] = null;\n $this->values[self::_JOB] = Down_GuildJobT::member;\n $this->values[self::_REQ_GUILD_ID] = null;\n $this->values[self::_HIRE_HERO] = array();\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}", "public function reset()\n {\n $this->setValue($this->getDefaultValue());\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_STATUS] = null;\n $this->values[self::_MAIL_TIME] = null;\n $this->values[self::_EXPIRE_TIME] = null;\n $this->values[self::_CONTENT] = null;\n $this->values[self::_MONEY] = null;\n $this->values[self::_DIAMONDS] = null;\n $this->values[self::_SKILL_POINT] = null;\n $this->values[self::_ITEMS] = array();\n $this->values[self::_POINTS] = array();\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->closed = 0;\n\t\t$this->lastfmid = 0;\n\t\t$this->hasphotos = 0;\n\t}", "public function reset()\n {\n $this->values[self::TEXT] = null;\n $this->values[self::MATCHEDTEXT] = null;\n $this->values[self::CANONICALURL] = null;\n $this->values[self::DESCRIPTION] = null;\n $this->values[self::TITLE] = null;\n $this->values[self::THUMBNAIL] = null;\n }", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "public function reset()\n {\n $this->values[self::FILTER] = null;\n $this->values[self::AFTERINDEXKEY] = null;\n $this->values[self::POPULATEDOCUMENTS] = self::$fields[self::POPULATEDOCUMENTS]['default'];\n $this->values[self::INJECTENTITYCONTENT] = self::$fields[self::INJECTENTITYCONTENT]['default'];\n $this->values[self::POPULATEPREVIOUSDOCUMENTSTATES] = self::$fields[self::POPULATEPREVIOUSDOCUMENTSTATES]['default'];\n }", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "public function reset()\n {\n $this->values[self::PHONE] = null;\n $this->values[self::PASSWORD] = null;\n $this->values[self::EQUIPMENT] = null;\n $this->values[self::LOGIN_TYPE] = null;\n }", "public function reset()\n {\n $this->values[self::_AVATAR] = null;\n $this->values[self::_NAME] = null;\n $this->values[self::_VIP] = null;\n $this->values[self::_LEVEL] = null;\n $this->values[self::_GUILD_NAME] = null;\n $this->values[self::_USER_ID] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_JOIN_GUILD_ID] = null;\n $this->values[self::_GUILD_INFO] = null;\n $this->values[self::_CD_TIME] = null;\n $this->values[self::_FAIL_REASON] = null;\n }", "public function applyDefaultValues()\n {\n $this->phadtype = '';\n $this->phadid = '';\n $this->phadsubid = '';\n $this->phadsubidseq = 0;\n $this->phadcont = '';\n }", "public function reset()\n {\n $this->values[self::BOXID] = null;\n $this->values[self::DRAFTID] = null;\n $this->values[self::TOBOXID] = null;\n $this->values[self::TODEPARTMENTID] = null;\n $this->values[self::DOCUMENTSIGNATURES] = array();\n $this->values[self::PROXYBOXID] = null;\n $this->values[self::PROXYDEPARTMENTID] = null;\n }", "public function reset() {\n $this->values[self::ERR_NO] = null;\n $this->values[self::ERR_MSG] = null;\n $this->values[self::CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::ID] = null;\n $this->values[self::LEVELUP_TIME] = null;\n $this->values[self::BEHELPED_TIMES] = null;\n $this->values[self::HELP_ASKED] = self::$fields[self::HELP_ASKED]['default'];\n $this->values[self::TOTAL_TIME] = null;\n }", "public function reset()\n {\n $this->values[self::SHIPMENTRECEIPTDATE] = null;\n $this->values[self::ATTORNEY] = null;\n $this->values[self::ACCEPTEDBY] = null;\n $this->values[self::RECEIVEDBY] = null;\n $this->values[self::SIGNER] = null;\n $this->values[self::ADDITIONALINFO] = null;\n }", "public function reset()\n {\n $this->values[self::STATUS] = null;\n $this->values[self::ERRORS] = array();\n $this->values[self::VALIDATOR_REVISION] = self::$fields[self::VALIDATOR_REVISION]['default'];\n $this->values[self::SPEC_FILE_REVISION] = self::$fields[self::SPEC_FILE_REVISION]['default'];\n $this->values[self::TRANSFORMER_VERSION] = self::$fields[self::TRANSFORMER_VERSION]['default'];\n $this->values[self::TYPE_IDENTIFIER] = array();\n $this->values[self::VALUE_SET_PROVISIONS] = array();\n $this->values[self::VALUE_SET_REQUIREMENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_STATUS] = null;\n $this->values[self::_FREQUENCY] = null;\n $this->values[self::_LAST_LOGIN_DATE] = null;\n }", "public function reset()\n {\n $this->values[self::system] = null;\n $this->values[self::platform] = null;\n $this->values[self::channel] = null;\n $this->values[self::version] = null;\n }", "public function applyDefaultValues()\n {\n $this->is_active = false;\n $this->is_closed = false;\n }", "public function reset()\n {\n $this->values[self::ERRMSG] = null;\n $this->values[self::RET] = null;\n }", "public function reset()\n {\n $this->values[self::_GUILD_LOG] = array();\n }", "public function reset()\n {\n $this->values[self::_USERS] = array();\n $this->values[self::_HIRE_UIDS] = array();\n $this->values[self::_FROM] = null;\n }", "public function reset()\n {\n $this->values[self::payment_method] = null;\n $this->values[self::wechat_pay] = null;\n $this->values[self::alipay_express] = null;\n $this->values[self::order_id] = array();\n $this->values[self::order] = array();\n }", "public function reset()\n {\n $this->values[self::_USER_ID] = null;\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_RANK] = null;\n $this->values[self::_WIN_CNT] = null;\n $this->values[self::_GS] = null;\n $this->values[self::_IS_ROBOT] = null;\n $this->values[self::_HEROS] = array();\n }", "public function reset(): void\n {\n /** @var array<string, mixed> $fieldsFromConfig */\n $fieldsFromConfig = config('alert.fields', []);\n\n $this->fields = $fieldsFromConfig;\n }", "public function reset()\n {\n $this->values[self::NAME] = null;\n $this->values[self::EMAIL] = null;\n $this->values[self::PHONEDA] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_INCOME] = null;\n }", "public function reset()\n {\n $this->values[self::REQUEST_HEADER] = null;\n $this->values[self::NEW_NAME] = null;\n $this->values[self::EVENT_REQUEST_HEADER] = null;\n }", "public function reset()\n {\n $this->values[self::SIGNEDCONTENT] = null;\n $this->values[self::FILENAME] = null;\n $this->values[self::COMMENT] = null;\n $this->values[self::CUSTOMDOCUMENTID] = null;\n $this->values[self::CUSTOMDATA] = array();\n }", "public function reset()\n {\n $this->values[self::_OPEN_PANEL] = null;\n $this->values[self::_APPLY_OPPO] = null;\n $this->values[self::_START_BATTLE] = null;\n $this->values[self::_END_BATTLE] = null;\n $this->values[self::_SET_LINEUP] = null;\n $this->values[self::_QUERY_RECORDS] = null;\n $this->values[self::_QUERY_REPLAY] = null;\n $this->values[self::_QUERY_RANKBORAD] = null;\n $this->values[self::_QUERY_OPPO] = null;\n $this->values[self::_CLEAR_BATTLE_CD] = null;\n $this->values[self::_DRAW_RANK_REWARD] = null;\n $this->values[self::_BUY_BATTLE_CHANCE] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_APP_QUEUE] = null;\n }", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_ADDR] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_APP_QUEUE] = null;\n }", "public function clearMsg() {\n\t\t$_SESSION['msg'] = null;\n\t}", "public function reset()\n {\n $this->values[self::PORTLIST] = null;\n $this->values[self::TIMEOUTLIST] = null;\n $this->values[self::MIMNOOPINTERVAL] = null;\n $this->values[self::MAXNOOPINTERVAL] = null;\n $this->values[self::TYPINGINTERVAL] = null;\n $this->values[self::NOOPINTERVALTIME] = null;\n }", "function setDefaultValues() {}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}" ]
[ "0.7559812", "0.74739546", "0.72973615", "0.7258333", "0.7185409", "0.71421975", "0.7037741", "0.70338154", "0.70285827", "0.70249987", "0.69918084", "0.697904", "0.6965748", "0.68274975", "0.68267244", "0.6796972", "0.6759827", "0.6743557", "0.67366123", "0.6724516", "0.6717986", "0.6702474", "0.66880184", "0.66670156", "0.665216", "0.6648875", "0.6623373", "0.6610065", "0.6604048", "0.65854067", "0.65795976", "0.6572542", "0.65723675", "0.6571937", "0.6567922", "0.6565031", "0.65475714", "0.6518179", "0.6506664", "0.64885837", "0.64826536", "0.6460602", "0.6454503", "0.64510584", "0.64296746", "0.64281696", "0.64216936", "0.64214784", "0.6412798", "0.64043164", "0.6400258", "0.6381591", "0.63810694", "0.63705844", "0.63705844", "0.6369157", "0.6369157", "0.6363431", "0.63612527", "0.63566434", "0.6355287", "0.6353886", "0.63534236", "0.6345771", "0.6342256", "0.6342212", "0.6327448", "0.6325498", "0.63226247", "0.632092", "0.6314576", "0.6313809", "0.63039047", "0.6293232", "0.628343", "0.6280546", "0.62781066", "0.6267865", "0.6264377", "0.6263501", "0.6262706", "0.6244747", "0.62435585", "0.6228733", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777", "0.62282777" ]
0.0
-1
Sets value of 'ip' property
public function setIp($value) { return $this->set(self::ip, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setIp($ip)\n {\n if ($ip === null) {\n $this->ip = null;\n return $this;\n }\n\n if (is_string($ip)) {\n $ip = ip2long($ip);\n } elseif (is_numeric($ip)) {\n $ip = (int)$ip;\n } else {\n $ip = 0;\n }\n\n $this->ip = $ip;\n\n return $this;\n }", "public function setIpAddress($ip_address);", "public function setIp($var)\n {\n GPBUtil::checkString($var, True);\n $this->ip = $var;\n\n return $this;\n }", "public function setIp($ip) {\n $this->ip = $ip;\n return $this;\n }", "public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }", "public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }", "public function setIp($ip)\n {\n $this->_ip = $ip;\n\n return $this;\n }", "public function setIp($ip)\n {\n $this->ip = $ip;\n\n return $this;\n }", "public function setIp($ip)\n {\n $this->ip = $ip;\n\n return $this;\n }", "public function setIp($ip)\n {\n $this->ip = $ip;\n\n return $this;\n }", "public function setIp($ip)\n {\n $this->ip = $ip;\n\n return $this;\n }", "public function setIpAddress($val)\n {\n $this->_propDict[\"ipAddress\"] = $val;\n return $this;\n }", "public function setIP($ip)\n {\n $this->env['REMOTE_ADDR'] = $ip;\n return $this;\n }", "private function _ip()\n {\n if (PSI_USE_VHOST === true) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n if (!($result = getenv('SERVER_ADDR'))) {\n $this->sys->setIp(gethostbyname($this->sys->getHostname()));\n } else {\n $this->sys->setIp($result);\n }\n }\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setIP($ip)\n\t{\n\t\tif ( !Helper::isValidIP( $ip ) ) {\n\t\t\tthrow new IPG_Exception( 'Invalid customer IP Address' );\n\t\t}\n\t\t$this->ip = $ip;\n\n\t\treturn $this;\n\t}", "private function __construct($ip)\n {\n $this->ip = $ip;\n }", "public function __construct(Ip $ip)\n {\n $this->ip = $ip;\n }", "public function setIP($iP = null)\n {\n // validation for constraint: string\n if (!is_null($iP) && !is_string($iP)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($iP)), __LINE__);\n }\n if (is_null($iP) || (is_array($iP) && empty($iP))) {\n unset($this->IP);\n } else {\n $this->IP = $iP;\n }\n return $this;\n }", "public function Persona (){ \n\n $this->ip=$this->getIP();\n }", "public function setRemoteIp($remoteIp);", "public function setVip($vip)\n {\n $this->_vip = $vip;\n }", "public function setUrl($ip)\n {\n $this->url = $this->baseUrl . $ip . \"?access_key=\" . $this->apiKey;\n }", "public function testSetAdresseIp() {\n\n $obj = new iSessions();\n\n $obj->setAdresseIp(\"adresseIp\");\n $this->assertEquals(\"adresseIp\", $obj->getAdresseIp());\n }", "protected function _setControllerIp($ip){\n\t\tif (filter_var($ip, FILTER_VALIDATE_IP)) // If the use enter a valid IP addresse\n\t\t\t$this->_controllerIp = $ip;\n\t\telse{\n\t\t\t// Send error with 2 methodes because it's critical programming error\n\t\t\t// And kill the script\n\t\t\t$trace = debug_backtrace();\n\t\t\t$errorMessage = 'Argument 2 for SpykeeControllerClient::__construct() have to be an valid IP addresse, called in'\n\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\tthrow new SpykeeException('Unable to launch Spykee Script', $errorMessage);\n\t\t}\n\t}", "public function setIps()\n {\n if ($this->module->sandbox) {\n $this->ips = $this->sandboxIps;\n } else {\n $this->ips = $this->productionIps;\n }\n }", "public function setVip($value)\n {\n return $this->set(self::_VIP, $value);\n }", "public function setVip($value)\n {\n return $this->set(self::_VIP, $value);\n }", "public function setIp(string $sIp): self\n {\n $this->sIp = $sIp;\n return $this;\n }", "public function setAuthorIp($ipAsString);", "public function testSetRemoteIp()\n {\n $this->_req->setRemoteIp('999.99.998.9');\n $this->assertEquals('999.99.998.9', $this->_req->getRemoteIp());\n }", "public function setUseIPAddress($use_ipaddr) \n \t{\n \t\t$this->use_ipaddr = $use_ipaddr;\n \t}", "public function setGatewayIP($value)\n {\n return $this->set('GatewayIP', $value);\n }", "public function setNatIP($value)\n {\n return $this->set('NatIP', $value);\n }", "public function setIps(?string $ips): self\n {\n $this->ips = $ips;\n\n return $this;\n }", "public function setConnectedIp($value)\n {\n return $this->set(self::CONNECTED_IP, $value);\n }", "public function ip()\n {\n return $this->rule('ip');\n }", "public function ip($ip, \\Closure $group, array $options = []): void\n {\n if($this->cache_status){\n return;\n }\n $prev_group_options = $this->group_options;\n $options['ip'] = $this->confirm_ip_addresses($ip);\n $this->group_options = $this->options_merge($this->group_options, $options);\n \\call_user_func_array($group, [$this]);\n $this->group_options = $prev_group_options;\n }", "public function edit(Ip $ip)\n {\n //\n }", "public function setGrantedIp($GrantedIp)\n {\n $this->__set(\"granted_ip\", $GrantedIp);\n }", "public function setIps($ips)\n\t{\n\t\tif (empty($ips)) {\n\t\t\t$this->ips = [];\n\t\t}elseif (is_array($ips)) {\n\t\t\t$this->ips = $ips;\n\t\t} elseif (is_string($ips)) {\n\t\t\t$trimIps = trim(preg_replace('/\\s{2,}/',' ',preg_replace('/\\n|\\r|,/',' ',$ips)));\n\t\t\tif (empty($trimIps)) {\n\t\t\t\t$this->ips = [];\n\t\t\t} else {\n\t\t\t\t$this->ips = explode(' ',$trimIps);\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}", "public function setRemoteIp($remoteIp)\n {\n $this->_remoteIp = $remoteIp;\n }", "public static function setIPs(iterable $ips): void\n {\n foreach ($ips as $ip) {\n self::$ips[] = strval($ip);\n }\n }", "public function setNumeroIP( $numero ) {\n $this->numero_ip=$numero;\n $this->enviarNumero();\n $this->activarPantalla();\n //activar y enviar numero\n }", "function setARecord( $ip ) {\n\t\tglobal $wgAuth;\n\n\t\t$values = array( 'arecord' => array( $ip ) );\n\t\t$success = LdapAuthenticationPlugin::ldap_modify( $wgAuth->ldapconn, $this->hostDN, $values );\n\t\tif ( $success ) {\n\t\t\t$wgAuth->printDebug( \"Successfully set $ip on $this->hostDN\", NONSENSITIVE );\n\t\t\t$this->domain->updateSOA();\n\t\t\t$this->fetchHostInfo();\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$wgAuth->printDebug( \"Failed to set $ip on $this->hostDN\", NONSENSITIVE );\n\t\t\treturn false;\n\t\t}\n\t}", "public function update(Request $request, Ip $ip)\n {\n //\n }", "public function anonymizeIpReturnsCorrectValueDataProvider() {}", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function validate_ip($ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP, \n FILTER_FLAG_IPV4 | \n FILTER_FLAG_IPV6 |\n FILTER_FLAG_NO_PRIV_RANGE | \n FILTER_FLAG_NO_RES_RANGE) === false)\n return false;\n self::$ip = $ip;\n return true;\n }", "public static function invalidateIp($ip) {\n\t\t$votes=Vote::findAllBy(\"ip\",$ip);\n\t\tforeach ($votes as $vote) {\n\t\t\t$vote->valid=FALSE;\n\t\t\t$vote->save();\n\t\t}\n\t}", "public function __construct($ip = null)\n {\n $this->ip = $ip;\n if ((filter_var($ip, FILTER_VALIDATE_IP))) {\n $this->getLocationDataFromIpStack($ip);\n } else {\n $this->locationResults = null;\n }\n }", "public function getIp() {\n return $this->ip;\n }", "public function ip()\n {\n return $this->ip;\n }", "public function setImAddress($value)\n {\n $this->setProperty(\"ImAddress\", $value, true);\n }", "public function setReportedIp($value)\n {\n return $this->set(self::REPORTED_IP, $value);\n }", "public function getIp()\n {\n return $this->_ip;\n }", "public function ip($ip)\n {\n return $this->cache->remember('ip:' . $ip, self::TTL, function () use ($ip) {\n return $this->geoIp->ip($ip);\n });\n }", "public function set($param, $id)\n {\n $sentence = new SentenceUtil();\n $sentence->addCommand(\"/ip/address/set\");\n foreach ($param as $name => $value) {\n $sentence->setAttribute($name, $value);\n }\n $sentence->where(\".id\", \"=\", $id);\n $this->talker->send($sentence);\n return \"Sucsess\";\n }", "protected function _updateIpData()\n {\n if (!empty($this->_extraData['ipAddress']))\n {\n $ipAddress = $this->_extraData['ipAddress'];\n }\n else\n {\n $ipAddress = null;\n }\n\n $ipId = XenForo_Model_Ip::log(\n $this->get('user_id'), $this->getContentType(), $this->getContestId(), 'insert', $ipAddress\n );\n $this->set('ip_id', $ipId, '', array('setAfterPreSave' => true));\n\n $this->_db->update($this->getContestTableName(), array(\n 'ip_id' => $ipId\n ), 'photo_contest_id = ' . $this->_db->quote($this->getContestId()));\n }", "public function set_adresse_ip($adresse_ip)\n {\n $this->adresse_ip = $adresse_ip;\n\n return $this;\n }", "public function set_real_ip() {\r\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\r\n\t\tif ( ! isset( $_SERVER['HTTP_CF_CONNECTING_IP'], $_SERVER['REMOTE_ADDR'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$cf_ips_values = $this->cloudflare->get_cloudflare_ips();\r\n\t\t$cf_ip_ranges = $cf_ips_values->result->ipv6_cidrs;\r\n\t\t$ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );\r\n\t\t$ipv6 = get_rocket_ipv6_full( $ip );\r\n\t\tif ( false === strpos( $ip, ':' ) ) {\r\n\t\t\t// IPV4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\r\n\t\t\t$cf_ip_ranges = $cf_ips_values->result->ipv4_cidrs;\r\n\t\t}\r\n\r\n\t\tforeach ( $cf_ip_ranges as $range ) {\r\n\t\t\tif (\r\n\t\t\t\t( strpos( $ip, ':' ) && rocket_ipv6_in_range( $ipv6, $range ) )\r\n\t\t\t\t||\r\n\t\t\t\t( false === strpos( $ip, ':' ) && rocket_ipv4_in_range( $ip, $range ) )\r\n\t\t\t) {\r\n\t\t\t\t$_SERVER['REMOTE_ADDR'] = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function ressetIp($ip) {\n\n $this->db->query('UPDATE Ip SET Atempts=:ressettedAtempts WHERE Id=:id');\n\n //Bind values\n $this->db->bind(':id', $ip);\n $this->db->bind(':ressettedAtempts', $data['ressettedAtempts']);\n\n //Execute\n if ($this->db->execute()) {\n return true;\n } else {\n return false;\n }\n }", "public static function bootUserIp()\n {\n static::updating(function ($model) {\n $model->user_ip = \\Request::ip();\n });\n\n static::creating(function ($model) {\n $model->user_ip = \\Request::ip();\n }); \n }", "public function getIp() : IpAddress\n {\n return new IpAddress('0.0.0.0');\n }", "protected function ip(string $field, string $value, $param = null)\n {\n if (!empty($value)) {\n if (filter_var($value, FILTER_VALIDATE_IP) === false) {\n $this->addError($field, 'ip', $param);\n }\n }\n }", "public function setIPRange($value)\n {\n return $this->set('IPRange', $value);\n }", "private function _addIpToStorage($ip)\n {\n if(isset($this->_ipStorage[$ip]))\n {\n $this->_ipStorage[$ip]++;\n }\n else\n {\n $this->_ipStorage[$ip] = 1;\n } \n }", "public function setOppoVip($value)\n {\n return $this->set(self::_OPPO_VIP, $value);\n }" ]
[ "0.7737894", "0.76971316", "0.767148", "0.7548826", "0.7498629", "0.7498629", "0.7382514", "0.7375807", "0.7375807", "0.7375807", "0.7375807", "0.7312045", "0.7254488", "0.696193", "0.69081837", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6907769", "0.6905927", "0.6905927", "0.6905927", "0.6905927", "0.6905927", "0.6905927", "0.6905927", "0.6905927", "0.68761736", "0.67962795", "0.67840976", "0.67607737", "0.6713797", "0.66895366", "0.6662361", "0.66315424", "0.6618858", "0.659387", "0.6524446", "0.65014476", "0.65014476", "0.6465679", "0.64411986", "0.6405202", "0.6374724", "0.6324442", "0.63116497", "0.6121547", "0.6117843", "0.61133146", "0.60603046", "0.60462964", "0.6040973", "0.5994482", "0.5993333", "0.5982113", "0.5967978", "0.5939558", "0.5899368", "0.5893908", "0.5884961", "0.5884961", "0.5884961", "0.5884961", "0.5884961", "0.5884961", "0.5884961", "0.5879713", "0.5871572", "0.5861953", "0.58463997", "0.58208007", "0.5820054", "0.58094096", "0.5808443", "0.57787067", "0.57735354", "0.57720816", "0.57669836", "0.5755259", "0.5746296", "0.57294506", "0.5717565", "0.57152647", "0.5641585", "0.563091", "0.5629283" ]
0.759007
3
Returns value of 'ip' property
public function getIp() { $value = $this->get(self::ip); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIp()\n {\n return $this->get(self::IP);\n }", "public function getIp()\n {\n return $this->get(self::IP);\n }", "public function ip()\n {\n return $this->rule('ip');\n }", "public function getIp(): string\n {\n return $this->ip;\n }", "public function getIp(): string\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->ip;\n }", "public function ip()\n {\n return $this->ip;\n }", "public function getIp() {\n return $this->ip;\n }", "public function getIp()\n {\n return $this->_ip;\n }", "public function getIp() : string {\n return $this->ip;\n }", "public function getIpAdress(){\n return $this->auth['ip_adress'];\n }", "public function ipAddress(){\n return $this->getServerVar('REMOTE_ADDR');\n }", "public function getIP(): string {\n return $this->context->ip;\n }", "public function getIp()\n {\n return $this->_getIp();\n }", "public function getIP()\n {\n return isset($this->IP) ? $this->IP : null;\n }", "public function getDeviceIP();", "public function getIpAddress()\n {\n if (array_key_exists(\"ipAddress\", $this->_propDict)) {\n return $this->_propDict[\"ipAddress\"];\n } else {\n return null;\n }\n }", "public function getGivenIp()\n\t{\n\t\treturn $this->given_ip;\n\t}", "public function ip()\r\n {\r\n return $this->server->get('REMOTE_ADDR');\r\n }", "public function getIP()\n\t{\n\t\treturn $this->remote_ip;\n\t}", "public function getIP(): string\n {\n return (string)$this->env['REMOTE_ADDR'];\n }", "static function getIP()\r\n {\r\n return self::getRemoteIP();\r\n }", "public function getIp() {\n\t\treturn $_SERVER['REMOTE_ADDR'];\t\n\t}", "public function getIP() {\n if(isset($this->_ip)) {\n return $this->_ip; \n }\n \n trigger_error(\"IP is not set\");\n return FALSE;\n }", "public static function get_ip()\n\t{\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}", "public function ip_address()\n {\n return $this->server('REMOTE_ADDR');\n }", "public function ip() {\n\t\treturn isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : null;\n\t}", "public function getIpAddress() {\n return $this->ipAddress;\n }", "public function getVip()\n {\n return $this->get(self::_VIP);\n }", "public function getVip()\n {\n return $this->get(self::_VIP);\n }", "public function getRemoteIp();", "public function getAddr() {\r\n return (is_null($this->ipAddr)) ? null : $this->ipAddr;\r\n }", "final protected function ipAddress()\n {\n return $this->container->make('request')->ip();\n }", "function ip()\n {\n return util::ip();\n }", "public function getIPAddress(): string;", "public function getIpAddress() {\n return [\n '#markup' => $this->t('Your Ip address is: @ipaddress', array('@ipaddress' => $this->personalizationIpService->getIpAddress()))\n ];\n }", "function getIP() {\n return gethostbyname($this->host);\n }", "public function get_adresse_ip()\n {\n return $this->adresse_ip;\n }", "public static function IP()\n {\n return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '::1';\n }", "public function getIp(): string\n {\n return $this->getServer(self::REMOTE_ADDR);\n }", "public function getSourceIp()\n {\n return $this->source_ip;\n }", "public function getSourceIp()\n {\n return $this->source_ip;\n }", "public function getIpAddress()\n {\n return $this->getRequest()->ip;\n }", "protected function ipAddress(): string\n {\n return $this->container->make('request')->ip();\n }", "protected function ip_address()\n\t{\n\t\t//return $this->ip2int(ipaddress::get());\n\t\t//return $this->ip2int(server('REMOTE_ADDR'));\n\t\treturn server('REMOTE_ADDR');\n\t}", "public function getInternalIp()\n {\n return $this->internal_ip;\n }", "static function getIp()\n {\n if (!isset(self::$_data[self::KEY_IP]))\n {\n $_ipAddress = $_SERVER[\"REMOTE_ADDR\"];\n if (isset($_REQUEST[\"ip\"]) && strlen($_REQUEST[\"ip\"]) > 0)\n {\n $_ipAddress = $_REQUEST[\"ip\"];\n }\n elseif (isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"]) && strlen($_SERVER[\"HTTP_X_FORWARDED_FOR\"]) > 0)\n {\n $_ipAddress = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n }\n self::setIp($_ipAddress);\n }\n\n return self::$_data[self::KEY_IP];\n }", "public function ip()\n {\n $serverAll = parent::server();\n\n // source: https://stackoverflow.com/a/41769505\n foreach (['HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'] as $key) {\n if (array_key_exists($key, $serverAll) === true) {\n foreach (explode(',', $serverAll[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n\n return parent::ip();\n }", "public function getIP()\n {\n $address = $this->serverAttributes()['REMOTE_ADDR'];\n\n if (!$address) {\n return false;\n }\n\n return $address;\n }", "public function getIp(): ?string\n {\n return $this->sIp;\n }", "public function getIpAddress();", "public function getAddress() : int{\n\t\treturn $this->ip;\n\t}", "public function ip()\n\t{\n\t\treturn $this->Players->ip($this->SqueezePlyrID);\n\t}", "private function getUserIP()\n {\n $iph = $this->app->make('helper/validation/ip');\n $ip = $iph->getRequestIP();\n\n return $ip->getIP(IPAddress::FORMAT_IP_STRING);\n }", "public function getVip()\n {\n return $this->vip;\n }", "public function getUseIPAddress() \n \t{\n \t\treturn $this->use_ipaddr;\n \t}", "public function ObtenerIp()\n { \n\n return str_replace(\".\",\"\",$this->getIP()); //Funcion que quita los puntos de la IP\n\n }", "public function getNatIP()\n {\n return isset($this->nat_i_p) ? $this->nat_i_p : '';\n }", "public static function ip()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn filter_var(request()->header('CF_CONNECTING_IP'), FILTER_VALIDATE_IP);\n\t\t}) ?: request()->ip();\n\t}", "function ip() {\n return request()->ip();\n }", "private static function getIp()\n {\n if (empty($_SERVER['REMOTE_ADDR']) && (Spry::isCli() || Spry::isCron() || Spry::isBackgroundProcess())) {\n return '127.0.0.1';\n }\n\n return $_SERVER['REMOTE_ADDR'] ?? 'No IP';\n }", "function itsec_rcp_get_ip() {\n\treturn ITSEC_Lib::get_ip();\n}", "public function GetIp()\n {\t\n\t$q = Doctrine_Query::create()\n\t\t\t\t\t\t->select('*')\n\t\t\t\t\t\t->from('Users')\n\t\t\t\t\t\t->where('id = ?',$this->getUser()->getId());\n\t$result =$q->FetchOne();\n\treturn $result->getUserIp();\n }", "public function getVip()\n {\n return $this->_vip;\n }", "public static function getIP()\n {\n $ip = '0.0.0.0';\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } elseif (isset($_SERVER['HTTP_VIA'])) {\n $ip = $_SERVER['HTTP_VIA'];\n } elseif (isset($_SERVER['REMOTE_ADDR'])) {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n }", "public static function getIP() : string {\n\n\t\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) return $_SERVER['HTTP_CLIENT_IP'];\n\n\t\t\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) return $_SERVER['HTTP_X_FORWARDED_FOR'];\n\n\t\t\tif (!empty($_SERVER['HTTP_X_FORWARDED'])) return $_SERVER['HTTP_X_FORWARDED'];\n\n\t\t\tif (!empty($_SERVER['HTTP_FORWARDED_FOR'])) return $_SERVER['HTTP_FORWARDED_FOR'];\n\n\t\t\tif (!empty($_SERVER['HTTP_FORWARDED'])) return $_SERVER['HTTP_FORWARDED'];\n\n\t\t\tif (!empty($_SERVER['REMOTE_ADDR'])) return $_SERVER['REMOTE_ADDR'];\n\n\t\t\t# ------------------------\n\n\t\t\treturn 'unknown';\n\t\t}", "static public function getIp() {\n if (isset($_SERVER['REMOTE_ADDR'])) return $_SERVER['REMOTE_ADDR'];\n return '127.0.0.1';\n }", "private function get_ip(){\n $ip = '';\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n }", "public function getIpAddress() {\n $ip_address = $this->getIpAddressFromProxy();\n\n if($ip_address == \"127.0.0.1\" || strlen($ip_address) < 7) {\n $ip_address = false;\n }\n\n if ($ip_address) {\n return $ip_address;\n }\n\n $ip_address = $this->getServerVariable(\"REMOTE_ADDR\");\n\n if(strlen($ip_address) < 7) {\n $ip_address = \"127.0.0.1\";\n }\n\n // direct IP address\n return $ip_address;\n }", "public function remoteIp()\n {\n return $this->_remoteIp;\n }", "public function ip_address() {\n\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n //check ip from share internet\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n //to check ip is pass from proxy\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n }", "public function getIp()\n\t{\n\t\t$ip = $_SERVER['REMOTE_ADDR']; \n\t\tif($ip){\n\t\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\t} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t}\n\t\t\treturn $ip;\n\t\t}\n\t\t// There might not be any data\n\t\treturn false;\n\t}", "public static function ip()\n {\n $ip = 'UNKNOWN';\n\n if (getenv('HTTP_CLIENT_IP')) {\n $ip = getenv('HTTP_CLIENT_IP');\n } elseif (getenv('HTTP_CF_CONNECTING_IP')) {\n $ip = getenv('HTTP_CF_CONNECTING_IP');\n } elseif (getenv('HTTP_X_FORWARDED_FOR') && Grav::instance()['config']->get('system.http_x_forwarded.ip')) {\n $ips = array_map('trim', explode(',', getenv('HTTP_X_FORWARDED_FOR')));\n $ip = array_shift($ips);\n } elseif (getenv('HTTP_X_FORWARDED') && Grav::instance()['config']->get('system.http_x_forwarded.ip')) {\n $ip = getenv('HTTP_X_FORWARDED');\n } elseif (getenv('HTTP_FORWARDED_FOR')) {\n $ip = getenv('HTTP_FORWARDED_FOR');\n } elseif (getenv('HTTP_FORWARDED')) {\n $ip = getenv('HTTP_FORWARDED');\n } elseif (getenv('REMOTE_ADDR')) {\n $ip = getenv('REMOTE_ADDR');\n }\n\n return $ip;\n }", "protected function fetchIp()\n {\n $ip = $this->request->server('REMOTE_ADDR');\n return implode('.', array_slice(explode('.', $ip), 0, 4 -1));\n }", "public function getConnectedIp()\n {\n return $this->get(self::CONNECTED_IP);\n }", "private function getIP(){\n\t\tif( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] )) $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\telse if( isset( $_SERVER ['HTTP_VIA'] )) $ip = $_SERVER['HTTP_VIA'];\n\t\telse if( isset( $_SERVER ['REMOTE_ADDR'] )) $ip = $_SERVER['REMOTE_ADDR'];\n\t\telse $ip = null ;\n\t\treturn $ip;\n\t}", "public function getRemoteIp()\n {\n return $this->remote_ip;\n }", "public function clientIp(){\n return $this->clientIp;\n }", "private function getIP(){\n \n if( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ){ \n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n \n else{\n \n if( isset($_SERVER ['HTTP_VIA']) ){\n $ip = $_SERVER['HTTP_VIA'];\n }\n else{\n \n if( isset( $_SERVER ['REMOTE_ADDR'] )){\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n else{\n $ip = null ;\n }\n }\n \n }\n \n \n return $ip; //retorna la IP\n }", "public static function ip() {\n $ip = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ip = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ip = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ip = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ip = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ip = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ip = getenv('REMOTE_ADDR');\n else\n $ip = 'unknown';\n\n return $ip;\n }", "public function getUserIp()\n {\n return $this->remoteAddress->getRemoteAddress();\n }", "public function getGrantedIp()\n {\n return $this->__get(\"granted_ip\");\n }", "public function getIpConnex()\n {\n return $this->ipConnex;\n }", "public function getNumeroIP( ) {\n return $this->numero_ip;\n }", "public function getCustomerIP()\n {\n return $this->customerIP;\n }", "public static function getIp()\n {\n if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n {\n $sIp = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n elseif (!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $sIp = $_SERVER['HTTP_CLIENT_IP'];\n }\n else\n {\n $sIp = $_SERVER['REMOTE_ADDR'];\n }\n\n return preg_match('/^[a-z0-9:.]{7,}$/', $sIp) ? $sIp : '0.0.0.0';\n }", "public function getUserip()\n {\n // Find Client IP\n if (!empty($this->request->getServer('HTTP_CLIENT_IP'))) {\n $client = $this->request->getServer('HTTP_CLIENT_IP');\n }\n if (!empty($this->request->getServer('HTTP_X_FORWARDED_FOR'))) {\n $forward = $this->request->getServer('HTTP_X_FORWARDED_FOR');\n }\n if (!empty($this->request->getServer('REMOTE_ADDR'))) {\n $remote = $this->request->getServer('REMOTE_ADDR');\n }\n if (null !==$this->request->getServer(\"HTTP_CF_CONNECTING_IP\")) { //Find Cloud IP\n $remote=$this->request->getServer('REMOTE_ADDR');\n $client=$this->request->getServer('HTTP_CLIENT_IP');\n $remote = $this->request->getServer('HTTP_CF_CONNECTING_IP');\n $client = $this->request->getServer('HTTP_CF_CONNECTING_IP');\n }\n if (filter_var($client, FILTER_VALIDATE_IP)) {\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)) {\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n return $ip;\n }", "protected function resolveIp(): string\n {\n return Request::ip();\n }", "public function __toString()\n {\n return long2ip($this->ip);\n }", "public function getPeerIp()\n {\n return isset($this->peer_ip) ? $this->peer_ip : '';\n }", "public static function getIp() {\n\t\tforeach (array(\"HTTP_CLIENT_IP\", \"HTTP_X_FORWARDED_FOR\", \"HTTP_X_FORWARDED\", \"HTTP_X_CLUSTER_CLIENT_IP\", \"HTTP_FORWARDED_FOR\", \"HTTP_FORWARDED\", \"REMOTE_ADDR\") as $key) {\n\t\t\tif (!array_key_exists($key, $_SERVER)) \n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\tforeach (explode(\",\", $_SERVER[$key]) as $ip) {\n\t\t\t\t$ip = trim($ip);\n\t\t\t\t\n\t\t\t\tif (filter_var($ip, FILTER_VALIDATE_IP/*, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE*/) !== false)\n\t\t\t\t\treturn $ip;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn NULL;\n\t}", "public static function get_ip_address () : string\n {\n server ( \"HTTP_CLIENT_IP\" , ( $ip = \"\" ) && ( server ( \"HTTP_CLIENT_IP\" ) !== \"\" ) ? server ( \"HTTP_CLIENT_IP\" ) : server ( \"HTTP_CLIENT_IP\" ) );\n $ip = server ( \"HTTP_CLIENT_IP\" ) === \"\" ? server ( \"HTTP_CLIENT_IP\" ) : $ip;\n $ip = ( $ip === \"\" ) && ( server ( \"HTTP_X_FORWARDED_FOR\" ) === \"\" ) ? server ( \"HTTP_X_FORWARDED_FOR\" ) : $ip;\n return $ip === \"\" ? server ( \"REMOTE_ADDR\" ) : $ip;\n }", "protected function get_ip_address() {\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet\r\n\t\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\r\n\t\t} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy\r\n\t\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\t} else {\r\n\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\r\n\t\t}\r\n\t\treturn $ip;\r\n\t}", "public function getIps()\n {\n return $this->ips;\n }" ]
[ "0.82780486", "0.82780486", "0.8274773", "0.82162684", "0.82162684", "0.82154155", "0.82154155", "0.82154155", "0.82154155", "0.82154155", "0.82154155", "0.82154155", "0.82134926", "0.81861377", "0.8166144", "0.81520605", "0.7890118", "0.7861993", "0.7834562", "0.7822492", "0.7801258", "0.7771107", "0.77597904", "0.7748227", "0.773051", "0.76369053", "0.7461951", "0.7427536", "0.7425102", "0.74137187", "0.7410717", "0.74047905", "0.73948073", "0.7394201", "0.73767483", "0.73767483", "0.73744845", "0.737026", "0.73699176", "0.73510015", "0.73394775", "0.73370963", "0.7291433", "0.72812366", "0.72789073", "0.72727036", "0.7270824", "0.7270824", "0.7261698", "0.7230504", "0.72267056", "0.7222433", "0.72190315", "0.7210914", "0.71827155", "0.71211725", "0.7119813", "0.7114898", "0.711486", "0.71089697", "0.70965254", "0.7089259", "0.7088033", "0.70756483", "0.70727664", "0.70654845", "0.7056181", "0.70514625", "0.704806", "0.7035757", "0.7014864", "0.70104134", "0.7006652", "0.6986303", "0.697768", "0.69672453", "0.6964256", "0.69599473", "0.69574827", "0.69566476", "0.69541764", "0.69251186", "0.6924963", "0.69234765", "0.6922983", "0.69081384", "0.6907214", "0.69035923", "0.68909657", "0.68904513", "0.6887168", "0.6886847", "0.6873182", "0.68391615", "0.68319166", "0.6818907", "0.6812528", "0.68118024", "0.6808248", "0.6796344" ]
0.8473826
0
Sets value of 'port' property
public function setPort($value) { return $this->set(self::port, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPort($port) {\n\n $this->port = $port;\n }", "public function setPort( $port )\n\t{\n\t\t$this->port = $port;\n\t\t$this->modified = true;\n\t}", "public function setPort($port)\n {\n $this->port = $port;\n }", "public function setPort( $port )\r\n {\r\n $this->_port = $port;\r\n }", "public function setPort($port)\n\t{\n\t\t$this->port = $port;\n\t}", "public function setPort($port)\n {\n $this->_port = $port;\n }", "public function setPort($port)\n {\n $this->_port = $port;\n }", "public function setPort($port);", "public function setPort($port);", "public function setPort(int $port): void\n {\n }", "public function setPort(int $port): self;", "protected function set_port($port)\n {\n }", "public function set_port($port)\n {\n }", "public function setPort($port = null)\n {\n $this->port = $port;\n }", "public function setPort($port = 80) {\n $this->_port = $port;\n }", "public function setPort($var)\n {\n GPBUtil::checkString($var, True);\n $this->port = $var;\n\n return $this;\n }", "public function setPort($var)\n {\n GPBUtil::checkInt32($var);\n $this->port = $var;\n\n return $this;\n }", "public function setPort($var)\n {\n GPBUtil::checkInt32($var);\n $this->port = $var;\n\n return $this;\n }", "public function setPort($var)\n {\n GPBUtil::checkInt32($var);\n $this->port = $var;\n\n return $this;\n }", "public function setPort($port)\n {\n $this->port = (int) $port;\n return $this;\n }", "function setPort($portNumber) {\n\t\t$this->port = $portNumber;\n\t}", "public function setPort($port)\n {\n $this->port = (int)$port;\n\n return $this;\n }", "public function setLocalPort(int $port): void {}", "public function setPort($port)\n {\n $this->port = (int) $port;\n\n return $this;\n }", "public function setPort($port)\n {\n $this->port = $port;\n return $this;\n }", "public function setPort($port)\n {\n $this->port = $port;\n return $this;\n }", "public function setPort($port)\r\n\t{\r\n\t\tif (!empty($port))\r\n\t\t{\r\n\t\t\t$this->port = $port;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static function setDefaultPort($port)\n\t\t{\n\t\t\tself::$port = $port;\n\t\t}", "public function setPort($port)\n {\n $this->_port = $port;\n\n return $this;\n }", "public function setPort($port = null)\n {\n // validation for constraint: int\n if (!is_null($port) && !is_numeric($port)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, \"%s\" given', gettype($port)), __LINE__);\n }\n if (is_null($port) || (is_array($port) && empty($port))) {\n unset($this->Port);\n } else {\n $this->Port = $port;\n }\n return $this;\n }", "public function setPort(int $port): static\n {\n $this->port = $port;\n\n return $this;\n }", "public function port(int $port)\n {\n $this->port = $port;\n\n return $this;\n }", "public function port(int $port)\n {\n $this->port = $port;\n\n return $this;\n }", "public function port($value): self\n {\n $this->port = $value;\n \n return $this;\n }", "public function setPort($port)\n {\n if ( 1 > $port || 65535 < $port) {\n /**\n * @uses Parsonline_Exception_ValueException\n */\n require_once('Parsonline/Exception/ValueException.php');\n throw new Parsonline_Exception_ValueException(\"TCP port number '{$port}' is out of range 1-65535\");\n }\n $this->_port = intval($port);\n return $this;\n }", "public function setPort($port)\n {\n $this->urlParts['port'] = $port;\n $this->urlPartsModified = TRUE;\n\n return $this;\n }", "public function port($port);", "public function withPort($port)\n {\n // TODO: Implement withPort() method.\n }", "public function withPort($port)\n {\n // TODO: Implement withPort() method.\n }", "public function setPort(int $port): Proxy {\n $this->port = $port;\n return $this;\n }", "public function setProxyPort($port);", "function setPort($inParamValue) {\n\t\treturn $this->setParam(self::PARAM_PORT, $inParamValue);\n\t}", "protected function _setControllerPort($port){\n\t\tif (is_numeric($port) AND $port > 0 AND $port <= 49151)\n\t\t\t$this->_controllerPort = $port;\n\t\telse{\n\t\t\t// Send error with 2 methodes because it's critical programming error\n\t\t\t// And kill the script\n\t\t\t$trace = debug_backtrace();\n\t\t\t$errorMessage = 'Argument 3 for SpykeeControllerClient::__construct() have to be an valid port addresse (between 1 and 49151 included), called in'\n\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\tthrow new SpykeeException('Unable to launch Spykee Script', $errorMessage);\n\t\t}\n\t}", "public function usePort(int $port) : Pgdump\n {\n $this->port = $port;\n return $this;\n }", "public function setPort($port)\n {\n $this->env['SERVER_PORT'] = $port;\n\n // Override the scheme for standard ports.\n if ($port === 80) {\n $this->setScheme('http');\n } elseif ($port === 443) {\n $this->setScheme('https');\n }\n\n return $this;\n }", "function SetPort($namePort = \"\") {\n $archivo = 'C:\\IntTFHKA\\Puerto.dat';\n $fp = fopen($archivo, \"w\");\n $string = \"\";\n $write = fputs($fp, $string);\n $string = $namePort;\n $write = fputs($fp, $string);\n fclose($fp);\n\n $this->NamePort = $namePort;\n }", "public function port(int $port): static\n {\n return $this->setPort($port);\n }", "public function setGearmanPort(int $port) : void\n {\n if ($port < 1 || $port > 65535) {\n throw new ManagerException('Invalid port number.');\n }\n $this->gearmanPort = $port;\n }", "public function setRemotePort(int $port)\n {\n $this->_remotePort = $port;\n\n return $this;\n }", "public function getPort()\r\n\t{\r\n\t\treturn $this->port;\r\n\t}", "public function getPort(){\r\n return $this->Port;\r\n }", "public function getPort()\n\t{\n\t\treturn (int) $this->port;\n\t}", "public function port()\n {\n }", "public function getPort()\n {\n return (int)$this->port;\n }", "public function SetPortEnvio($portEnvio){\n\t\t\t\n\t\t\t\t$this->portEnvio = $portEnvio;\n\t\t\n\t\t}", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "function setServer( $address, $port ) {\n\t\t$this->address = $address;\n\t\t$this->port = $port;\n\t}", "public function getPort() {\n return $this->port;\n }", "public function getPort() {\n return $this->port;\n }", "public function getPort()\n {\n return $this->_port;\n }", "public function getPort()\n {\n return $this->_port;\n }", "function resetPort() {\n\t\t$this->port = 80;\n\t}", "public function getPort() {\n return @$this->attributes['port'];\n }", "public function setServer($host, $port = 0)\n\t{\n\t\t$this->host = $host;\n\t\t$this->port = $port;\n\t}", "private function setProxyPort($pp){\n\t\t$this->proxy_port = $pp;\n\t}", "public function setDbPort ($dbPort) {\n $this->dbPort = $dbPort;\n }", "public function getPort(): int {\n return (integer) $this->port;\n }", "public function getPort() {}", "public function getPort(): int;", "public function getPort();", "public function getPort();", "public function getPort();", "public function getPort();", "public function getPort(): int\n\t{\n\t\treturn $this->iPort;\n\t}", "public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }", "public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }", "protected function _setPort($uri){\n if (!$this->_uri->getPort()) {\n $port = (parse_url($uri, PHP_URL_SCHEME) == 'https') ? 443 : 80;\n $this->_uri->setPort($port);\n }\n }", "public function getPortIdentifier()\n {\n return $this->port;\n }", "final public function getPort(): int {}", "public function getPort(): int\n {\n }", "public function getPort() {\n return $this->getConfig('port', $this->defaults['port']);\n }", "public function getPort() : string\n {\n return $this->port;\n }", "public function withPort($port): self\n {\n $port = $this->formatPort($port);\n if ($port === $this->port) {\n return $this;\n }\n\n $clone = clone $this;\n $clone->port = $port;\n $clone->authority = $clone->setAuthority();\n $clone->assertValidState();\n\n return $clone;\n }", "public function getPort()\n {\n return $this->getConfig('port');\n }", "public function port(int $port, \\Closure $group, array $options = []): void\n {\n if($this->cache_status){\n return;\n }\n $prev_group_options = $this->group_options;\n $options['port'] = $port;\n $this->group_options = $this->options_merge($this->group_options, $options);\n \\call_user_func_array($group, [$this]);\n $this->group_options = $prev_group_options;\n }", "function setFtp_port($ftp_port) {\n\t\tif( !isset($this->conn_id) ) {\n\t\t\t$this->ftp_port = $ftp_port;\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function bind($port) {\n $this->startListeningTo($port);\n $this->acceptConnection();\n }", "public function getPort()\n {\n return isset($this->Port) ? $this->Port : null;\n }", "public function setPorts(array $ports = [])\n {\n return $this->setSpec('ports', $ports);\n }", "public function getPort(): int {\n return $this->context->port;\n }" ]
[ "0.8972873", "0.8920385", "0.88408536", "0.88402736", "0.8814466", "0.8814392", "0.8814392", "0.8793737", "0.8793737", "0.87165165", "0.86611485", "0.85476255", "0.85403866", "0.8460845", "0.8321881", "0.82399565", "0.821368", "0.821368", "0.821368", "0.8142973", "0.8116791", "0.8070691", "0.8057031", "0.7999166", "0.7912932", "0.7912932", "0.78542167", "0.7847245", "0.7760951", "0.7683664", "0.76385766", "0.76336694", "0.76336694", "0.7597228", "0.75902575", "0.7502847", "0.7428289", "0.73926914", "0.73926914", "0.7284829", "0.7220961", "0.71532655", "0.70747274", "0.70070195", "0.6992849", "0.6942903", "0.69105834", "0.69049346", "0.6862068", "0.6851375", "0.6791768", "0.67885256", "0.67832065", "0.67786664", "0.6774523", "0.6764121", "0.6764121", "0.6764121", "0.6764121", "0.6764121", "0.6764121", "0.6764121", "0.6764121", "0.6764121", "0.6764121", "0.6764121", "0.67606246", "0.67051506", "0.67051506", "0.66924626", "0.66924626", "0.6674514", "0.6573698", "0.6566572", "0.6447012", "0.64151007", "0.640223", "0.6364806", "0.6340295", "0.63340646", "0.63340646", "0.63340646", "0.63340646", "0.6331461", "0.6275824", "0.6275824", "0.6260269", "0.6260055", "0.6245507", "0.62448055", "0.6227863", "0.62089276", "0.618788", "0.6187229", "0.6187159", "0.6180278", "0.61685437", "0.61357874", "0.6134662", "0.6126103" ]
0.76843905
29
Returns value of 'port' property
public function getPort() { $value = $this->get(self::port); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPort() {\n return @$this->attributes['port'];\n }", "public function getPort()\n {\n return (int)$this->port;\n }", "public function getPort()\r\n\t{\r\n\t\treturn $this->port;\r\n\t}", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort()\n {\n return $this->port;\n }", "public function getPort(){\r\n return $this->Port;\r\n }", "public function getPort()\n {\n return $this->_port;\n }", "public function getPort()\n {\n return $this->_port;\n }", "public function getPort() {\n return $this->port;\n }", "public function getPort() {\n return $this->port;\n }", "public function getPort()\n\t{\n\t\treturn (int) $this->port;\n\t}", "static public function getPort() {\n\t\treturn self::port;\n\t}", "public function getPort() : string\n {\n return $this->port;\n }", "public function getPort() {\n return $this->getConfig('port', $this->defaults['port']);\n }", "public function getPort()\n {\n return $this->getConfig('port');\n }", "public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }", "public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }", "public function getPort() {}", "public function getPort();", "public function getPort();", "public function getPort();", "public function getPort();", "public function getPort()\n {\n return isset($this->Port) ? $this->Port : null;\n }", "public function getPort(): int {\n return (integer) $this->port;\n }", "public function getPort(): int {\n return $this->context->port;\n }", "public function getPortIdentifier()\n {\n return $this->port;\n }", "public function getPort(): int\n\t{\n\t\treturn $this->iPort;\n\t}", "public function getPort(): int;", "public function getPort()\n {\n return $this->wrapped->getPort();\n }", "final public function getPort(): int {}", "public function getPort()\n {\n if (null === $this->port) {\n $this->detectPort();\n }\n\n return $this->port;\n }", "public function getPort(): int\n {\n }", "public function getPort()\n {\n return isset($this->urlParts['port']) ? $this->urlParts['port'] : NULL;\n }", "public function getPort():? int;", "function getPort() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_PORT);\n\t}", "public function port() {\n return $this->db['port'];\n }", "protected function getConfiguredPort() {}", "public function getPort(): ?int {\n\t\treturn $this->port;\n\t}", "static function Port()\n {\n return self::Variable('SERVER_PORT');\n }", "public function getBasePort()\n {\n return (int)$this['base.port'];\n }", "public function GetPort() {\n\n return intval($this->GetRequestContext()->SERVER['SERVER_PORT']);\n }", "public function getPortName()\n {\n return isset($this->port_name) ? $this->port_name : '';\n }", "public function getPortName()\n {\n return isset($this->port_name) ? $this->port_name : '';\n }", "public static function getPort()\n {\n if (!isset(self::$_data[self::KEY_PORT]))\n {\n $_port = $_SERVER[\"SERVER_PORT\"];\n if (isset($_SERVER[\"HTTP_X_FORWARDED_PORT\"]) && strlen($_SERVER[\"HTTP_X_FORWARDED_PORT\"]) > 0)\n {\n $_port = $_SERVER[\"HTTP_X_FORWARDED_PORT\"];\n }\n self::setPort($_port);\n }\n\n return self::$_data[self::KEY_PORT];\n }", "public function port($port);", "public static function getPort()\n {\n return $_SERVER['SERVER_PORT'];\n }", "public function getPort()\n {\n $port = $this->serverAttributes()['REMOTE_PORT'];\n\n if (!$port) {\n return false;\n }\n\n return $port;\n }", "public function port() {\n if ($this->proxy_port)\n return $this->proxy_port;\n\n return '';\n }", "private function getPort ()\n\t\t{\n\t\t\t$server_config = $this->config['server'];\n\t\t\t$config_data = file( $this->config['server'] );\n\t\t\t$i=0;\n\t\t\twhile ( $i < count ( $config_data ) ) {\n\t\t\t\tif(strstr ( $config_data [$i] , \"port\" ) ) { /* line of port in server.conf */\n\t\t\t\t\t$buffer = explode (\" \" , $config_data[$i] ) ;\n\t\t\t\t\tif ( count ( $buffer ) == 2 ) \n\t\t\t\t\t\t$this->result['data']['port'] = trim($buffer[1]);\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn;\n\t\t}", "public function getDestinationPort()\n {\n return $this->destination_port;\n }", "public function getDestinationPort()\n {\n return $this->destination_port;\n }", "public function getPort()\n {\n\n $scheme = $this->getScheme();\n if (empty($this->_port) || (\n (isset(self::$_defaultPorts[$scheme]) && $this->_port === self::$_defaultPorts[$scheme])\n )) {\n\n return null;\n }\n\n return $this->_port;\n }", "protected function port()\n {\n // return env('APP_HTTP_PORT') != \"\" ? env('APP_HTTP_PORT') : $this->input->getOption('port');\n return env('TELSTAR_LOCAL_PORT') != \"\" ? env('TELSTAR_LOCAL_PORT') : $this->input->getOption('port');\n }", "public function getRemotePort()\n {\n return $this->server['REMOTE_PORT'];\n }", "protected function getConfiguredOrDefaultPort() {}", "public function port() : ?int;", "public function remotePort()\n {\n return $this->_remotePort;\n }", "public function getSourcePort()\n {\n return $this->source_port;\n }", "public function getSourcePort()\n {\n return $this->source_port;\n }", "function getServerPort() {\n\t\treturn $this->getParam(self::PARAM_SERVER_PORT);\n\t}", "public function getPort() {\n\n if (empty($this->uriParts['port'])) {\n return NULL;\n }\n else {\n if ($this->getScheme()) {\n if ($this->uriParts['port'] == Constants::STANDARD_PORTS[$this->getScheme()]) {\n return null;\n }\n }\n return (int) $this->uriParts['port'];\n }\n }", "public static function getPort() {\n\t if(!isset(self::$port)) {\n\t self::$port = isset($_SERVER['SERVER_PORT'])\n\t ? intval($_SERVER['SERVER_PORT'])\n\t : 80;\n\t }\n\t return self::$port;\n\t}", "public function getCustomNetPort() {\n return (integer) $this->getValue('customnetport');\n }", "public function getPort()\n {\n if (is_null($this->_port)) {\n $this->_port = !self::getIsSecureConnection() && isset($_SERVER['SERVER_PORT']) ? (int) $_SERVER['SERVER_PORT'] : 80;\n }\n\n return $this->_port;\n }", "protected function port()\n {\n return env( 'APP_HTTP_PORT' ) != \"\" ? env( 'APP_HTTP_PORT' ) : $this->input->getOption('port');\n }", "static function Port ()\n\t\t{\n\t\t\tif (php_sapi_name() === \"cli\")\n\t\t\t\treturn NULL;\n\t\t\treturn isset ($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : \"\";\n\t\t}", "public function getMessPort ()\n {\n return $this->mess_port;\n }", "public function getPorts()\n {\n return $this->_ports;\n }", "public function setPort($var)\n {\n GPBUtil::checkInt32($var);\n $this->port = $var;\n\n return $this;\n }", "public function setPort($var)\n {\n GPBUtil::checkInt32($var);\n $this->port = $var;\n\n return $this;\n }", "public function setPort($var)\n {\n GPBUtil::checkInt32($var);\n $this->port = $var;\n\n return $this;\n }", "public function port()\n {\n }", "public function getDbPort(): string\n {\n return (string) Config::get('DB_PORT');\n }", "public function port()\n\t{\n\t\treturn $this->header('X-Forwarded-Port') ? (int)$this->header('X-Forwarded-Port') : (int)$this->server('SERVER_PORT');\n\t}", "public function getProxyPort();", "public function setPort($var)\n {\n GPBUtil::checkString($var, True);\n $this->port = $var;\n\n return $this;\n }", "public function originPort() {\n\t\treturn $this->getOriginPort();\n\t}", "public function getDbPort () {\n return $this->dbPort; \n }", "public function GetPortEnvio(){\n\t\t\t\n\t\t\t\treturn $this->portEnvio;\n\t\t\n\t\t}", "public function getPort() {\n\n if (isset($this->port)) {\n return $this->port;\n }\n\n return '27017';\n }", "public function getPort()\n\t{\n\t\tif ($this->isUsingTrustedProxy()) {\n\t\t\tif ($this->hasHeader(self::$trustedHeaderNames[self::CLIENT_PORT])) {\n return (int) $this->getHeaderLine(self::$trustedHeaderNames[self::CLIENT_PORT]);\n } else if ($this->getHeaderLine(self::$trustedHeaderNames[self::CLIENT_PROTO]) === 'https') {\n\t\t\t\treturn 443;\n\t\t\t}\n\t\t}\n\n\t\tif ($this->hasServerParam('SERVER_PORT')) {\n\t\t\treturn (int) $this->getServerParam('SERVER_PORT');\n\t\t}\n\n\t\treturn (int) self::$standardPorts[$this->getHttpScheme()];\n\t}", "public function getGearmanPort() : int\n {\n return $this->gearmanPort;\n }", "public function getMailPort() {\n return $this->mailPort;\n }", "public function setPort($port);", "public function setPort($port);", "public function getPortSpecification()\n {\n return isset($this->port_specification) ? $this->port_specification : '';\n }", "public function getPortSpecification()\n {\n return isset($this->port_specification) ? $this->port_specification : '';\n }", "public function getPortList()\n {\n $value = $this->get(self::PORTLIST);\n return $value === null ? (string)$value : $value;\n }", "public function test_getport_is_returning_the_correct_value(): void\n {\n $expected = 896;\n $actual = $this->secureRequest->getPort();\n $this->assertEquals($expected, $actual);\n }", "function getProxyPort() {\n\t\treturn $this->m_proxyPort;\n\t}", "public function getServerPort()\n {\n return (int)$_SERVER['SERVER_PORT'];\n }" ]
[ "0.88199407", "0.85959375", "0.8585278", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.85842", "0.8583538", "0.8540972", "0.8540972", "0.85364634", "0.85364634", "0.84758043", "0.8436434", "0.8414167", "0.840175", "0.8399054", "0.8331208", "0.8331208", "0.8283726", "0.8276464", "0.8276464", "0.8276464", "0.8276464", "0.8210834", "0.8208192", "0.8128839", "0.8095318", "0.8089504", "0.80608815", "0.80055356", "0.78587127", "0.7856482", "0.77568644", "0.76623124", "0.7619519", "0.75958276", "0.75580525", "0.7552298", "0.7546732", "0.754031", "0.7528046", "0.75179374", "0.74984473", "0.74984473", "0.7369267", "0.7366253", "0.7323195", "0.7315659", "0.72956306", "0.7279423", "0.72741896", "0.72741896", "0.7257457", "0.7253072", "0.723458", "0.7231259", "0.7222394", "0.7216042", "0.7196542", "0.7196542", "0.7148615", "0.7141324", "0.71197605", "0.71002275", "0.7093726", "0.7014157", "0.6966533", "0.6936909", "0.6871027", "0.68566334", "0.68566334", "0.68566334", "0.68510145", "0.6812749", "0.677722", "0.6773116", "0.67687035", "0.67574114", "0.6741814", "0.67369497", "0.6666441", "0.662062", "0.65670156", "0.65605223", "0.6547812", "0.6547812", "0.6547364", "0.6547364", "0.65404654", "0.64803505", "0.64741576", "0.6422461" ]
0.86042583
1
Sets value of 'module' property
public function setModule($value) { return $this->set(self::module, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setModule($module) {\r\n\t\t$this->module = $module;\r\n\t}", "public function setModule($module)\n {\n $this->module = $module;\n }", "public function setModule(string $module)\n\t{\n\t\t$this->module=$module; \n\t\t$this->keyModified['module'] = 1; \n\n\t}", "public function setModuleName($module);", "public function set_module (Module $module) {\n\t\tif (!in_array($module, $this->modules))\n\t\t\t$this->modules[] = $module;\n\t}", "public function setModule($module)\n\t{\n\t\t$this->module = ky_assure_constant($module, $this, 'MODULE');\n\t\treturn $this;\n\t}", "public function setModule($module){\r\n\t\t$this->config['module'] = $module;\r\n\t\treturn $this;\r\n\t}", "public function setModule($m)\n {\n $this->cvsModule = $m;\n }", "function setModule($moduleID){\n\t\tif(is_numeric($moduleID))\n\t\t\t$this->moduleID = $moduleID;\n\t\tif(is_object($moduleID))\n\t\t\t$this->moduleID = $moduleID->getID();\n\t}", "public function testSetModule() {\r\n $this->assertInstanceOf('PM\\Main\\Event\\Action\\Emit', $this->_action->setModule('Module'));\r\n $this->assertEquals('Module', $this->_action->getModule());\r\n }", "function setModuleVar( $module, $var, $val=NULL ) {\n Registry::set(esf_Extensions::MODULE.'.'.$module.'.'.$var, $val);\n}", "public function setModule($module) {\n\t\t$this->module = $module;\n\t\treturn $this;\n\t}", "private function _setModule()\n\t{\n\t\tif (preg_match('/^[a-z0-9_-]+$/', $this->_requestVars[0])) {\n\t\t\t$this->_module = $this->_requestVars[0];\n } else {\n \t$this->_module = $this->_requestVars[0] = self::DEFAULT_MODULE;\n }\n\n return $this;\n\t}", "public function setDefaultModule($module);", "public function set_module_name($name) {\n\t\t$this->my_module_name = $name;\n\t}", "public function setModule($dir)\n {\n $this->module = str_replace(array('/', '.'), '', $dir);\n }", "function setCurrentModule($currentModule) {\n unset($this->local_current_module);\n $this->local_current_module = $currentModule;\n if(isset($this->xTemplate))$this->xTemplate->assign(\"MODULE_NAME\", $this->local_current_module);\n}", "public function configure_module() {\n\n\t\t$module = $this->request->get('module', null);\n\t\t$config = $this->getModuleConfiguration($module);\n\t\tif ($config === null) $config = array();\n\n\t\tExtJSResponse::put('config', $config);\n\t\tExtJSResponse::answer();\n\t}", "public function setDefaultModule($module){ \r\n\t\t$this->_default_module = $module;\r\n\t}", "public function setModules()\n\t{\n \t//Zend_Registry::set('modules', $modules->getList());\n\t}", "public function Module($module){\r\n $fullpath=YMODULEDIR.ucwords($module).EXT;\r\n $this->Load($fullpath);\r\n }", "public function setModules($modules)\n {\n $this->modules = (array)$modules;\n }", "public function set_coursemodule($cm=null) {\n if ($cm == null) {\n $this->courseid = 0;\n $this->coursemoduleid = 0;\n } else {\n $this->cmarray = null;\n $this->courseid = (int)$cm->course;\n $this->coursemoduleid = (int)$cm->id;\n }\n }", "function Module($page){\r\n\t\t$this->page=$page;\r\n\t}", "public function setModules($modules);", "public function testGetModule() {\r\n $action = $this->_action;\r\n\r\n $this->assertEquals(null, $action->getModule());\r\n\r\n $action->setModule('Test');\r\n $this->assertEquals('Test', $action->getModule());\r\n }", "public function set_webapp_module($action, $module = null)\n {\n WebApp::set_boot_module($module === null ? $this->_module_name : ($module === false ? null : $module), $action);\n }", "public function setDatabaseModule($database) {\n\t\t\t$this->database_module = $database;\n\t\t}", "function atkModule($name=\"\")\n {\n $this->m_name = $name;\n }", "function setModulePref($module,$var,$value,$userID=0)\n {\n $db = & JxSingleton::factory('db');\n\n if(!$userID)\n {\n $user = & JxSingleton::factory('user');\n $userID = $user->userID;\n }\n\n if(!DB::isError($db))\n {\n\n $sql = \"REPLACE INTO preferences\n SET userID='\".$userID.\"',\n module='$module',\n var='$var',\n value='$value'\";\n \n $result = $db->query($sql);\n \n return (!DB::isError($result));\n }\n }", "public function setModuleName($module) {\n\t\tif (!is_string($module))\n\t\t{\n\t\t\tthrow new Yaf_Request_Exception('Expect a string module name');\n\t\t}\n\t\t$this->module = $module;\n\n\t\treturn $this;\n\t}", "protected function setDivision(GUIComponent $module)\n {\n if (!$this->division) {\n $this->division = new Division;\n $this->division->setClass(\"sidebar\");\n }\n $this->division->add($module);\n }", "function setSessionModuleVar( $module, $var, $val=NULL ) {\n Session::set(esf_Extensions::MODULE.'.'.$module.'.'.$var, $val);\n}", "public function set_active($modul)\n {\n }", "public function module() {\n return $this->module;\n }", "private function _setPagSeguroModuleVersion(){\n PagSeguroLibrary::setModuleVersion('prestashop-v.'.$this->module->version);\n }", "protected function _setModuleDir($dir)\n {\n $this->_moduleDir = (string) $dir;\n }", "public function setConfigModule($id) {\n return $this->configModule = $id;\n }", "public function setIdModule($idModule) \n\t{\n\t\t$this->idModule = $idModule;\n\t\treturn $this;\n\t}", "public function getModule(){\n return $this->module;\n }", "public function toggleModule($module)\n {\n $this->removeModule($module) or $this->addModule($module);\n }", "protected function addModule()\n {\n Mongez::append('modules', strtolower($this->moduleName));\n }", "function addModuleVar( $module, $var, $val ) {\n Registry::add(esf_Extensions::MODULE.'.'.$module.'.'.$var, $val);\n}", "protected function registerModule()\n {\n //determine module and bind urls\n $requestUri = $this->url;\n if(empty($requestUri)) {\n $requestUri = '/';\n }\n if($requestUri == '/') {\n $mod = 'index';\n } else {\n $requestUri = trim($requestUri, '/');\n if(strpos($requestUri, '/') === false) {\n $mod = $requestUri;\n } else {\n list($mod) = explode('/',$requestUri);\n }\n }\n $mod = filter_var($mod, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n $this->mod = $mod;\n $this->uri = $requestUri;\n }", "public function addModule($module)\n {\n $this->modules[$module] = $module;\n }", "public function addModule($module)\n {\n $this->modules[] = $module;\n }", "public function setDefaultModule($module)\n {\n $this->_defaultModule = (string) $module;\n return $this;\n }", "protected function setEngineModules()\n {\n $mods = ModulesModel::getEnabled();\n if ($mods) {\n foreach ($mods as $module) {\n $this->setModules(array($module->name => array(\n 'access' => $module->access\n )\n ));\n }\n }\n }", "public function getModule();", "public function getModule();", "function setProperty($name, $value) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_module_options.php');\n base_module_options::writeOption($this->moduleGuid, $name, $value);\n }", "function spyropress_builder_register_module( $module ) {\n global $spyropress_builder;\n\n $spyropress_builder->modules->register( $module );\n}", "function update_module_option($mod_name, $key, $value) {\n $this->modules->$mod_name->options->$key = $value;\n $new_options = $this->modules->$mod_name->options;\n $result = update_option($this->clientele_prefix . $mod_name . '_options', (array) $new_options);\n $this->$mod_name->module = $this->modules->$mod_name;\n return $result;\n }", "public function setModuleScript($priModObj){\n\t\t\t\n\t\t\tif(!isset($_GET[\"moduleScripts\"])){\n\t\t\t\t$_GET[\"moduleScripts\"] = \"\";\n\t\t\t}\n\n\t\t\t#add/edit form JS Object or module items JS Object\n\t\t\tif(\n\t\t\t\t$priModObj[0]->isTemplate==0 || \n\t\t\t\t$priModObj[0]->isTemplate==1 ||\n\t\t\t \t$priModObj[0]->isTemplate==3\n\t\t\t){\n\t\t\t\t$_GET[\"moduleScripts\"] .= '\n\t\t\t\tmIP =' . $priModObj[0]->jsonInstanceProp . ';\n\n\t\t\t\tif(!window[mIP.modProp.jsObject]){\n\t\t\t\t\twindow[mIP.modProp.jsObject] = function(){};\n\t\t\t\t\twindow[mIP.modProp.jsObject].prototype = new stealthCommon();\n\t\t\t\t};';\n\t\t\t}\n\n\t\t\t#make an instance of out module type js object, if there is one\n\t\t\tif(\n\t\t\t\tstrlen($priModObj[0]->jsObject) > 0 && \n\t\t\t\t(\n\t\t\t\t\t$priModObj[0]->isTemplate==0 || \n\t\t\t\t\t$priModObj[0]->isTemplate==1 ||\n\t\t\t\t\t#trying this out for the password reset module\n\t\t\t\t\t$priModObj[0]->isTemplate==3\n\t\t\t\t)\n\t\t\t){\t\n\t\t\t\t#module settings\n\t\t\t\t$_GET[\"moduleScripts\"] .= '\n\t\t\t\twindow[mIP.modProp.jsObject].prototype.moduleID = mIP.instanceProp.moduleID;\n\t\t\t\twindow[mIP.modProp.jsObject].prototype.primaryPmpmAddEditID = mIP.modProp.primaryPmpmAddEditID;\n\t\t\t\twindow[mIP.modProp.jsObject].prototype.addEditPageID = mIP.modProp.addEditPageID;\n\t\t\t\twindow[mIP.modProp.jsObject].prototype.isTemplate = mIP.modProp.isTemplate;\n\n\t\t\t\t//ADD EDIT module properties\n\t\t\t\twindow[mIP.modProp.jsObject].prototype.apiPath = mIP.modProp.primaryAPIFile;\n\t\t\t\twindow[mIP.modProp.jsObject].prototype.moduleAlert = mIP.modProp.moduleAlert;\n\t\t\t\t\n\t\t\t\t//defaults for input fields that need to be handled in a special manner\n\t\t\t\t//format date and time for mysql\n\t\t\t\twindow[mIP.modProp.jsObject].prototype.timeFields = \"\";\n\t\t\t\t';\n\t\t\t\t\t\t\t\t\n\t\t\t\t#module instance settings\n\t\t\t\t$_GET[\"moduleScripts\"] .= '\n\t\t\t\twindow[mIP.instanceProp.className + \"Obj\"] = function(){};\n\t\t\t\twindow[mIP.instanceProp.className + \"Obj\"].prototype = new window[mIP.modProp.jsObject]();\t\n\t\t\t\t\t\t\t\n\t\t\t\t//automatically append instance properties\n\t\t\t\tfor(var key in mIP.instanceProp) {\n\t\t\t\t\tif(key == \"priKeyID\") {\n\t\t\t\t\t\twindow[mIP.instanceProp.className + \"Obj\"].prototype.pmpmID = mIP.instanceProp[key];\n\t\t\t\t\t}\n\t\t\t\t\telse if(key == \"className\"){\n\t\t\t\t\t\twindow[mIP.instanceProp.className + \"Obj\"].prototype.moduleClassName = mIP.instanceProp[key];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(key == \"clickScroll\"){\n\t\t\t\t\t\twindow[mIP.instanceProp.className + \"Obj\"].prototype.slideAxis = mIP.instanceProp[key];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(key == \"displayQty\"){\n\t\t\t\t\t\twindow[mIP.instanceProp.className + \"Obj\"].prototype.holdQty = parseInt(mIP.instanceProp[key]);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\telse{\n\t\t\t\t\t\twindow[mIP.instanceProp.className + \"Obj\"].prototype[key] = mIP.instanceProp[key];\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t';\n\t\t\t\t\n\t\t\t\t#alert the developer if they chose a bad className\n\t\t\t\tif($priModObj[0]->className . \"Obj\" === $priModObj[0]->jsObject){\n\t\t\t\t\t$_GET[\"moduleScripts\"] .= \"console.log('Stealth Error: Your className appended to \\\"Obj\\\" is the same as your jsObject. Change this modules className.');\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t#this module is probably being opened from withint another module\n\t\t\t\tif(isset($_REQUEST[\"quickEdit\"])) {\n\t\t\t\t\t$_GET[\"moduleScripts\"] .= 'window[mIP.instanceProp.className + \"Obj\"].prototype.quickAddEdit = true;';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$_GET[\"moduleScripts\"] .= '\n\t\t\t\twindow[mIP.instanceProp.className + \"Obj\"].prototype.slideFinished = true;';\n\t\t\t\t\n\t\t\t\t/*if we initialize this for the forms as well, it overwrites the \n\t\t\t\tfirst record when we add new records in the bulkAddEdit*/\n\t\t\t\tif(\n\t\t\t\t\t!isset($priModObj[0]->bulkMod) ||\n\t\t\t\t\tisset($priModObj[0]->bulkMod) && !isset($_GET[\"pmpmID\"]\n\t\t\t\t)){\n\t\t\t\t\t$_GET[\"moduleScripts\"] .= '\n\t\t\t\t\twindow[mIP.instanceProp.className] = new window[mIP.instanceProp.className + \"Obj\"]()\t\n\t\t\t\t\t';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t#load in rating system javascript\n\t\t\tif($priModObj[0]->hasRating == 1){\n\t\t\t\tob_start();\n\t\t\t\t\n\t\t\t\t#for some reason if we include this file it breaks the PHP output buffer!\n\t\t\t\t#include_once($_SERVER['DOCUMENT_ROOT'] . \"/js/rating/jquery.MetaData.js\");\n\t\t\t\tinclude_once($_SERVER['DOCUMENT_ROOT'] . \"/js/rating/jquery.rating.js\");\n\t\t\t\t\n\t\t\t\t$_GET[\"moduleScripts\"] .= ob_get_contents();\n\t\t\t\tob_end_clean();\n\t\t\t}\n\t\t\t\n\t\t\t#we only need to load in the script files once per module\n\t\t\tob_start();\n\t\t\tif(!$priModObj[0]->isThumb){\n\t\t\t\t#loop through the scripts for this module\n\t\t\t\t$jScripts = explode(\"?^^?\",$priModObj[0]->jScript);\n\t\t\t\tforeach($jScripts as $s){\n\t\t\t\t\tif(strlen($s) > 0) {\n\t\t\t\t\t\tinclude($_SERVER['DOCUMENT_ROOT'].$s);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t#if it's an add/edit module build up for our forms\n\t\t\tif($priModObj[0]->isTemplate == 0 || $priModObj[0]->isTemplate==1) {\n\t\t\t\tinclude($_SERVER['DOCUMENT_ROOT'] . \"/modules/moduleFrame/moduleScriptObjects.php\");\n\t\t\t}\n\t\t\t\n\t\t\t$_GET[\"moduleScripts\"] .= ob_get_contents();\n\t\t\t\n\t\t\tob_end_clean();\n\t\t\t\n\t\t\tif($priModObj[0]->instanceDisplayType==2){\n\t\t\t\t#set pagination properties\n\t\t\t\tif(isset($priModObj[0]->currentPagPage) && is_numeric($priModObj[0]->currentPagPage)){\n\t\t\t\t\t$_GET[\"moduleScripts\"] .= 'window[mIP.instanceProp.className].pagPage = \"' . $priModObj[0]->currentPagPage . '\";';\n\t\t\t\t}\n\t\t\t\telse $_GET[\"moduleScripts\"] .= 'window[mIP.instanceProp.className].pagPage = 1;';\n\t\t\t\t/*how many pages we can paginate through, don't update this on paginate\n\t\t\t\tbecause our paginate query is only the records we are displaying*/\n\t\t\t\tif(\n\t\t\t\t\t(strpos($_SERVER['REQUEST_URI'],\"modulePaginate.php\") === false &&\n\t\t\t\t\tstrpos($_SERVER['REQUEST_URI'],\"moduleInstanceSet.php\") === false) /*&&\n\t\t\t\t\t#not a module level > 2\n\t\t\t\t\tI DON\"T KNOW WHY WE HAD THIS CONDITION IN THERE! - jared\n\t\t\t\t\t!isset($priModObj[1])*/\n\t\t\t\t){\n\t\t\t\t\t$_GET[\"moduleScripts\"] .= 'window[mIP.modProp.jsObject].prototype.maxPagPage = \"' . $priModObj[0]->pageCounter . '\";';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($priModObj[0]->isThumb){\n\t\t\t\t$parentModule = $this->getModuleInfoQuery(\n\t\t\t\t\tNULL,$priModObj[0]->thumbParentID\n\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t$tm = mysqli_fetch_assoc($parentModule);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t#set parent class here to use in recursive call\n\t\t\t\t$priModObj[0]->parentClassName = $tm[\"className\"];\n\t\t\t\t$priModObj[0]->parentDisplayType = $tm[\"instanceDisplayType\"];\t\n\t\t\t\t\n\t\t\t\t$functionType = \"\";\n\t\t\t\t\n\t\t\t\t#fade rotate\n\t\t\t\tif($priModObj[0]->parentDisplayType == 0)\n\t\t\t\t\t$functionType = \"parentFade\";\t\n\t\t\t\t#click slide\n\t\t\t\telse if($priModObj[0]->parentDisplayType == 3) {\n\t\t\t\t\t$functionType = \"parentSlide\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t#prototype the module item to control the parent module frame item we keep track \n\t\t\t\t#of the parent and child instance name so they can call each others functions\n\t\t\t\t$_GET[\"moduleScripts\"] .= '\n\t\t\t\t\n\t\t\t\twindow[mIP.instanceProp.className].parentClassName = \"' . $priModObj[0]->parentClassName . '\";\n\t\t\t\twindow[mIP.instanceProp.className].parentDisplayType = \"' . $priModObj[0]->parentDisplayType . '\";\n\t\t\t\t\n\t\t\t\tmoduleInstanceItems = $(\".mi-\" + mIP.instanceProp.className);\n\t\t\t\tvar tmpMiCnt = moduleInstanceItems.length;\n\n\t\t\t\tfor(var m = 0; m < tmpMiCnt; m++){\n\t\t\t\t\tmoduleInstanceItems[m].onclick = function(){' . $priModObj[0]->className . '.' . $functionType . '(this);}\n\t\t\t\t}\n\t\t\t\t';\n\t\t\t}\n\t\t\t\n\t\t\tif($priModObj[0]->expandContractMIs == 1){\n\t\t\t\t$_GET[\"moduleScripts\"] .= '\n\t\t\t\t$(\"#mfmc-'.$priModObj[0]->className.'\").on(\n\t\t\t\t\t\"click\", \".expandBtn,.closeBtn\",\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tif($(this).hasClass(\"expandBtn\")){\n\t\t\t\t\t\t\tvar isExpanded = $(this).parent().hasClass(\"expanded\") ? true : false;\n\t\t\t\t\t\t\t$(\"#mfmc-'.$priModObj[0]->className.'\").find(\".expandWrap.expanded\").switchClass(\"expanded\",\"\",500).find(\".expandable.exp\").switchClass(\"exp\",\"\",500);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!isExpanded){\n\t\t\t\t\t\t\t\t$(this).next().switchClass(\"\",\"exp\",500).parent().switchClass(\"\",\"expanded\",500);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(this).parent().siblings().removeClass(\"expanded\").find(\".expandable.exp\").switchClass(\"exp\",\"\",500);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$(this).parent().siblings().removeClass(\"expanded\").find(\".expandable.exp\").switchClass(\"exp\",\"\",500);\n\t\t\t\t\t\t\t$(this).parent().removeClass(\"expanded\");\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t';\n\t\t\t}\n\t\t\t\n\t\t\t#disqus comments\n\t\t\tif($priModObj[0]->hasComments == 1){\n\t\t\t\t\n\t\t\t\t#the disqus_config callback fixes a bug when we would show/hide the disqus container\n\t\t\t\t$_GET[\"moduleScripts\"] .= '\n\t\t\t\t\tvar disqus_shortname = \"' . $priModObj[0]->disqusShortname . '\";\n\t\t\t\t\tdisqus_url = \"http://' . $_SERVER['SERVER_NAME'] . '/index.php?pageID=' . $priModObj[0]->pageID . $priModObj[0]->commentPriKeyIDParam . \"=\" .$priModObj[0]->queryResults[\"priKeyID\"] . '\";\n\t\t\t\t\tdisqus_config = function() {\n\t\t\t\t\t\tthis.callbacks.onReady = [function() {\n\t\t\t\t\t\t\t$(\"#disqus_thread iframe\").css({\n\t\t\t\t\t\t\t\t\"height\": \"500px\",\n\t\t\t\t\t\t\t\t\"height\": \"auto !important\",\n\t\t\t\t\t\t\t\t\"min-height\": \"500px\",\n\t\t\t\t\t\t\t\t\"overflow\": \"scroll !important\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}];\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\t(function() {\n\t\t\t\t\t\tvar dsq = document.createElement(\"script\"); \n\t\t\t\t\t\tdsq.type = \"text/javascript\"; dsq.async = true;\n\t\t\t\t\t\tdsq.src = \"http://\" + disqus_shortname + \".disqus.com/embed.js\";\n\t\t\t\t\t\t(document.getElementsByTagName(\"head\")[0] || document.getElementsByTagName(\"body\")[0]).appendChild(dsq);\n \t\t\t\t })();\n\t\t\t\t';\n\t\t\t}\n\t\t\t\n\t\t\t#SHARE THIS\n\t\t\tif(\n\t\t\t\tisset($priModObj[0]->domFields) &&\n\t\t\t\tarray_key_exists(\"Social Media\",$priModObj[0]->domFields)\n\t\t\t){\n\t\t\t\t\n\t\t\t\t$_GET[\"moduleScripts\"] .= '\t\n\t\t\t\t\t//load share this buttons\n\t\t\t\t\tif(typeof window.stButtons === \"undefined\")\t{\t\t\t\n\t\t\t\t\t\t$.getScript(\"http://w.sharethis.com/button/buttons.js\", function(data, textStatus, jqxhr) {\n\t\t\t\t\t\t\tvar switchTo5x = true;\n\t\t\t\t\t\t\tstLight.options({publisher: \"4b8fe4b5-0457-40d3-8a33-2937aa537cd0\", doNotHash: false, doNotCopy: false, hashAddressBar: false});\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t//reinitializes the buttons if we already loaded sharethis once\n\t\t\t\t\telse{\n\t\t\t\t\t\tstButtons.locateElements();\t\t\n\t\t\t\t\t}\n\t\t\t\t';\n\t\t\t}\n\t\t\t\t\t\n\t\t\t#prototype functions to module items to stop/start\n\t\t\tif(\n\t\t\t\t$priModObj[0]->autoChange == 1 && \n\t\t\t\t$priModObj[0]->autoChangeMouseOverDisable == 1\n\t\t\t){\n\n\t\t\t\t#standard module\n\t\t\t\tif($priModObj[0]->pageID < 0) {\n\t\t\t\t\t$timerObj = \"standardInterTime\";\n\t\t\t\t}\n\t\t\t\t#page module\n\t\t\t\telse { \n\t\t\t\t\t$timerObj = \"pageInterTime\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t#fade rotate\n\t\t\t\t$mouseOutFunction = \"\";\n\t\t\t\tif($priModObj[0]->instanceDisplayType == 0 ||\n\t\t\t\t$priModObj[0]->instanceDisplayType == 4){\n\t\t\t\t\t$_SESSION[\"modulePageTransition\"] .= $mouseOutFunction.= \n\t\t\t\t\t$timerObj . '.' . $priModObj[0]->className . ' = setInterval(\n\t\t\t\t\t\t\\'' . $priModObj[0]->className . '.fadeRotate(' . $priModObj[0]->autoChangeDirection . ')\\',\n\t\t\t\t\t\t' . $priModObj[0]->autoChangeDuration . '\n\t\t\t\t\t);' . PHP_EOL;\n\t\t\t\t}\n\t\t\t\t#click slide\n\t\t\t\telse if($priModObj[0]->instanceDisplayType == 3){\n\t\t\t\t\t$_SESSION[\"modulePageTransition\"] .= $mouseOutFunction.= \n\t\t\t\t\t$timerObj . '.' . $priModObj[0]->className . ' = setInterval(\n\t\t\t\t\t\t\\'' . $priModObj[0]->className . '.clickSlide(' . $priModObj[0]->autoChangeDirection . ')\\',\n\t\t\t\t\t\t' . $priModObj[0]->autoChangeDuration . '\n\t\t\t\t\t);' . PHP_EOL;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(\n\t\t\t\t\t$priModObj[0]->instanceDisplayType == 0 ||\n\t\t\t\t\t$priModObj[0]->instanceDisplayType == 4 ||\n\t\t\t\t\t$priModObj[0]->instanceDisplayType == 3\n\t\t\t\t){\n\t\t\t\t\t\n\t\t\t\t\t#can't set this until the dom is ready\n\t\t\t\t\t$_SESSION[\"modulePageTransition\"] .= '\n\t\t\t\t\t\t$s(\"mfmc-' . $priModObj[0]->className . '\").onmouseover = \n\t\t\t\t\t\tfunction(event){\n\t\t\t\t\t\t\tif(event){\n\t\t\t\t\t\t\t\tevent.cancelBubble = true; //prevent event bubbling\n\t\t\t\t\t\t\t\tif(event.stopPropagation) { \t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif(typeof(' . $timerObj . '.' . $priModObj[0]->className . ') !== \"undefined\"){console.log(\"fateme\",event);\t\n\t\t\t\t\t\t\t\twindow.clearInterval(' . $timerObj . '.' . $priModObj[0]->className . ');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$s(\"mfmc-' . $priModObj[0]->className . '\").onmouseout = \n\t\t\t\t\t\tfunction(event){\n\t\t\t\t\t\t\tif(event){\n\t\t\t\t\t\t\t\tevent.cancelBubble = true; //prevent event bubbling\n\t\t\t\t\t\t\t\tif(event.stopPropagation) event.stopPropagation();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t' . $mouseOutFunction . '\n\t\t\t\t\t\t}\n\t\t\t\t\t'\n\t\t\t\t\t;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#setup thumnails for this module\t\n\t\t\tif($priModObj[0]->clickThumbs == 1){\t\t\t\n\t\t\t\t$thumbModule = $this->getModuleInfoQuery(\n\t\t\t\t\tNULL,$priModObj[0]->clickThumbsPmpmID\n\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t$tm = mysqli_fetch_assoc($thumbModule);\n\t\t\t\t\t\t\t\t\n\t\t\t\t/*if this is a level 2 or greater module, append the prikeyID \n\t\t\t\tof the parent to the class name to keep unique id's in the html*/\n\t\t\t\t$objQty = count($priModObj);\n\t\t\t\t\n\t\t\t\t$tempParentPriKeyIDs = \"\";\n\t\t\t\tfor($x = 0; $x < $objQty; $x++) {\n\t\t\t\t\tif(isset($priModObj[$x]) && isset($priModObj[$x]->queryResults)) {\n\t\t\t\t\t\t#used in the DOM\n\t\t\t\t\t\t$tempParentPriKeyIDs .= $priModObj[$x]->queryResults[\"priKeyID\"];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t#we keep track of the parent and child instance name so they can call each others functions\n\t\t\t\t$_GET[\"moduleScripts\"] .= 'window[mIP.instanceProp.className].childClassName = \"' . $tm[\"className\"] . $tempParentPriKeyIDs . '\";';\n\t\t\t}\n\t\t}", "public function moduleName($name = null)\n\t{\n\t\treturn $this->getSet(\"moduleName\", $name);\n\t}", "public function initModuleCode() {\n $this->module_code = 'wk_pricealert';\n }", "function save_module($module)\n\t{\n\t\t$this->insertIntoAttachment($this->id,$module);\n\t}", "public function set_coursemodule_array($cmarray) {\n if (is_array($cmarray) && empty($cmarray)) {\n // Specifying an empty array, meaning there should be no results,\n // causes problems. This code ensures that the array is not empty\n // but it won't find any results.\n $cmarray = array((object)array('id' => -1, 'course' => -1));\n }\n $this->cmarray = $cmarray;\n if ($cmarray) {\n $singlecourse = 0;\n foreach ($cmarray as $cm) {\n if (!$singlecourse) {\n $singlecourse = $cm->course;\n } else if ($singlecourse != $cm->course) {\n $singlecourse = -1;\n }\n }\n $this->courseid = $singlecourse > 0 ? $singlecourse : 0;\n $this->coursemoduleid = 0;\n }\n }", "public static function set($module, $id, $data) {\n return self::setDb($module, $id, $data);\n \n\n }", "public function edit(Module $module)\n {\n //\n }", "public function setModules($mod_type, $modules) {\n\n $module_path = $mod_type == 'core' ? $this->dir['modules_core'] : $this->dir['modules_custom'];\n\n foreach ($modules as $k => $module) {\n $this->modules[$module] = array(\n 'name' => $module,\n 'path' => $module_path . '/' . $module,\n );\n }\n }", "public function setRefundBy($module = '')\n {\n if($_POST)\n {\n $this->loadModel('setting')->setItem('system.oa.refund.refundBy', $this->post->refundBy);\n if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));\n $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));\n }\n\n if($module)\n {\n $this->lang->menuGroups->refund = $module;\n $this->lang->refund->menu = $this->lang->$module->menu;\n }\n\n $this->view->title = $this->lang->refund->refundBy;\n $this->view->users = $this->loadModel('user')->getPairs('nodeleted,noclosed,noforbidden');\n $this->view->module = $module;\n $this->display();\n }", "function addModule($modName){\n $params = explode(\"_\",$modName);\t\t\t\t/* Modulname und Sensorid trennen */\n new Module($params[0], $params[1], $this->_getParserInstance(), $this->_getConnInstance());\n }", "public function initContent($module)\n {\n $this->module = $module;\n $this->languageId = (int)Tools::getValue('language_id', NostoHelperContext::getLanguageId());\n $this->connect();\n }", "public function _construct()\r\n {\r\n $this->moduleHelper->setModuleName(self::MODULE_NAME_CONFIG_PATH);\r\n }", "function setModerator( $group )\r\n {\r\n if ( is_a( $group, \"eZUserGroup\" ) )\r\n {\r\n $this->ModeratorID = $group->id();\r\n }\r\n else if ( is_numeric( $group ) )\r\n {\r\n $this->ModeratorID = $group;\r\n }\r\n }", "protected function getModule()\n {\n return $this->mod;\n }", "public function getModule()\n {\n return $this->module;\n }", "public function __construct($module) {\n $this->middleware(['role:administrator']);\n\n $this->module = $module;\n $this->folder = Config::get('modules.'.$this->module.'.folder');\n $this->model_name = Config::get('modules.'.$this->module.'.model_name');\n\n //First breadcrumb is always the admin dashboard\n $this->addBreadcrumb(route('admin'), \"Dashboard\");\n\n\n //Add module breadcrumb\n if($this->folder != \"home\") $this->addBreadcrumb(\"/admin/\".$this->folder, Config::get('modules.'.$this->module.'.title'));\n }", "public static function processModuleSettings(Module $module, string $jsTemplateName): void\n {\n // Load the config\n if (empty($module->dk_mmenuConfig) || !($config = MmenuConfigModel::findByPk($module->dk_mmenuConfig)) instanceof MmenuConfigModel) {\n return;\n }\n\n // Check for a valid CSS ID\n $cssID = $module->cssID;\n\n if (empty($cssID[0])) {\n $cssID[0] = $module->type.'-'.substr(md5($module->type.$module->id), 0, 8);\n $module->cssID = $cssID;\n }\n\n // Create the JavaScript template\n $jsTemplate = new FrontendTemplate($jsTemplateName);\n $jsTemplate->elementId = $cssID[0];\n\n // Prepare the options and configuration for mmenu\n $options = [];\n $configuration = [\n 'classNames' => [\n 'selected' => 'active',\n ],\n ];\n\n if (!empty($config->navbarTitle)) {\n $options['navbar']['title'] = $config->navbarTitle;\n } elseif ('en' !== $GLOBALS['TL_LANGUAGE']) {\n $options['navbar']['title'] = $GLOBALS['TL_LANG']['DK_MMENU']['title'];\n }\n\n // https://mmenujs.com/docs/core/off-canvas.html\n if ($config->pageSelector) {\n $configuration['offCanvas']['page']['selector'] = StringUtil::decodeEntities($config->pageSelector);\n }\n\n if (\\in_array($config->position, ['left', 'right', 'top', 'bottom'], true)) {\n $options['offCanvas']['position'] = $config->position;\n }\n\n if ('back' !== $config->zposition && \\in_array($config->position, ['left', 'right'], true)) {\n $options['offCanvas']['position'] = $config->position.'-'.$config->zposition;\n }\n\n // https://mmenujs.com/docs/core/options.html\n if ('vertical' === $config->slidingSubmenus) {\n $options['slidingSubmenus'] = false;\n }\n\n // https://mmenujs.com/docs/core/theme.html\n if (\\in_array($config->theme, ['light', 'dark', 'white', 'black'], true)) {\n $options['theme'] = $config->theme;\n\n if ($config->themeHighContrast) {\n $options['theme'] = $config->theme.'-contrast';\n }\n }\n\n // https://mmenujs.com/docs/addons/counters.html\n if ($config->countersAdd) {\n $options['counters']['add'] = true;\n }\n\n // https://mmenujs.com/docs/addons/searchfield.html\n if ($config->searchfieldAdd) {\n $options['navbars'] = [\n [\n 'position' => 'top',\n 'content' => [\n 'searchfield',\n ],\n ],\n ];\n\n if ('en' !== $GLOBALS['TL_LANGUAGE']) {\n $options['searchfield']['noResults'] = $GLOBALS['TL_LANG']['DK_MMENU']['noResult'];\n $options['searchfield']['placeholder'] = $GLOBALS['TL_LANG']['DK_MMENU']['placeholder'];\n }\n }\n\n // https://mmenujs.com/docs/addons/icon-panels.html\n if ($config->iconPanels) {\n $options['iconPanels'] = [\n 'add' => true,\n 'visible' => 1,\n ];\n }\n\n // Add options and configuration to JavaScript template\n $jsTemplate->options = $options;\n $jsTemplate->configuration = $configuration;\n\n // Add module JavaScript (and replace insert tags, see #66)\n $GLOBALS['TL_BODY'][] = Controller::replaceInsertTags($jsTemplate->parse());\n }", "protected function setMigrationPath($module)\r\n {\r\n if (!isset($this->migrationPaths[$module]) || !isset($this->migrationPaths[$module]['path'])) {\r\n throw new \\Exception(\"Undefinied module or wrong path format.\"); \r\n }\r\n\r\n $this->migrationPath = $this->migrationPaths[$module]['path'];\r\n }", "public function __set($name, $value)\n\t{\n\t\tthrow new Exception('Cannot set module variables directly');\n\t}", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function getModule()\n\t{\n\t\treturn $this->module; \n\n\t}", "public static function initModule($name, $resource=null){\n if(is_array($name) && $resource == null){\n self::$modules = $name;\n }else{\n if(self::$modules == null){\n self::$modules = array();\n }\n self::$modules[$name] = $resource;\n }\n }", "public final function setProp ($prop = '', $value = null) {\r\n if ( $this->pvn ($prop) ) {\r\n $traceDatas = self::getTraceDatas (func_get_args(),\r\n debug_backtrace ()\r\n );\r\n\r\n $traceFile = $traceDatas ['file'];\r\n\r\n if ( !$this->moduleFile ) {\r\n $this->moduleFile = (\r\n $traceFile\r\n );\r\n }\r\n\r\n self::register ($this->moduleFile);\r\n\r\n $prop = strtolower ( $prop );\r\n\r\n if (!isset(self::$modulesExports [ $this->moduleFile ]['props'])) {\r\n self::$modulesExports [ $this->moduleFile ]['props'] = [];\r\n }\r\n\r\n $props = self::$modulesExports [ $this->moduleFile ]['props'];\r\n\r\n $propertyDefined = ( boolean ) (\r\n isset ($props [ $prop ]) &&\r\n gettype($props[$prop]) === gettype(\r\n $value\r\n )\r\n );\r\n\r\n if ( !$propertyDefined ) {\r\n $props = self::$modulesExports [ $this->moduleFile ][\r\n 'props'][$prop] = $value;\r\n }\r\n }\r\n }", "public function getModule($name);", "public function getModule()\n\t{\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->module;\n\t}", "public static function update_module($module) {\n\t\n $context = get_context_instance(CONTEXT_SYSTEM);\n self::validate_context($context);\n require_capability('moodle/course:view', $context); \n $result = glueserver_course_db::glueserver_update_module($module);\n $courseid = $module['course'];\n //It is necessary to call this Moodle function in order to rebuild the course cache\n rebuild_course_cache($courseid); \n\t\treturn array ('success' => $result);\n }", "function __construct () {\n\t\t$this->active_module = $this->name;\n\t\t\n\t\tparent::__construct();\n\t}", "public function updated(Module $module)\n {\n //\n }", "public function __construct($module = '')\n\t{\n\t\t$currentUser = vglobal('current_user');\n\t\t$this->customviewmodule = $module;\n\t\t$this->escapemodule[] = $module . '_';\n\t\t$this->escapemodule[] = '_';\n\t\t$this->smownerid = $currentUser->id;\n\t}", "public function getModule() {\n\t\treturn $this->module;\n\t}", "public function getModule() {\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->_module;\n\t}", "protected function setUp()\n\t{\n\t\t$module = new stdClass;\n\t\t$this->object = $module;\n\t}", "protected function setUp()\n\t{\n\t\t$module = new stdClass;\n\t\t$this->object = $module;\n\t}", "public function getModuleManager();", "public function setModuleUri($moduleUri = null)\n {\n if (null === $moduleUri) {\n $this->moduleUri = null;\n return $this;\n }\n if ($moduleUri instanceof FHIRUri) {\n $this->moduleUri = $moduleUri;\n return $this;\n }\n $this->moduleUri = new FHIRUri($moduleUri);\n return $this;\n }", "function Fenzu($module=\"\")\n\t{\n\t\tglobal $current_user,$adb;\n\t\t$this->Fenzumodule = $module;\n\t\t$this->escapemodule[] =\t$module.\"_\";\n\t\t$this->escapemodule[] = \"_\";\n\t\t$this->smownerid = $current_user->id;\n\t}", "function set_new_module()\n{\n\tglobal $modules, $_POST;\n\n\t$return = array();\n\tforeach ($modules as $name => $value) {\n\t\tif (isset($_POST[$name]))\n\t\t\t$return[] = $name;\n\t}\n\n\treturn $return;\n}", "private function use_module($modulename)\n {\n $this->use_by_class('mathscript_'.$modulename);\n }", "function set_theme_mod($name, $value)\n {\n }", "function save_module($module)\n\t{\n\t\tif(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '')\n\t\t{\n\t\t\t$this->insertIntoEntityTable('ec_seproductsrel', 'Products');\n\t\t}\n\t\telseif(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] == '' && $insertion_mode == \"edit\")\n\t\t{\n\t\t\t$this->deleteRelation('ec_seproductsrel');\n\t\t}\n\t\t//Inserting into product_taxrel table\n\t\t/*\n\t\tif(isset($_REQUEST['ajxaction']) && $_REQUEST['ajxaction'] != 'DETAILVIEW')\n\t\t{\n\t\t\t$this->insertTaxInformation('ec_producttaxrel', 'Products');\n\t\t}\n\t\t*/\n\n\t\t//Inserting into attachments\n\t\t$this->insertIntoAttachment($this->id,'Products');\n\n\t}" ]
[ "0.826501", "0.81135076", "0.8079674", "0.79133654", "0.76723343", "0.7480928", "0.7235859", "0.7222321", "0.7123269", "0.70362407", "0.6944258", "0.69027835", "0.68152714", "0.676356", "0.6704974", "0.66533405", "0.664418", "0.66081506", "0.65958", "0.656101", "0.64303046", "0.63988113", "0.6338239", "0.6308663", "0.6284985", "0.6210449", "0.61579823", "0.6150564", "0.6107305", "0.61034864", "0.6068466", "0.6049445", "0.6032633", "0.59753376", "0.5960561", "0.5958377", "0.5944377", "0.59242916", "0.5903084", "0.58919966", "0.5849905", "0.58390695", "0.5836449", "0.58349466", "0.5829245", "0.58181846", "0.57786286", "0.5619575", "0.55946904", "0.55946904", "0.558966", "0.55879104", "0.5582927", "0.5582037", "0.5574795", "0.5563787", "0.5557544", "0.5535248", "0.5534265", "0.55232614", "0.5504566", "0.5490786", "0.5485193", "0.54801506", "0.54757935", "0.54731154", "0.5464411", "0.5455544", "0.54515624", "0.5450428", "0.5438319", "0.5435838", "0.54330015", "0.54330015", "0.54330015", "0.54330015", "0.54330015", "0.54330015", "0.54279065", "0.54277277", "0.5419254", "0.536575", "0.5365681", "0.5365681", "0.53573483", "0.5352844", "0.53328216", "0.5326052", "0.53257304", "0.53257304", "0.5315423", "0.53143793", "0.53143793", "0.5303477", "0.52797014", "0.52792954", "0.5273054", "0.52655685", "0.5251632", "0.5246785" ]
0.7218807
8
Returns value of 'module' property
public function getModule() { $value = $this->get(self::module); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function module() {\n return $this->module;\n }", "public function getModule(){\n return $this->module;\n }", "public function getModule()\n {\n return $this->module;\n }", "public function getModule() {\n\t\treturn $this->module;\n\t}", "public function getModule() {\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->module; \n\n\t}", "protected function getModule()\n {\n return $this->mod;\n }", "public function getModule()\n\t{\n\t\treturn $this->get('module');\n\t}", "public function getModule()\n\t{\n\t\treturn $this->_module;\n\t}", "public function getModule()\n {\n return $this->getKey('Module');\n }", "public function getModule() {\n return $this->call->getModule();\n }", "public function fetchModule()\n {\n return $this->module;\n }", "public function getModule($module) {\n return $this->modules[$module];\n }", "private static function getModule() {\n $module = \"site\";\n if (isset($_GET['module']) && trim($_GET['module']) != \"\") $module = $_GET['module'];\n return $module;\n }", "public function getModuleName()\n {\n return $this->_module;\n }", "public function getModule();", "public function getModule();", "public function getModuleName() {\n\n\t\treturn $this->_module;\n\t}", "public function getModuleName() {}", "public function getModuleName() {}", "public function getModule()\n {\n return $this->locationModule;\n }", "public function getMod()\n {\n return $this->mod;\n }", "public function getModule()\n\t{\n\t\t$result = '';\n\t\t$locate = Load::locate($this->router->getPath());\n\n\t\t// lokalizujemy katalog, w ktorym uruchomiony jest kontroler\n\t\t$path = str_replace($this->router->getPath(), '', $locate[0]);\n\t\tif (preg_match('#module/([a-zA-Z0-9_-]+)#i', $path, $m))\n\t\t{\n\t\t\t$result = $m[1];\n\t\t}\n\t\treturn $result;\n\t}", "public function getModuleInfo()\n {\n return isset($this->ModuleInfo) ? $this->ModuleInfo : null;\n }", "function getModuleName( $module )\r\n {\r\n $parts = explode( '/', $module );\r\n return end( $parts ); \r\n }", "public function getIdModule() \n\t{\n\t\treturn $this->idModule;\n\t}", "public function getModuleName();", "public function getModuleName();", "public static function module_name()\n {\n $class = Controller::curr()->class;\n $file = SS_ClassLoader::instance()->getItemPath($class);\n\n if ($file) {\n $dir = dirname($file);\n while (dirname($dir) != BASE_PATH) {\n $dir = dirname($dir);\n }\n\n $module = basename($dir);\n if ($module == 'openstack') {\n $module = Injector::inst()->get('ViewableData')->ThemeDir();\n }\n\n return $module;\n }\n\n return null;\n }", "final public function getCurrentModuleName()\n {\n return $this->moduleName;\n }", "public function getModuleUri()\n {\n return $this->moduleUri;\n }", "public function getModulePath()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[0];\r\n }", "public static function getModule()\n {\n return \"passenger_module\";\n }", "public function getModuleName()\n {\n $module = $this->argument('module') ?: $this->laravel['modules']->used();\n \n return $this->laravel['modules']->findOrFail($module)->getStudlyName();\n }", "public function getId(){\n\t\treturn $this->idModule;\n\t}", "public function getConfigModule() {\n return $this->configModule;\n }", "public function getName() {\n\t\t\treturn $this->MODULE_NAME;\t\n\t\t}", "public function getMainModule(){\n\t\t/* return main menu */\n\t\treturn $this->_strMainModule;\n\t}", "public function getUsedModuleName()\n {\n return $this->_usedModuleName;\n }", "public function get_module($module_name='') {\n $module_name = basename($module_name);\n if (empty($this->__modules[$module_name]) and\n $this->__include_module($module_name) === false) {\n return (false);\n }\n return ($this->__modules[$module_name]);\n }", "function getCitationModule() {\n\t\treturn $this->getData('citationModule');\n\t}", "public function getTargetModule() {\n if(!$this->isTargetInternal())\n return null;\n\n $c = $this->cutTarget();\n return strtolower($c['module']);\n }", "public function getModuleName() {\n\t if(null === $this->moduleName):\n\t $this->setModuleName(new MvcEvent());\n\t endif;\n\t\treturn $this->moduleName;\n\t}", "public function getPassModule(){\n\t\treturn $this->passModule;\n\t}", "public function getChildModule(){\n\t\t/* return main menu */\n\t\treturn $this->_strChildModule;\n\t}", "public function getModule($name)\n\t{\n\t\treturn $this->modules[$name];\n\t}", "public function getModule()\n {\n $request = $this->getRequest();\n $module = $request->getModuleName();\n if (null === $module) {\n $module = $this->getFrontController()->getDispatcher()->getDefaultModule();\n }\n\n return $module;\n }", "public function getModuleCanonical()\n {\n return $this->moduleCanonical;\n }", "protected function _getModuleDir()\n {\n return $this->_moduleDir;\n }", "public function __get($module)\n\t{\n\t\tif (in_array($module, array('calorific', 'cardioTrainer')))\n\t\t{\n\t\t\treturn $this->$module;\n\t\t}\n\t}", "public function getDefaultModule()\n {\n return $this->_defaultModule;\n }", "public function getModule($name);", "public function getAlias()\n {\n return $this->_moduleAlias;\n }", "public function getModuleName()\n {\n $name = $this->getComposerJson()->name;\n $name = join('_', array_map('ucfirst', explode('/', $name)));\n return $name;\n }", "public function getModule ($module) {\n $mods = $this->getModules();\n foreach ($mods as $mod) {\n if ($mod['module_name'] == $module) {\n return $mod;\n }\n }\n return false;\n }", "public function getDesc(){\n\t\treturn $this->descModule;\n\t}", "public function get_modname() {\n return $this->pluginname;\n }", "public function __get($name)\n\t{\n\t\treturn $this->_ci->_module_get($name);\n\t}", "public function get_id() {\n\t\treturn self::MODULE_ID;\n\t}", "public function getPrimaryModule();", "public function getImageTranslationModule() {\n\t\t$module = null;\n\t\t$currentController = Yii::app()->getController();\n\t\tif (is_object($currentController)) {\n\t\t\t$module = $currentController->getModule();\n\t\t}\n\t\tif (!is_object($module)) {\n\t\t\t$module = Yii::app()->getModule('imagetranslation');\n\t\t}\n\t\treturn $module;\n\t}", "public function get_module_id()\n {\n return C__MODULE__EVENTS;\n }", "public function getModulePath($module) {\n return $this->modules[$module]['path'];\n }", "private function namebase() {\n return $this->module->name;\n }", "public function getModuleFields()\n\t{\n\t\treturn $this->getOptionData('tl_module');\n\t}", "protected function _getModuleName()\n {\n return 'Bronto_Reminder';\n }", "protected function get_value_function_name( $module ) {\n\t\t$return = 'wpo_' . $module;\n\t\tswitch ( $module ) {\n\t\t\tcase 'taxonomy':\n\t\t\t\t$return = 'wpo_term_meta';\n\t\t\t\tbreak;\n\t\t\tcase 'metabox':\n\t\t\tcase 'nav_menu':\n\t\t\tcase 'media_fields':\n\t\t\tcase 'wc_product':\n\t\t\tcase 'bulk_edit':\n\t\t\tcase 'quick_edit':\n\t\t\t\t$return = 'wpo_post_meta';\n\t\t\t\tbreak;\n\t\t\tcase 'user_profile':\n\t\t\t\t$return = 'wpo_user_meta';\n\t\t\t\tbreak;\n\t\t\tcase 'customizer':\n\t\t\tcase 'wc_settings':\n\t\t\tcase 'dashboard_widgets':\n\t\t\tcase 'widget':\n\t\t\t\t$return = 'wpo_settings';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $return;\n\t}", "protected function getModuleName() {\n return 'mi_javascript';\n }", "public function getModuleName()\n {\n return $this->_getModuleName() . \"_M2_\" . $this->getEdition();\n }", "public function getModules()\n {\n return $this['module.list'];\n }", "public static function module($module, $key){\n\t\tif(CoreConfig::$config == null){\n\t\t\tCoreConfig::getConfig();\n\t\t}\n\t\tif(isset(CoreConfig::$config[$module][$key])){\n\t\t\treturn CoreConfig::$config[$module][$key];\n\t\t} else {\n\t\t\tthrow new Exception(\"Undefined config value for key: $key\");\n\t\t}\n\t}", "public function getRequestableModuleName();", "protected function getModuleConfig() {\n static $moduleConfig;\n if (!$moduleConfig) {\n $moduleConfig = $this->getConfig($this->configModule, 'module');\n }\n \n return $moduleConfig;\n }", "public static function module_path() {\n return static::config()->get('module_path') ?: realpath(__DIR__ . '/../');\n }", "public function getModdata()\n\t{\n\t\treturn $this->moddata;\n\t}", "protected function getInfoModule() {}", "function forminator_get_modules() {\n\t$forminator = Forminator_Core::get_instance();\n\n\treturn $forminator->modules;\n}", "function forminator_get_module( $id ) {\n\t$modules = forminator_get_modules();\n\n\treturn isset( $modules[ $id ] ) && ! empty( $modules[ $id] ) ? $modules[ $id] : false;\n}", "public static function getName()\n {\n if (!isset(self::$cache['modgetname'])) {\n self::$cache['modgetname'] = FormUtil::getPassedValue('module', null, 'GETPOST', FILTER_SANITIZE_STRING);\n\n if (empty(self::$cache['modgetname'])) {\n self::$cache['modgetname'] = System::getVar('startpage');\n }\n\n // the parameters may provide the module alias so lets get\n // the real name from the db\n $modinfo = self::getInfo(self::getIdFromName(self::$cache['modgetname']));\n if (isset($modinfo['name'])) {\n $type = FormUtil::getPassedValue('type', null, 'GETPOST', FILTER_SANITIZE_STRING);\n\n self::$cache['modgetname'] = $modinfo['name'];\n if ((!$type == 'init' || !$type == 'initeractiveinstaller') && !self::available(self::$cache['modgetname'])) {\n self::$cache['modgetname'] = System::getVar('startpage');\n }\n }\n }\n\n return self::$cache['modgetname'];\n }", "public static function getModuleInfo() {\n\t\treturn array(\n\t\t\t'title' => '',\t\t// printable name/title of module\n\t\t\t'version' => 1, \t// version number of module\n\t\t\t'summary' => '', \t// 1 sentence summary of module\n\t\t\t'href' => '', \t\t// URL to more information (optional)\n\t\t\t'permanent' => false, \t// true if module is permanent and thus not uninstallable\n\t\t\t); \n\t}", "function getPrimaryModule() {\n\t\t$chartModel = $this->getParent();\n\t\t$reportModel = $chartModel->getParent();\n\t\t$primaryModule = $reportModel->getPrimaryModule();\n\t\treturn $primaryModule;\n\t}", "public function getMessageTranslationModule() {\n\t\t$module = null;\n\t\t$currentController = Yii::app()->getController();\n\t\tif (is_object($currentController)) {\n\t\t\t$module = $currentController->getModule();\n\t\t}\n\t\tif (!is_object($module)) {\n\t\t\t$module = Yii::app()->getModule('messagetranslation');\n\t\t}\n\t\treturn $module;\n\t}", "public function getModuleTypeAttribute()\n {\n if(!empty(Config::get('core_modules')))\n {\n $core_modules = Config::get('core_modules');\n }\n else\n {\n $core_modules = collect(Module_core::allEnabled())->keys();\n $core_modules = $core_modules->map(function($item, $key){\n return \\Str::slug($item); \n });\n\n Config::set(['core_modules' => $core_modules]);\n }\n\n if(in_array($this->slug, $core_modules->toArray()))\n {\n return 'Embed';\n }\n\n return 'Database';\n }", "public static function getModuleVersion()\n {\n $oModule = oxNew(\\OxidEsales\\Eshop\\Core\\Module\\Module::class);\n $oModule->load('AvShopguardians');\n\n return $oModule ? $oModule->getInfo('version') : null;\n\n }", "private function getModuleType()\n {\n $moduleType=$this->choice('Select Your Module Type',['WEB','API']);\n return $moduleType;\n }", "public function getModuleVersion()\n {\n /** @var string $composerJsonData */\n /** @var string[] $data */\n /** @var ReadInterface $directoryRead */\n /** @var null|string $path */\n /** @var string $version */\n\n $path = $this->componentRegistrar->getPath(\n \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n 'Bazaarvoice_Connector'\n );\n $directoryRead = $this->readFactory->create($path);\n $composerJsonData = $directoryRead->readFile('composer.json');\n $data = json_decode($composerJsonData);\n if (!empty($data->version)) {\n $version = $data->version;\n }\n\n return $version ?? __('Could not retrieve extension version.');\n }", "public function getModuleConfig($moduleName='')\n {\n $modules = $this->getNode('modules');\n\n if (''===$moduleName) {\n return $modules;\n }\n else {\n return $modules->$moduleName;\n }\n }", "protected function getModuleNamespace()\n {\n $module = trim($this->getConfigValue('module'), '\\\\');\n\n return $module ? '\\\\' . $module : null;\n }", "public function get_module_id()\n {\n return C__MODULE__DIALOG_ADMIN;\n }", "function qa_get_module_info($type, $name)\n{\n\t$modules = qa_list_modules_info();\n\treturn @$modules[$type][$name];\n}", "protected function _getModulePath()\n {\n $matchSearchConstraints = array(\n 'modulesDirectory',\n 'moduleDirectory' => array(\n 'moduleName' => $this->_config->moduleName\n )\n );\n\n $result = $this->_profile->search($matchSearchConstraints);\n return $result->getPath();\n }", "public function getLoadedModularName() : array\n {\n return $this->loadedModular;\n }", "private function load_module_info() {\n\t\t$data = array ();\n\t\t$data['module_label'] = $this->module_label;\n\t\t$data['module_labels'] = $this->module_labels;\n\t\t$data['module'] = $this->module;\n\t\treturn $data;\n\t}", "function module_key()\r\n {\r\n return strtolower(get_class($this));\r\n }", "function current($param) {\n switch ($param) {\n case 'module':\n return $this->module;\n break;\n }\n }", "public function getDescription() {\n\t\t\treturn $this->MODULE_DESCRIPTION;\t\n\t\t}", "public function get_module_path()\n\t{\n\t\tif (is_subclass_of($this, 'CmsModuleBase'))\n\t\t{\n\t\t\treturn cms_join_path(ROOT_DIR, 'modules' , $this->get_name());\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn dirname(__FILE__);\n\t\t}\n\t}", "protected function getEditModule() {}" ]
[ "0.8210132", "0.78804106", "0.7852057", "0.7813826", "0.7813826", "0.7753828", "0.7753828", "0.7725103", "0.77203333", "0.76537687", "0.764463", "0.7525357", "0.752002", "0.74772567", "0.74126697", "0.7340175", "0.73386526", "0.7257938", "0.7257938", "0.714476", "0.7050012", "0.7049028", "0.69906926", "0.69905543", "0.69840485", "0.69456303", "0.69220436", "0.6900831", "0.6881141", "0.6881141", "0.68444145", "0.68389535", "0.68242407", "0.67951936", "0.675674", "0.66986644", "0.6630979", "0.661673", "0.6598731", "0.6592248", "0.65668046", "0.65317935", "0.65106946", "0.6486175", "0.64688", "0.6455301", "0.645236", "0.6447325", "0.64460206", "0.64258575", "0.6423975", "0.64211315", "0.640637", "0.64030457", "0.63740665", "0.6358545", "0.6323296", "0.63103545", "0.6307182", "0.6296815", "0.6289838", "0.627522", "0.62684715", "0.62623423", "0.6253803", "0.6247897", "0.62408125", "0.6233452", "0.62148863", "0.6212831", "0.61891234", "0.6169916", "0.6147542", "0.61447066", "0.61400473", "0.6137125", "0.6134675", "0.6124556", "0.6121452", "0.6105279", "0.6099977", "0.60859853", "0.6082047", "0.6063618", "0.6056411", "0.6054698", "0.6032637", "0.60224915", "0.60217375", "0.6017514", "0.6011306", "0.60037446", "0.60003096", "0.5993382", "0.598906", "0.5971677", "0.59579676", "0.5934346", "0.5929818", "0.59268254" ]
0.817467
1
Display a listing of the resource.
public function index() { $trackers = Tracker::all(); return view('trackers.index')->with('trackers', $trackers); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('trackers.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $tracker = new Tracker(); $tracker->student_id = $request->student_id; $tracker->entry_type = $request->entry_type; $tracker->from_hisbu = $request->from_hisbu; $tracker->from_rubu = $request->from_rubu; $tracker->from_page = $request->from_page; $tracker->from_ayah = $request->from_ayah; $tracker->to_hisbu = $request->to_hisbu; $tracker->to_rubu = $request->to_rubu; $tracker->to_page = $request->to_page; $tracker->to_ayah = $request->to_ayah; $tracker->date = $request->date; $tracker->save(); return redirect()->route('trackers.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Tracker $tracker) { return view('trackers.show')->with('tracker', $tracker); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Tracker $tracker) { return view('trackers.edit')->with('tracker', $tracker); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Tracker $tracker) { $tracker->student_id = $request->student_id; $tracker->entry_type = $request->entry_type; $tracker->from_hisbu = $request->from_hisbu; $tracker->from_rubu = $request->from_rubu; $tracker->from_page = $request->from_page; $tracker->from_ayah = $request->from_ayah; $tracker->to_hisbu = $request->to_hisbu; $tracker->to_rubu = $request->to_rubu; $tracker->to_page = $request->to_page; $tracker->to_ayah = $request->to_ayah; $tracker->date = $request->date; $tracker->save(); return redirect()->route('trackers.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Tracker $tracker) { $tracker->delete(); return redirect()->route('trackers.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Test using a simple function
function test_function_filter() { $var = new LiquidVariable('var | test_function_filter'); $this->context->set('var', 1000); $this->context->add_filters('test_function_filter'); $this->assertIdentical('worked', $var->render($this->context)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function test();", "protected abstract function test();", "function test(){\r\n //placeholder for future test functions\r\n }", "function test () {}", "public function test($arg);", "function testCallable() {}", "abstract public function test();", "abstract public function test();", "public function test();", "public function test() {\n\n\t}", "function test()\n {\n return true;\n }", "function test()\n {\n }", "function test($function) {\n $test_cases = array(\n '4' => array('in' => 4, 'out' => 24),\n '5' => array('in' => 5, 'out' => 120),\n '8' => array('in' => 8, 'out' => 40320),\n '20' => array('in' => 20, 'out' => 2432902008176640000),\n );\n $results = array();\n\n $passed = true;\n foreach ($test_cases as $test_name => $test) {\n $actual = $function($test['in']);\n\n if ($actual === $test['out']) {\n $results[$test_name] = 'Passed.';\n } else {\n $results[$test_name] = 'Failed. Expected: ' . $test['out'] . ' Got: ' . $actual;\n $passed = false;\n }\n }\n\n if (!($passed)) {\n foreach ($results as $test_name => $result) {\n echo $test_name . \"\\t\" . $result . \"\\n\";\n }\n }\n return $passed;\n}", "public static function test() {\n\t\treturn true;\n\t}", "function test($test, $parameters, $message) {\n }", "public function testSpecial(): void {\n\t}", "function cork_test()\n\t{\n\t}", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function isTest();", "public function testExample()\n {\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "public static function test($args = array())\n {\n }", "public static function test($args = array())\n {\n }", "public static function test($args = array())\n {\n }", "public static function test($args = array())\n {\n }", "public static function test($args = array())\n {\n }", "function test_helper(){\n return \"OK\";\n}", "public function testSomething()\n {\n }", "function toTest($test){\n\treturn \"el test es \".$test;\n}", "function test_sample() {\n\t\t$this->assertTrue( true );\n\t}", "public function test()\n {\n return $this->test1();\n }", "public function testCase1()\n {\n $fa = $this->getFa();\n // Test error\n $ret = $fa->run('110', 'S0');\n $this->assertEquals($ret['status'], 'success');\n }", "function test11() {\n\n}", "public function test_method()\n\t{\n\n\t}", "protected function test10() {\n Something::test10();\n }", "protected function test9() {\n\n }", "public function testing(){\n\t\t$this->load->library(\"unit_test\");\n\n\t\t$this->unit->run($this->isValid(\"\"), \"null\", \"Test Validasi Null\");\n\t\t$this->unit->run($this->isValid(\"*&&^^\"), \"symbolerror\", \"Test Validasi Symbol\");\n\t\t$this->unit->run($this->isValidHari(\"Selasa\"), true, \"Test Validasi Hari\");\n\t\t$this->unit->run($this->isValidJam(\"0\"), false, \"Test Validasi Jam\");\n\n\t\techo $this->unit->report();\n\t}", "public function test4Do($param)\n {\n //Test\n }", "function testFunction($n) {\n\treturn ($n * $n * $n);\n}", "public function testBasicTest()\n {\n\n }", "public function testGetSuperfund()\n {\n }", "public function testNothing()\n {\n }", "public function testSuccess()\n {\n }", "public function runTestEquals(): void\n {\n $result = call_user_func($this->runFn, $this->in);\n $this->assertEquals($this->expected, $result);\n }", "public function testResult() {\n\t\t$object = (object)array(\n\t\t\t'one' => 1,\n\t\t\t'two' => 2,\n\t\t\t'three' => function() {\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t);\n\t\t$result = _::result($object, 'one');\n\t\t$this->assertEquals(1, $result);\n\n\t\t// test getting the result a method on an object\n\t\t$result = _::result($object, 'three');\n\t\t$this->assertEquals(3, $result);\n\t}", "function test1() {\n\n}", "public function testExample()\n {\n $data ='';\n $this->checkUser($data);\n $this->assertTrue(true);\n }", "function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}", "public function test_getByExample() {\n\n }", "public function testExample()\n {\n $int = 56;\n\n $calc = Calc::create(10)->div(5)->add(3)->mult(10)->sub(4);\n\n $this->assertTrue($int, $calc->result());\n }", "public function test()\n {\n }", "public function test()\n {\n }", "public function isTesting() {}", "public function testIsEvenPassTwo()\n {\n \t$this->assertTrue(isEven(2));\n }", "public function test_apply_filter_funcname( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "function testf1($aa)\n{\n return \"ee\";\n}", "function test10($foo) {\n\n}", "public function testExample()\n {\n $this->assertTrue(true);\n $make = Cars::where(\"make\"|\"id\",10);\n if ($make == \"ford\") {\n return true;\n }\n elseif ($make == \"honda\") {\n return true;\n }\n elseif ($make == \"toyota\") {\n return true;\n } else {\n return false;\n }\n }", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "public static function dummy() {}", "function test19() {\n return '1';\n}", "public function testGetSuperfunds()\n {\n }", "function test21($arg1, $arg2, $arg3) {\n}", "public function testExample()\n {\n\n \n $this->assertTrue(true);\n \n return true;\n }", "public function testGetPatrimonio()\n {\n }", "public function test()\n {\n\n }", "function test($num, $expected){\n $output = PHP_EOL .\"<br>Recieved: $num.\" . PHP_EOL . \"<br>Expected: $expected\". PHP_EOL . \"<br>Result: \";\n $output .= ($num == $expected) ? \"Passed Test\" : \"Failed Test\";\n return $output;\n}", "function test5() {\n\n}", "public function testFight()\n {\n }", "private static function test()\n {\n $files = ['TestCase'];\n $folder = static::$root.'Testing'.'/';\n\n self::call($files, $folder);\n }", "public function testGetPerson()\n {\n }", "function test7() {\n}", "function test3() {\n\n}", "public function test_apply_filter_create_function( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function unittest($function, $parameters)\n\t{\n\t\treturn call_user_func_array(array($this, $function), $parameters);\n\t}", "public function testGetValue()\n {\n $this->todo('stub');\n }", "function test22($arg1, $arg2, $arg3, $arg4, $arg5, $arg6) {\n}", "function test2(){\n echo \"giedra\";\n}", "function test4() {\n\n}", "public function testIsEvenPassString()\n {\n \t$this->assertFalse(isEven(\"fail\"));\n }", "public function testIsValid() {\n\n\n\n }", "function test16() {\n\n}", "public function testExample()\n\t{\n\t\t$this->assertTrue(true);\n\t}", "function test($marca){\n\t\t//return FALSE;\n\t\treturn true;\n\t}", "public function testFunctions(): void\n {\n $evaluator = new Evaluator();\n $evaluator->functions = [\n 'sum' => ['ref' => 'EvaluatorTest::sum', 'arc' => null],\n 'min' => ['ref' => 'min', 'arc' => null],\n ];\n self::assertEquals(\n 5,\n $evaluator->execute('sum(1, 2, 3) + min(0, -1, 4)')\n );\n }", "function test0()\n {\n $this->assertTrue(true);\n }", "public function testGetChamado()\n {\n }", "function test13($user) {\n\n}", "public function testGetExpert()\n {\n }", "public function testOk() {\n\t\t$a = new Finder('bannane', ['KIWI', \"banane\"]);\n\n // on verifie que le test entree est égale à la variable\n $this->assertEquals('banane', $a->First());\n }", "public function testGetPayrun()\n {\n }", "function testValueForTrue(){\n $this->assertTrue(true);\n }", "public function testing($test, $test2)\n {\n return true;\n }", "public function testGetLowStockByFilter()\n {\n }", "public function test($field, $value);", "public function test_function_must_exist_if_applied() {\n if (PHP_VERSION_ID >= 80000) {\n $this->expectException(TypeError::class);\n } else {\n $this->expectException(PHPUnit\\Framework\\Error\\Error::class);\n }\n $this->expectExceptionMessageMatches('/call_user_func_array\\(\\).* a valid callback, function (\\'|\")[0-9a-z]+(\\'|\") not found or invalid function name/');\n\n $hook = rand_str();\n yourls_add_filter( $hook, rand_str() );\n // this will trigger an error, converted to an exception by PHPUnit\n $test = yourls_apply_filter( $hook, rand_str() );\n }", "function test18() {\n return '1';\n}", "function test2() {\n\n}", "public function testCallTest()\n {\n $expected = '{\"widget\":\"test\",\"price\":\"111.11\",\"date\":\"2016-12-28 11:11:11\"}';\n // make the call\n $response = $this->api->findByName('test');\n $this->assertEquals($expected, $response);\n }", "public static function test() {\r\n echo 'this is a test';\r\n }", "function assertTrue($value,$title){\n\tif($value){\n\t\techo $title.\" - Succeded\";\n\t}else{\n\t\techo $title.\" - Failed\";\n\t}\n}" ]
[ "0.75165427", "0.75165427", "0.7267568", "0.71806484", "0.7095981", "0.69127905", "0.68731326", "0.68731326", "0.6850214", "0.684971", "0.679788", "0.668428", "0.6670897", "0.6664844", "0.6661073", "0.6652058", "0.66244096", "0.66056657", "0.66044384", "0.65537775", "0.6551672", "0.65256095", "0.65256095", "0.65247047", "0.6524368", "0.6524368", "0.6511529", "0.65109235", "0.6501238", "0.6493233", "0.6488091", "0.64717513", "0.6445197", "0.6414181", "0.63963264", "0.6387799", "0.6342176", "0.63340116", "0.63309556", "0.6313385", "0.6310394", "0.6299661", "0.62882125", "0.628669", "0.6264416", "0.6256118", "0.62551486", "0.62449384", "0.6229136", "0.6228968", "0.62256473", "0.62256473", "0.6223138", "0.6222056", "0.6218835", "0.6200169", "0.61983424", "0.61928177", "0.6192729", "0.61866164", "0.6163387", "0.61597437", "0.6155991", "0.61536956", "0.61485636", "0.614832", "0.6132642", "0.6125779", "0.6114042", "0.6103034", "0.60998034", "0.6085945", "0.6080699", "0.60750085", "0.60727715", "0.6055824", "0.6052117", "0.6047394", "0.60460305", "0.60402685", "0.60318756", "0.60234094", "0.60221696", "0.60200685", "0.6018132", "0.60102934", "0.6004248", "0.6001271", "0.60006326", "0.59894323", "0.5987093", "0.59809095", "0.59797037", "0.5973641", "0.5970973", "0.59667903", "0.59616935", "0.59518355", "0.5951469", "0.5945941", "0.594219" ]
0.0
-1
Test using a static class
function test_static_class_filter() { $var = new LiquidVariable('var | static_test'); $this->context->set('var', 1000); $this->context->add_filters('TestClassFilter'); $this->assertIdentical('worked', $var->render($this->context)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInstance() { }", "public static function callbackStaticTestFunction() {}", "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "protected abstract function getTestedInstance() : string;", "public function testStaticMethod()\n {\n $expected = <<<'CODE'\n/**\n * @return Calc\n */\npublic static function create()\n{\n return new self();\n}\nCODE;\n $expected = $this->indentText($expected);\n $actual = $this->cmd->execute(new CommandParams('Calc.php method My\\Test\\Ns\\Calc create'), $this->ctx);\n $this->assertSourceCode($expected, $actual);\n }", "public function testCreateMyClass() {\n }", "public function testGetClass()\n\t{\n\t\t// check for the correct class name\n\t\t$this->assertEquals(\n\t\t\t'TechDivision_Lang_Boolean',\n\t\t TechDivision_Lang_Boolean::__getClass()\n\t\t);\n\t}", "public function testStatics(){\n\t\t$chain = PreParser::get_preparse_chain();\n\t\t$this->assertInternalType('array',$chain);\n\t\t$this->assertNotEmpty($chain);\n\t\tforeach($chain as $class){\n\t\t\t$instance = new $class();\n\t\t\t$this->assertInstanceOf('PreParser',$instance);\n\t\t}\n\n\t\t$chain = Parser::get_parse_chain();\n\t\t$this->assertInternalType('array',$chain);\n\t\t$this->assertNotEmpty($chain);\n\t\tforeach($chain as $class){\n\t\t\t$instance = new $class();\n\t\t\t$this->assertInstanceOf('Parser',$instance);\n\t\t}\n\t}", "public function testClassLoad(): void\n {\n $this->assertInstanceOf(ChangeMailHelper::class, $this->changeMailHelper);\n }", "function __construct() {\n trigger_error('Mock factory methods are static.');\n }", "public static function test()\n\t{\n\t\treturn \"Hello World from \".get_class();\n\t}", "public function getTestCase($class);", "public function testInit()\n {\n\n }", "public function testSpecial(): void {\n\t}", "protected function testObject() {\n }", "#[@test]\n public function staticModifier() {\n $this->assertTrue(Modifiers::isStatic(MODIFIER_STATIC));\n $this->assertEquals('public static', Modifiers::stringOf(MODIFIER_STATIC));\n }", "public function staticConstructor()\n {\n $this->assertInstanceOf('stubOrCriterion', stubOrCriterion::create());\n }", "protected abstract function test();", "protected abstract function test();", "public function notATestCase() {}", "public function testGetStaticClient()\n {\n $transport = new Transport();\n $refTransport = new \\ReflectionObject($transport);\n $getStaticClientMethod = $refTransport->getMethod('getStaticClient');\n $getStaticClientMethod->setAccessible(true);\n $returnClient = $getStaticClientMethod->invoke($transport);\n $this->assertInstanceOf(Client::class, $returnClient);\n }", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite(__CLASS__);\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "protected function _initTest(){\n }", "abstract protected function constructTestHelper();", "public function testExample()\n {\n }", "public function testGetSite()\n {\n }", "public static function get_tests()\n {\n }", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "public function test__construct()\n {\n $obj = Solar::factory($this->_class);\n $this->assertInstance($obj, $this->_class);\n }", "protected function test9() {\n\n }", "public function testGetInstance() {\n // Recupera a única instância da classe.\n $instance = self::getInstance(\"teste\");\n\n // retorna a mesma instância independente de quantas chamadas\n $this->assertEquals($instance, $this->getInstance(\"teste\"));\n\n // É da instância da mesma classe de teste que usa o trait.\n $this->assertInstanceOf('\\CommonsTest\\Pattern\\Multiton\\NamedMultitonTest', $instance);\n }", "public function isTesting() {}", "public static function __constructStatic() : void;", "private static function test()\n {\n $files = ['TestCase'];\n $folder = static::$root.'Testing'.'/';\n\n self::call($files, $folder);\n }", "public function test() {\n\n\t}", "public function testWebinars()\n {\n }", "public function testMagicMethod()\n {\n $this->magicMethodTestClass =\n new MagicMethodTestClass();\n }", "public function testSomething()\n {\n }", "static function main() {\n $suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n PHPUnit_TextUI_TestRunner::run( $suite);\n }", "static function main() {\n $suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n PHPUnit_TextUI_TestRunner::run( $suite);\n }", "public function test__construct()\n {\n $obj = Solar::factory('Solar_Json');\n $this->assertInstance($obj, 'Solar_Json');\n }", "public function test_apply_filter_within_class_instance( $hook ) {\n $var = rand_str();\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function test___construct() {\n\t\t}", "public function test___construct() {\n\t\t}", "public function testGetPatrimonio()\n {\n }", "function drush_test_run_class($class) {\n $backend_options = array('output-label' => \"$class \", 'integrate' => TRUE, 'output' => TRUE);\n $return = drush_invoke_process('@self', 'test-run', array($class), drush_redispatch_get_options(), $backend_options);\n return $return;\n}", "abstract public function test();", "abstract public function test();", "public function testInstance() {\n\t\t$session = new \\Services\\Ebay\\Session($devId=1, $appId=2, $certId=3);\n\t\t$ebay = new \\Services\\Ebay($session);\n\t\t\n\t\t$this->assertInstanceOf('\\Services\\Ebay\\Session', $session);\n\t\t$this->assertInstanceOf('\\Services\\Ebay', $ebay);\n\t}", "public function testBasicTest()\n {\n\n }", "public function testGetInstance() {\n $this->assertInstanceOf('\\Nimbles', \\Nimbles::getInstance());\n \\Nimbles::setInstance();\n $this->assertInstanceOf('\\Nimbles', \\Nimbles::getInstance());\n }", "function test(){\r\n //placeholder for future test functions\r\n }", "protected function testObjects() {\n }", "public function testCallInvokesStaticMethod()\n {\n $method = '\\League\\Container\\Test\\Asset\\BazStatic::baz';\n $expected = 'qux';\n\n $c = new Container;\n $returned = $c->call($method, ['foo' => $expected]);\n $this->assertSame($returned, $expected);\n }", "public function test_constructor_called__correct()\n {\n $sut = new SEOLeadsEngine();\n $this->assertAttributeInstanceOf(\\Mustache_Engine::class, 'mustache', $sut);\n $this->assertAttributeInstanceOf(SEOFactory::class, 'factory', $sut);\n }", "public function test_method()\n\t{\n\n\t}", "public function testGetInstance() {\n $obj1 = GangliaAcl::getInstance();\n $obj2 = GangliaAcl::getInstance();\n \n $this->assertEquals( $obj1, $obj2 );\n }", "protected function setUp()\n\t{\n\t\t$this->instance = new GteCompare('flower', 'sakura');\n\t}", "public function testWebinar()\n {\n }", "public function isTest();", "public function dummyMethodToEnsureInstanceExists()\n {\n // intentionally empty\n }", "public function testInstance()\n {\n static::assertInstanceOf(ShoppingListActionBuilder::class, $this->fixture);\n }", "public function test_apply_filter_within_class( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "static public function setUpBeforeClass() : void\n\t{\n\t\t__\\WT()->overwrite('session', new class\n\t\t{\n\t\t\tpublic function isUserLoggedIn() : bool\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\n\t\t// Class of example admin panel page.\n\t\tself::$_examplePageClass = get_class(new class extends __\\AdminPanelPage\n\t\t{\n\t\t\t// It's needed to run test. Otherwise AdminPanelPage's constructor redirects to login screen.\n\t\t\tprotected $_userMustBeLoggedIn = false;\n\n\t\t\tpublic function showMessage() : void\n\t\t\t{\n\t\t\t\techo 'Everything works fine!';\n\t\t\t}\n\t\t});\n\t}", "public function testGuzz()\n {\n $client = new Client();\n $class = get_class($client);\n\n $this->assertNotEmpty($class);\n }", "public function initTest() {\n\t\t/**\n\t\t * @var Tx_Phpoffice_Utility_InitUtility $initObject\n\t\t */\n\t\t$initObject = t3lib_div::makeInstance('Tx_Phpoffice_Utility_InitUtility');\n\t\tforeach($this->supportedLibraries as $library) {\n\t\t\t$object = $initObject->init($library);\n\t\t\tif($library === NULL) {\n\t\t\t\t$this->fail('Got no object of type: ' . $library);\n\t\t\t} else {\n\t\t\t\t$classname = get_class($object);\n\t\t\t\t$this->assertSame($library, $classname, 'Wrong classname returned, expected ' . $library . ' got ' . $classname);\n\t\t\t}\n\t\t}\n\t}", "final public function __construct() { throw new WeeboException(\"Cannot instantiate static class!\"); }", "public function test__construct()\n {\n $obj = Solar::factory('Solar_Role_Adapter_Ldap');\n $this->assertInstance($obj, 'Solar_Role_Adapter_Ldap');\n }", "public function testGetGlobalTemplate()\n {\n\n }", "public function testGetTaskInstanceVariable()\n {\n }", "public function testInstance(): void\n {\n static::assertInstanceOf(\n DuplicateSpacesSniff::class,\n $this->testedObject,\n );\n }", "public function preTest() {}", "public function testGetClassName() {\n // Check the dummy scheme.\n $this->assertEquals($this->classname, \\Drupal::service('stream_wrapper_manager')->getClass($this->scheme), 'Got correct class name for dummy scheme.');\n // Check core's scheme.\n $this->assertEquals('Drupal\\Core\\StreamWrapper\\PublicStream', \\Drupal::service('stream_wrapper_manager')->getClass('public'), 'Got correct class name for public scheme.');\n }", "static public function setUpBeforeClass() : void\n\t{\n\t\tself::$_exampleControllerClass = get_class(new class extends __\\Controller\n\t\t{\n\t\t\tstatic public function URL($target, array $arguments = []) : ?string\n\t\t\t{\n\t\t\t\treturn $target . strrev($target) . '?' . http_build_query($arguments);\n\t\t\t}\n\t\t});\n\t}", "public function testInstance() {\n $config = Config::getInstance(); \n $this->assertInstanceOf('Nimbles\\App\\Config', $config);\n \n $config->foo = 'bar';\n $config = Config::getInstance();\n $this->assertEquals('bar', $config->foo);\n }", "public function test_api_path_validation_1()\n {\n $this->expectExceptionMessageMatches('/No path is provided/');\n //\\Kenashkov\\BillyDk\\BillyDk::validate_api_path('');//the method is no longer public\n new class() extends \\Kenashkov\\BillyDk\\BillyDk {\n public function __construct()\n {\n self::validate_api_path('');\n }\n };\n }", "public function testMain()\n {\n echo \"\\n >----------- Test Main : ---------> \\n\";\n// $this->getRandomNumber();\n// $this->getLoggedUserMail();\n// $this->saveVerificationCode();\n// $this->verification();\n// $this->checkEmailVerification();\n// $this->checkSendCode();\n }", "public function testWebinarStatus()\n {\n }", "public static function static_init(){\n\t\tself::$object_class = new ClassType(\n\t\t\tnew FullyQualifiedName(\"object\", FALSE),\n\t\t\tWhere::getSomewhere());\n\t}", "public function test() {\n\t\t\t\t// self wird beim Kompilieren durch den Klassennamen ersetzt, in der es steht\n\t\t\t\tself::ausgabe();\n\t\t\t}", "public function testIndexerClass()\n {\n $indexer = new RandomImageIndexer();\n $this->assertInstanceOf(ReandomImageIndexer::class, $indexer);\n }", "public function testSystemMembersTypesGet()\n {\n\n }", "abstract public function testConstructorAndProperties(): void;", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }", "public static function setUpBeforeClass() {\n\n }" ]
[ "0.7475596", "0.6748467", "0.6511862", "0.6485774", "0.64434934", "0.6392609", "0.6390264", "0.6350254", "0.6324232", "0.62294364", "0.61889833", "0.6134921", "0.6132946", "0.6109648", "0.61080635", "0.6107675", "0.61052406", "0.60740703", "0.60740703", "0.6054873", "0.60367835", "0.6031086", "0.5994595", "0.5965289", "0.5931551", "0.59262097", "0.5921174", "0.592087", "0.592087", "0.592087", "0.592087", "0.592087", "0.592087", "0.58938307", "0.589337", "0.5879181", "0.5877531", "0.5876698", "0.5875808", "0.5866486", "0.5865507", "0.58644104", "0.5863658", "0.5853115", "0.5853115", "0.58413905", "0.58397454", "0.5834116", "0.5834116", "0.5828959", "0.5820853", "0.57952535", "0.57952535", "0.5783147", "0.57781434", "0.5771124", "0.5762546", "0.5756194", "0.57447636", "0.5713872", "0.5712956", "0.56946075", "0.56911236", "0.56899977", "0.56841356", "0.56786495", "0.5658405", "0.5652026", "0.565123", "0.56498736", "0.5647402", "0.56447417", "0.5638337", "0.5630877", "0.56289434", "0.562832", "0.5619313", "0.5618511", "0.56167394", "0.56155294", "0.5607337", "0.56021327", "0.5601184", "0.56005234", "0.56002724", "0.5600245", "0.559515", "0.5587244", "0.55853176", "0.55853176", "0.55853176", "0.55853176", "0.55853176", "0.55853176", "0.55853176", "0.55853176", "0.55853176", "0.55853176", "0.55853176", "0.55853176" ]
0.6283795
9
test using an object as a filter; an object fiter will retain its state between calls to its filters
function test_object_filter() { $var = new LiquidVariable('var | instance_test_one'); $this->context->set('var', 1000); $this->context->add_filters( new TestClassFilter()); $this->assertIdentical('set', $var->render($this->context)); $var = new LiquidVariable('var | instance_test_two'); $this->assertIdentical('set', $var->render($this->context)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function filter();", "public function test_apply_filter_within_class_instance( $hook ) {\n $var = rand_str();\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function filter();", "public function testFilter() {\n\t\t$array = array(1, 2, 3);\n\t\t$result = _::filter($array, function($value) {\n\t\t\treturn (0 == $value);\n\t\t});\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(0, $result);\n\n\t\t// test filtering down to odd elements\n\t\t$result = _::filter($array, function($value) {\n\t\t\treturn ($value % 2);\n\t\t});\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(3, $result[2]);\n\t}", "public function test_apply_filter_within_class( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function test_apply_filter_closure( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function testFilter()\n {\n $unfiltered = 'asdasdfads';\n $expected = 'asdasdfads';\n $result = $this->sut->filter($unfiltered);\n\n $this->assertSame($expected, $result);\n }", "public function filter($filter)\n {\n }", "public function testFilterOptimizer(): void\n {\n $optimizer = new FilterOptimizer();\n $collection = LaRepo::newFiltersCollection();\n $nestedIdleCollection = LaRepo::newFiltersCollection();\n\n $filter1 = LaRepo::newFilter(\n 'attr1',\n FilterOperator::IS_LIKE,\n 'val1',\n BooleanOperator::OR\n );\n\n $filter2 = LaRepo::newFilter(\n 'attr2',\n FilterOperator::IS_LIKE,\n 'val2',\n BooleanOperator::AND\n );\n\n $filter3Sub = LaRepo::newFilter(\n 'attr3',\n FilterOperator::EQUALS_TO,\n 'testing',\n BooleanOperator::OR\n );\n\n $filter3 = LaRepo::newFilter(\n 'rel1',\n FilterOperator::EXISTS,\n LaRepo::newFiltersCollection(BooleanOperator::OR, $filter3Sub),\n BooleanOperator::AND\n );\n\n $nestedIdleCollection->setItems($filter1, $filter2, $filter3);\n $collection->setItems($nestedIdleCollection);\n\n $optimizer->optimize($collection);\n\n $this->assertCount(3, $collection);\n $this->assertEquals($filter1, $collection[0]);\n $this->assertEquals($filter2, $collection[1]);\n $this->assertEquals($filter3Sub, $collection[2]);\n $this->assertEquals('rel1.attr3', $collection[2]->getAttr()->getName());\n $this->assertEquals(BooleanOperator::AND, $collection[2]->getBoolean());\n }", "public function filtering();", "function filter(){\r\n\r\n return new BFilter();\r\n\r\n}", "abstract public function filters();", "public function test_apply_filter_within_class_array( $hook ) {\n $var = rand_str();\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "public function filter($data);", "public function test_add_filter_within_class_instance() {\n /* Note : in the unit tests context, we cannot rely on \"$this\" keeping the same\n * between tests, whereas it totally works in a \"normal\" class context\n * For this reason, using yourls_add_filter($hook, array($this, 'some_func')) in one test and\n * yourls_remove_filter($hook,array($this,'some_func')) in another test doesn't work.\n * To circumvent this, we're storing $this in $instance.\n */\n self::$instance = $this;\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, array( self::$instance, 'change_variable' ) );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "public function testGetReplenishmentByFilter()\n {\n }", "private function filters() {\n\n\n\t}", "private static function _getFilter() {}", "public function test_remove_filter_within_class_instance( $hook ) {\n $this->assertTrue( yourls_has_filter( $hook ) );\n $removed = yourls_remove_filter( $hook, array( self::$instance, 'change_variable' ) );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function test_has_filter_return_values() {\n $hook = rand_str();\n\n yourls_add_filter( $hook, 'some_function' );\n yourls_add_filter( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_filter( $hook ) );\n $this->assertSame( 10, yourls_has_filter( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_filter( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_filter( $hook, 'nope_not_this_function' ) );\n }", "public function filterObjects($filterObjects) {\n $this->filterObjects = (bool)$filterObjects;\n return $this->filterObjects;\n }", "public function testFilter() {\n $data = $this->expanded;\n\n $match1 = $data;\n $match2 = $data;\n unset($match1['empty'], $match2['empty'], $match1['one']['two']['three']['false'], $match1['one']['two']['three']['null']);\n\n $this->assertEquals($match1, Hash::filter($data));\n $this->assertEquals($match2, Hash::filter($data, false));\n\n $data = array(\n 'true' => true,\n 'false' => false,\n 'null' => null,\n 'zero' => 0,\n 'stringZero' => '0',\n 'empty' => array(),\n 'array' => array(\n 'false' => false,\n 'null' => null,\n 'empty' => array()\n )\n );\n\n $this->assertEquals(array(\n 'true' => true,\n 'zero' => 0,\n 'stringZero' => '0'\n ), Hash::filter($data));\n }", "public function test_apply_filter_funcname( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "abstract public function filter(callable $func);", "public function filter($filterChain);", "function test_function_filter() {\n\t\t$var = new LiquidVariable('var | test_function_filter');\n\t\t$this->context->set('var', 1000);\n\t\t$this->context->add_filters('test_function_filter');\n\t\t$this->assertIdentical('worked', $var->render($this->context));\t\t\n\t\t\n\t}", "public function testGoodFilter()\n {\n $tests = array(\n array(\n 'label' => __LINE__ .': simple match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', 'value'),\n 'expression' => 'attr-field~=\\\\^value\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing wildcards',\n 'filter' => P4Cms_Record_Filter::create()->add('field', '*value...'),\n 'expression' => 'attr-field~=\\\\^\\\\\\*value\\\\.\\\\.\\\\.\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing regex characters',\n 'filter' => P4Cms_Record_Filter::create()->add('field', '$v?(a)l[u]e|^'),\n 'expression' => 'attr-field~=\\\\^\\\\\\\\\\$v\\\\\\?\\\\\\\\\\(a\\\\\\\\\\)l\\\\\\\\\\[u\\\\\\\\\\]e\\\\\\\\\\|\\\\\\\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': match containing newline/return characters',\n 'filter' => P4Cms_Record_Filter::create()->add('field', \"va\\nl\\rue\"),\n 'expression' => \"attr-field~=\\^va\\\\\\\\\\\\\\n\" . \"l\\\\\\\\\\\\\\r\" .'ue\\\\$'\n ),\n array(\n 'label' => __LINE__ .': multi-field match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', 'bar'),\n 'expression' => 'attr-field~=\\\\^value\\\\$ & attr-foo~=\\\\^bar\\\\$'\n ),\n array(\n 'label' => __LINE__ .': multi-value match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', array('bar', 'bof')),\n 'expression' => 'attr-field~=\\\\^value\\\\$ & (attr-foo~=\\\\^bar\\\\$ | attr-foo~=\\\\^bof\\\\$)'\n ),\n array(\n 'label' => __LINE__ .': multi-value negated match',\n 'filter' => P4Cms_Record_Filter::create()\n ->add('field', 'value')\n ->add('foo', array('bar', 'bof'), '!='),\n 'expression' => 'attr-field~=\\\\^value\\\\$ &^ (attr-foo~=\\\\^bar\\\\$ | attr-foo~=\\\\^bof\\\\$)'\n ),\n array(\n 'label' => __LINE__ .': inverted match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_NOT_EQUAL\n ),\n 'expression' => '^attr-field~=\\\\^value\\\\$'\n ),\n array(\n 'label' => __LINE__ .': case-insensitive match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_EQUAL, null, true\n ),\n 'expression' => 'attr-field~=\\\\^[Vv][Aa][Ll][Uu][Ee]\\\\$'\n ),\n array(\n 'label' => __LINE__ .': regex match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_REGEX\n ),\n 'expression' => 'attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match, case-sensitive',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match, with wildcards',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '.*value...', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=.*value...'\n ),\n array(\n 'label' => __LINE__ .': inverted regex match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'value', P4Cms_Record_Filter::COMPARE_NOT_REGEX\n ),\n 'expression' => '^attr-field~=value'\n ),\n array(\n 'label' => __LINE__ .': regex match alternatives',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '(V|v)alue', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\\\(V\\\\|v\\\\)alue'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '^[Vv]alue$', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\\\^[Vv]alue\\\\$'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets, nocase',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'va[lX]ue', P4Cms_Record_Filter::COMPARE_REGEX, null, true\n ),\n 'expression' => 'attr-field~=[Vv][Aa][LlXx][Uu][Ee]'\n ),\n array(\n 'label' => __LINE__ .': regex match square brackets, nocase, with escapes',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'va[lX\\\\]\\\\\\\\]ue', P4Cms_Record_Filter::COMPARE_REGEX, null, true\n ),\n 'expression' => 'attr-field~=[Vv][Aa][LlXx\\\\\\\\]\\\\\\\\\\\\\\\\][Uu][Ee]'\n ),\n array(\n 'label' => __LINE__ .': regex match question mark',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', '^v?alue$', P4Cms_Record_Filter::COMPARE_REGEX, null, false\n ),\n 'expression' => 'attr-field~=\\^v?alue\\$'\n ),\n array(\n 'label' => __LINE__ .': empty string match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', ''),\n 'expression' => 'attr-field~=\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': null match',\n 'filter' => P4Cms_Record_Filter::create()->add('field', null),\n 'expression' => 'attr-field~=\\\\^\\\\$'\n ),\n array(\n 'label' => __LINE__ .': simple contains match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo', P4Cms_Record_Filter::COMPARE_CONTAINS\n ),\n 'expression' => 'attr-field~=foo'\n ),\n array(\n 'label' => __LINE__ .': case-insensitive contains match',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo', P4Cms_Record_Filter::COMPARE_CONTAINS, null, true\n ),\n 'expression' => 'attr-field~=[Ff][Oo][Oo]'\n ),\n array(\n 'label' => __LINE__ .': contains match with special chars',\n 'filter' => P4Cms_Record_Filter::create()->add(\n 'field', 'foo bar-', P4Cms_Record_Filter::COMPARE_CONTAINS\n ),\n 'expression' => 'attr-field~=foo\\ bar\\-'\n ),\n );\n\n foreach ($tests as $test) {\n $this->assertSame(\n $test['expression'],\n $test['filter']->getExpression(),\n $test['label']\n );\n }\n }", "public function testWithCallbackFilter()\n {\n return $this->doTheRealTest(true, true);\n }", "public function filterProvider()\n {\n $entity1 = $this->createMock(EntityInterface::class);\n $entity2 = $this->createMock(EntityInterface::class);\n $entity3 = $this->createMock(EntityInterface::class);\n $entity4 = $this->createMock(EntityInterface::class);\n $entity5 = $this->createMock(EntityInterface::class);\n $entity6 = $this->createMock(EntityInterface::class);\n\n $entity1->foo = 'bar';\n $entity2->foo = 123;\n $entity4->foo = '123';\n $entity5->foo = ['1230'];\n $entity6->foo = [1234, 123, 'teta'];\n\n $entities = [$entity1, $entity2, $entity3, $entity4, $entity5, $entity6];\n\n $filter = function($entity) {\n return isset($entity->foo) && $entity->foo == 123;\n };\n\n return [\n [$entities, ['foo' => 123], false, [1 => $entity2, 3 => $entity4, 5 => $entity6]],\n [$entities, ['foo' => 123], true, [1 => $entity2, 5 => $entity6]],\n [$entities, $filter, false, [1 => $entity2, 3 => $entity4]],\n [$entities, $filter, true, [1 => $entity2, 3 => $entity4]],\n [$entities, [], false, $entities],\n [$entities, [], true, $entities],\n [[], ['foo' => 123], true, []],\n [[], ['foo' => 123], false, []],\n [[], $filter, true, []],\n [[], $filter, false, []],\n ];\n }", "public function hasFilter(): bool;", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "public function filterEntity(object $object): void\n {\n $this->filterExecutor->filterEntity($object);\n }", "public function createFilter();", "public function testAddFilter()\n {\n $this->todo('stub');\n }", "public function testFilter()\n {\n // so here we just verify that the params are passed correctly internally\n $timeslice_repository = $this->getMockBuilder(TimesliceRepository::class)\n ->disableOriginalConstructor()\n ->setMethods(['scopeByDate', 'scopeWithTags', 'scopeWithoutTags',\n 'scopeByLatest', 'scopeByField', 'scopeByActivityData'])->getMock();\n\n // with date\n $timeslice_repository->expects($this->once())->method('scopeByDate')\n ->with($this->equalTo('dadum'));\n $timeslice_repository->filter(['date' => 'dadum']);\n\n // with customer / project / service\n $value_map = [\n ['customer' => 'dadum'], ['project' => 'dadum'], ['service' => 'dadum'] ];\n $timeslice_repository->expects($this->exactly(3))->method('scopeByActivityData')\n ->will($this->returnValueMap($value_map));\n $timeslice_repository->filter(['customer' => 'dadum']);\n $timeslice_repository->filter(['project' => 'dadum']);\n $timeslice_repository->filter(['service' => 'dadum']);\n\n // with tags\n $timeslice_repository->expects($this->once())->method('scopeWithTags')\n ->with($this->equalTo('dadum'));\n $timeslice_repository->filter(['withTags' => 'dadum']);\n\n // without tags\n $timeslice_repository->expects($this->once())->method('scopeWithoutTags')\n ->with($this->equalTo('dadum'));\n $timeslice_repository->filter(['withoutTags' => 'dadum']);\n\n // with latest\n $timeslice_repository->expects($this->once())->method('scopeByLatest');\n $timeslice_repository->filter(['latest' => null]);\n\n // default\n $timeslice_repository->expects($this->once())->method('scopeByField')\n ->with(\n $this->equalTo('value'),\n $this->equalTo(7200)\n );\n $timeslice_repository->filter(['value' => 7200]);\n }", "public function isFilterable(): bool;", "public function testFilterWithZero()\n {\n $this->assertSame('N', $this->filter->filter(0));\n }", "public function testInitFilter() {\n\n\t\t$filter = new SlashFilter;\n\n\t\t$this->assertInstanceOf('HybridLogic\\Slack\\SlashFilter', $filter);\n\n\t}", "public function testSetFilterLocaleObject()\n {\n $this->todo('stub');\n }", "public function filter($input);", "public function test_add_filter_within_class() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, 'Change_Variable::change_it' );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "public function filter(callable $hof);", "public function setFilter($filter){ }", "public function test_apply_filter_create_function( $hook ) {\n $var = rand_str();\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertNotSame( $var, $filtered );\n\t}", "function filter( $params)\n\t{\n\t\treturn true;\n\t}", "function filter($callback = null);", "public function isFiltered() : bool;", "public function testGetInputFilter()\n\t{\n\t\t$pessoa = new Pessoa();\n\t\t$if = $pessoa->getInputFilter();\n\t\t$this->assertInstanceOf(\"Zend\\InputFilter\\InputFilter\", $if);\n\t\treturn $if;\n\t}", "public function test_get_filters() {\n $hook = rand_str();\n\n yourls_add_filter( $hook, 'some_function' );\n yourls_add_filter( $hook, 'some_other_function', 1337 );\n\n $filters = yourls_get_filters( $hook );\n $this->assertTrue(isset($filters[10]['some_function']));\n $this->assertTrue(isset($filters[1337]['some_other_function']));\n\n $this->assertSame( [], yourls_get_filters( rand_str() ) );\n }", "public abstract function filter(callable|UnaryFunction|FilterOperator $filter): Stream;", "public function test_add_filter_within_class_array() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, array( 'Change_Variable', 'change_it' ) );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "public function testFilter()\n {\n // so here we just verify that the params are passed correctly internally\n $project_repository = $this->getMockBuilder(ProjectRepository::class)\n ->disableOriginalConstructor()\n ->setMethods(['scopeByDate', 'scopeWithTags', 'scopeWithoutTags',\n 'scopeByField', 'search'])->getMock();\n\n // with tags\n $project_repository->expects($this->once())->method('scopeWithTags')\n ->with($this->equalTo('badabing'));\n $project_repository->filter(['withTags' => 'badabing']);\n\n // without tags\n $project_repository->expects($this->once())->method('scopeWithoutTags')\n ->with($this->equalTo('badabeng'));\n $project_repository->filter(['withoutTags' => 'badabeng']);\n\n // with date\n $project_repository->expects($this->once())->method('scopeByDate')\n ->with($this->equalTo('27.01.2018'));\n $project_repository->filter(['date' => '27.01.2018']);\n\n // with search\n $project_repository->expects($this->once())->method('search')\n ->with($this->equalTo('jahade'));\n $project_repository->filter(['search' => 'jahade']);\n\n // default\n $project_repository->expects($this->once())->method('scopeByField')\n ->with(\n $this->equalTo('budget_price'),\n $this->equalTo('65000')\n );\n $project_repository->filter(['budget_price' => '65000']);\n }", "protected function setUp() {\n\t\t$this->object = new Filter_Fail;\n\t}", "public function testMutatorsAndAccessors()\n {\n $mailingListFilterItems = array(new MailingListFilterItem());\n $mailingListFilter = new MailingListFilter();\n\n $mailingListFilter\n ->setId(1)\n ->setName('Name.')\n ->setDescription('Description.')\n ->setMailingListId(2)\n ->setFilterItems($mailingListFilterItems)\n ;\n\n $this->assertEquals(1, $mailingListFilter->getId());\n $this->assertEquals('Name.', $mailingListFilter->getName());\n $this->assertEquals('Description.', $mailingListFilter->getDescription());\n $this->assertEquals(2, $mailingListFilter->getMailingListId());\n $this->assertSame($mailingListFilterItems, $mailingListFilter->getFilterItems());\n }", "public function test_multiple_filter() {\n $hook = rand_str();\n $var = rand_str();\n\n yourls_add_filter( $hook, function( $in ) { return $in . \"1\"; } );\n yourls_add_filter( $hook, function( $in ) { return $in . \"2\"; } );\n\n $filtered = yourls_apply_filter( $hook, $var );\n $this->assertSame( $var . \"1\" . \"2\", $filtered );\n\t}", "public function testFilterOptions()\n {\n $optionFilter = new P4Cms_Record_Filter();\n $newFilter = $optionFilter->setOption('test', array('foo', 'bar'));\n \n $this->assertInstanceOf(\n 'P4Cms_Record_Filter',\n $newFilter,\n __LINE__ .': P4Cms_Record_Filter object returned from setOption()'\n );\n \n $this->assertSame(\n array('foo', 'bar'),\n $newFilter->getOption('test'),\n __LINE__ .': test options stored in filter'\n );\n \n $this->assertNull(\n $newFilter->getOption('does not exist'),\n __LINE__ .': null returned for option that does not exist.'\n );\n }", "public function filter($predicate);", "public function testGetInputFilter()\n {\n $sequenciaSerie = new SequenciaSerie();\n $if = $sequenciaSerie->getInputFilter();\n $this->assertInstanceOf('Zend\\InputFilter\\InputFilter', $if);\n\n return $if;\n }", "public function test_remove_filter_within_class( $hook ) {\n $removed = yourls_remove_filter( $hook, 'Change_Variable::change_it' );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function testFilterWillNotPerformFilteringWithoutFilterKey(): void\n {\n $manager = new QueryFilterManager($this->filterFactory, $this->sortFactory);\n\n $this->queryBuilder->expects($this->once())\n ->method('getEntityManager')\n ->willReturn($this->entityManager);\n\n $this->entityManager->expects($this->once())\n ->method('getClassMetadata')\n ->with($this->entityName)\n ->willReturn($this->metadata);\n\n $this->filterFactory->expects($this->never())->method('create');\n\n $manager->filter($this->queryBuilder, $this->entityName, []);\n }", "protected function filter_item( object $item, ): ?object {\n\t\t$valid = true;\n\n\t\tforeach ( $this->filter_args as $key => $arg ) {\n\t\t\t/* @var string $field */\n\t\t\t/* @var string $type */\n\t\t\textract( $this->prepare_field( $key ) );\n\n\n\t\t\ttry {\n\t\t\t\tif ( 'instanceof' === $field ) {\n\t\t\t\t\t$value = array_keys(array_merge( class_uses( $item ), class_implements( $item ), class_parents( $item ) ));\n\t\t\t\t} else {\n\t\t\t\t\t$value = Object_Helper::pluck( $item, $field );\n\t\t\t\t}\n\t\t\t} catch ( Invalid_Field $e ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $type === Filter::callback->value ) {\n\t\t\t\t$valid = $arg( $value );\n\t\t\t} else {\n\n\t\t\t\t$fields = Array_Helper::intersect( Array_Helper::wrap( $arg ), Array_Helper::wrap( $value ) );\n\n\t\t\t\t// Check based on type.\n\t\t\t\t$valid = match ( $type ) {\n\t\t\t\t\tFilter::not_in->value => empty( $fields ),\n\t\t\t\t\tFilter::in->value => ! empty( $fields ),\n\t\t\t\t\tFilter::and->value => count( $fields ) === count( $arg ),\n\t\t\t\t\tFilter::equals->value => isset( $fields[0] ) && $fields[0] === $arg,\n\t\t\t\t\tFilter::less_than->value => array_sum( Array_Helper::wrap( $value ) ) < $arg,\n\t\t\t\t\tFilter::greater_than->value => array_sum( Array_Helper::wrap( $value ) ) > $arg,\n\t\t\t\t\tFilter::greater_than_or_equal_to->value => array_sum( Array_Helper::wrap( $value ) ) >= $arg,\n\t\t\t\t\tFilter::less_than_or_equal_to->value => array_sum( Array_Helper::wrap( $value ) ) <= $arg,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( false === $valid ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( true === $valid ) {\n\t\t\treturn $item;\n\t\t}\n\n\t\treturn null;\n\t}", "public function testGetLowStockByFilter()\n {\n }", "public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function testGetFilters(): void\n {\n self::assertIsArray($this->extension->getFilters());\n self::assertCount(11, $this->extension->getFilters());\n foreach ($this->extension->getFilters() as $key => $filter) {\n /* @var TwigFilter $filter the filter to test */\n self::assertInstanceOf(TwigFilter::class, $filter);\n self::assertSame($key, $filter->getName().'Filter');\n }\n }", "public function filter(Record $record);", "public function testSingleName()\n {\n $filter = new Name();\n\n $this->assertSame([\n 'forename' => 'Ian',\n 'surname' => ''\n ], $filter->filter('Ian'));\n\n $this->assertSame([\n 'forename' => 'Dave',\n 'surname' => ''\n ], $filter->filter('dave'));\n }", "public function filter($in, $out, &$consumed, $closing);", "public function filter($value, $filter) {\n if (is_array($value)) {\n foreach ($value as $i => $val)\n $value[$i] = $this->filter($val, $filter);\n }\n else if (is_array($filter)) {\n foreach ($filter as $f)\n $value = $this->filter($value, $f);\n }\n else {\n $fname = \"filter\";\n $arr = explode(\"_\", $filter);\n foreach ($arr as $a)\n $fname.= ucwords($a);\n if (is_callable([$this, $fname]))\n return $this->$fname($value);\n else\n return $value;\n }\n return $value;\n }", "public function testFilterState(Request $request, $filter, $value, $urlParameters, $resetUrlParameters)\n {\n $response = $this->getFilterManager()->handleRequest($request);\n\n /** @var ViewData $data */\n $data = $response->getFilters()[$filter];\n\n $this->assertEquals($filter, $data->getState()->getName());\n $this->assertEquals($value, $data->getState()->getValue());\n $this->assertEquals($urlParameters, $data->getState()->getUrlParameters());\n $this->assertEquals($resetUrlParameters, $data->getResetUrlParameters());\n }", "function remove_anonymous_object_filter( $tag, $class, $method ){\n\t$filters = isset($GLOBALS['wp_filter'][ $tag ])? $GLOBALS['wp_filter'][ $tag ] : false;\n\n\tif (empty($filters)){\n\t\treturn;\n\t}\n\n\tforeach ( $filters as $priority => $filter )\n\t{\n\t\tforeach ( $filter as $identifier => $function )\n\t\t{\n\t\t\tif ( is_array( $function)\n\t\t\t\tand is_a( $function['function'][0], $class )\n\t\t\t\tand $method === $function['function'][1]\n\t\t\t)\n\t\t\t{\n\t\t\t\tremove_filter(\n\t\t\t\t\t$tag,\n\t\t\t\t\tarray ( $function['function'][0], $method ),\n\t\t\t\t\t$priority\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}", "public function testChain()\n {\n $filter = Solar::factory('Solar_Filter');\n \n // required, but no filter\n $filter->setChainRequire('foo');\n \n // one filter\n $filter->addChainFilter('bar', 'validateInt');\n \n // many filters\n $filter->addChainFilters('baz', array(\n 'sanitizeInt',\n array('validateRange', 1, 9),\n ));\n \n // required, one filter\n $filter->setChainRequire('dib');\n $filter->addChainFilter('dib', 'validateInt');\n \n // required, many filters\n $filter->setChainRequire('zim');\n $filter->addChainFilters('zim', array(\n 'sanitizeInt',\n array('validateRange', 1, 9),\n ));\n \n /**\n * expected output after being sanitized\n */\n $expect = array(\n 'foo' => 'anything',\n 'bar' => 123,\n 'baz' => 4,\n 'dib' => 678,\n 'zim' => 7,\n );\n \n /**\n * apply filter with \"valid\" user input\n */\n \n // user input\n $data = array(\n 'foo' => 'anything',\n 'bar' => 123,\n 'baz' => 4.5,\n 'dib' => 678,\n 'zim' => 7.9,\n );\n \n // valid?\n $valid = $filter->applyChain($data);\n $this->assertTrue($valid);\n \n // should have sanitized the data in-place\n $this->assertSame($data, $expect);\n \n /**\n * apply filter with invalid user input\n */\n \n // user input\n $data = array(\n 'foo' => 'anything',\n 'bar' => 'abc', // validateInt\n 'baz' => 123, // validateRange\n 'dib' => 456,\n 'zim' => -78, // validateRange\n );\n \n // valid?\n $valid = $filter->applyChain($data);\n $this->assertFalse($valid);\n \n // get the list of invalid elements\n $invalid = $filter->getChainInvalid();\n $keys = array_keys($invalid);\n $this->assertSame($keys, array('bar', 'baz', 'zim'));\n \n /**\n * apply filter with missing requires\n */\n \n // user input\n $data = array(\n 'foo' => null,\n 'bar' => 123,\n 'baz' => 4.5,\n 'dib' => '',\n );\n \n // valid?\n $valid = $filter->applyChain($data);\n $this->assertFalse($valid);\n \n // get the list of invalid elements\n $invalid = $filter->getChainInvalid();\n $keys = array_keys($invalid);\n $this->assertSame($keys, array('foo', 'dib', 'zim'));\n \n /**\n * apply filter with invalid user input and missing requires\n */\n \n // user input\n $data = array(\n 'bar' => 'abc', // validateInt\n 'baz' => 123, // validateRange\n 'dib' => 4.5,\n );\n \n // valid?\n $valid = $filter->applyChain($data);\n $this->assertFalse($valid);\n \n // get the list of invalid elements\n $invalid = $filter->getChainInvalid();\n $keys = array_keys($invalid);\n $this->assertEquals($keys, array('foo', 'zim', 'bar', 'baz', 'dib'));\n }", "function test_static_class_filter() {\n\t\t$var = new LiquidVariable('var | static_test');\n\t\t$this->context->set('var', 1000);\n\t\t$this->context->add_filters('TestClassFilter');\n\t\t$this->assertIdentical('worked', $var->render($this->context));\t\t\t\t\n\t\t\n\t\n\t}", "protected function testObject() {\n }", "public function filterFilterConstruct(UnitTester $I)\n {\n $I->wantToTest('Filter\\Filter - __construct() - empty');\n $I->expectThrowable(\n new Exception('Filter unknown is not registered'),\n function () {\n $locator = new Filter();\n $locator->get('unknown');\n }\n );\n }", "protected function filter_found_item($object) {\n\t\treturn $object;\t\t\n\t}", "public function testGetInputFilter()\n {\n $inputFilter = $this->document->getInputFilter();\n\n $this->assertInstanceOf('Zend\\InputFilter\\InputFilter', $inputFilter);\n }", "public function mockFilter(Filter $filter): Filter\n {\n $filter->withMeta([ 'component' => 'mega-filter-placeholder' ]);\n $filter->withMeta([ 'originalComponent' => $filter->component ]);\n\n return $filter;\n }", "public function CleanFilter(){\n\t\t$this->_objectFilter = new Model_Aclusuariosonline();\n\t}", "public function test_filter() {\n\t\t$this->lsconn->mock_query(\n\t\t\t\tarray(\n\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'total_count' => 0\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\t'GET hosts',\n\t\t\t\t\t\t'OutputFormat: wrapped_json',\n\t\t\t\t\t\t'ResponseHeader: fixed16',\n\t\t\t\t\t\t'AuthUser: theusername',\n\t\t\t\t\t\t'Columns: name',\n\t\t\t\t\t\t'Line: 1',\n\t\t\t\t\t\t'Line: 2'\n\n\t\t\t\t)\n\t\t);\n\t\t$this->ls->query(\"hosts\", \"Line: 1\\nLine: 2\\n\", array('name'), array(\n\t\t\t\t'auth' => new User_Model(array(\n\t\t\t\t\t\t'username' => 'theusername',\n\t\t\t\t\t\t'auth_data' => array()\n\t\t\t\t))\n\t\t));\n\t}", "public function testAddFilters()\n {\n $this->todo('stub');\n }", "public function testIsFailure()\n\t{\n\t\t/* default value of a filter is false */\n\t\t$this->assertFalse($this->filter->isFailure());\n\t}", "function es_filtro($vfiltro){\n $res = false;\n if ($vfiltro != SIN_FILTRO)\n $res = true;\n return $res;\n}", "public function filter($criteria, $filter, $args=[]);", "public function testBadFilter()\n {\n $tests = array(\n array(\n 'label' => __LINE__ .': null field',\n 'field' => null,\n 'value' => '',\n 'comparison' => '',\n 'connective' => '',\n 'caseInsensitive' => '',\n 'error' => array(\n 'InvalidArgumentException' => 'Cannot add condition. Field must be a non-empty string.'\n ),\n ),\n array(\n 'label' => __LINE__ .': empty field',\n 'field' => '',\n 'value' => '',\n 'comparison' => '',\n 'connective' => '',\n 'caseInsensitive' => '',\n 'error' => array(\n 'InvalidArgumentException' => 'Cannot add condition. Field must be a non-empty string.'\n ),\n ),\n array(\n 'label' => __LINE__ .': non-string field',\n 'field' => array(),\n 'value' => '',\n 'comparison' => '',\n 'connective' => '',\n 'caseInsensitive' => '',\n 'error' => array(\n 'InvalidArgumentException' => 'Cannot add condition. Field must be a non-empty string.'\n ),\n ),\n array(\n 'label' => __LINE__ .': empty array value',\n 'field' => 'field',\n 'value' => array(),\n 'comparison' => '',\n 'connective' => '',\n 'caseInsensitive' => '',\n 'error' => array(\n 'InvalidArgumentException' => 'Cannot add condition.'\n . ' Value must be null, a string or an array of strings.'\n ),\n ),\n array(\n 'label' => __LINE__ .': array value containing non-string',\n 'field' => 'field',\n 'value' => array(array()),\n 'comparison' => P4Cms_Record_Filter::COMPARE_EQUAL,\n 'connective' => P4Cms_Record_Filter::CONNECTIVE_AND,\n 'caseInsensitive' => '',\n 'error' => array(\n 'InvalidArgumentException' => 'Cannot add condition.'\n . ' Value array must contain only strings.'\n ),\n ),\n array(\n 'label' => __LINE__ .': object value',\n 'field' => 'field',\n 'value' => new stdClass,\n 'comparison' => '',\n 'connective' => '',\n 'caseInsensitive' => '',\n 'error' => array(\n 'InvalidArgumentException' => 'Cannot add condition.'\n . ' Value must be null, a string or an array of strings.'\n ),\n ),\n array(\n 'label' => __LINE__ .': empty comparison',\n 'field' => 'field',\n 'value' => 'value',\n 'comparison' => '',\n 'connective' => '',\n 'caseInsensitive' => '',\n 'error' => array(\n 'InvalidArgumentException' => 'Cannot add condition. Invalid comparison operator specified.'\n ),\n ),\n array(\n 'label' => __LINE__ .': empty connective',\n 'field' => 'field',\n 'value' => 'value',\n 'comparison' => P4Cms_Record_Filter::COMPARE_EQUAL,\n 'connective' => '',\n 'caseInsensitive' => '',\n 'error' => array(\n 'InvalidArgumentException' => 'Cannot add condition. Invalid connective specified.'\n ),\n ),\n );\n\n foreach ($tests as $test) {\n extract($test);\n\n try {\n P4Cms_Record_Filter::create()->add($field, $value, $comparison, $connective, $caseInsensitive);\n $this->fail($label.' Unexpected success');\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n $this->fail($e->getMessage());\n } catch (PHPUnit_Framework_ExpectationFailedError $e) {\n $this->fail($e->getMessage());\n } catch (Exception $e) {\n if (!$test['error']) {\n $this->fail(\"$label - Unexpected exception (\". get_class($e) .') :'. $e->getMessage());\n } else {\n list($class, $error) = each($test['error']);\n $this->assertEquals(\n $class,\n get_class($e),\n \"$label - expected exception class: \". $e->getMessage()\n );\n $this->assertEquals(\n $error,\n $e->getMessage(),\n \"$label - expected exception message\"\n );\n }\n }\n }\n }", "protected function filter(callable $filter)\n {\n return $this->setFilter($filter);\n }", "function filter($func, $xs) {\n return new \\std\\_FilterIterator($func, $xs);\n}", "function wp_filter_object_list($input_list, $args = array(), $operator = 'and', $field = \\false)\n {\n }", "public static function filter($var)\n {\n //TODO\n }", "function filter_data($data, $filter) {\n return CMContent::Filter($data, $filter);\n}", "public function filter(callable $c = null);", "protected function testObjects() {\n }", "public function setFilter(\\FilterIterator $filter)\n\t{\n\t\t$this->filter = $filter;\n\t}", "public function test_remove_filter_within_class_array( $hook ) {\n $removed = yourls_remove_filter( $hook, array( 'Change_Variable', 'change_it' ) );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function TestFilterUserByStatus()\n {\n $expected = $this->usersFilter->filterByCurrency(\"authorized\",\"authorized\");\n $this->assertTrue($expected);\n }", "public function filterVisible(): self;", "public function getFilter();", "public function getFilter();", "function mFILTER(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$FILTER;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:211:3: ( 'filter' ) \n // Tokenizer11.g:212:3: 'filter' \n {\n $this->matchString(\"filter\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function testToArrayWithFilter()\n {\n $aggregation = new FilterAggregation('test_agg');\n\n $aggregation->setFilter(new MissingFilter('test'));\n $aggregation->toArray();\n }", "public function testFiltering()\n {\n $this->getManager();\n\n $result = $this->getFilerManger()->execute(new Request());\n\n $actual = [];\n foreach ($result->getResult() as $doc) {\n $actual[] = $doc->getId();\n }\n\n $this->assertCount(1, $actual);\n }" ]
[ "0.6586772", "0.65611553", "0.6426967", "0.6378053", "0.6339948", "0.63219154", "0.62681127", "0.625397", "0.62239796", "0.6219945", "0.6202439", "0.614001", "0.6104981", "0.6101359", "0.6061781", "0.60586596", "0.6026564", "0.60031074", "0.6001481", "0.59855956", "0.5980194", "0.5948086", "0.5946844", "0.5938343", "0.59219587", "0.5880038", "0.5860134", "0.5858248", "0.5855117", "0.58485645", "0.58342236", "0.5833283", "0.5831866", "0.57961106", "0.5795416", "0.5794656", "0.57623106", "0.57472956", "0.5730299", "0.5724776", "0.57224816", "0.5705674", "0.57010317", "0.56996644", "0.5691344", "0.5691154", "0.56796604", "0.5675487", "0.5662993", "0.5656059", "0.5653726", "0.5639843", "0.5634546", "0.5609395", "0.55983704", "0.5594925", "0.55727446", "0.55464053", "0.55426675", "0.55400443", "0.5539154", "0.5534399", "0.552996", "0.54953045", "0.54890937", "0.5486219", "0.5482746", "0.5463083", "0.5460111", "0.5457347", "0.54526556", "0.5446243", "0.54444414", "0.5443711", "0.5440094", "0.54314893", "0.54298615", "0.54251975", "0.5404304", "0.54035807", "0.5400352", "0.539748", "0.53962874", "0.53916943", "0.5384413", "0.53765184", "0.53650856", "0.53620696", "0.53613317", "0.5357711", "0.5357313", "0.5351969", "0.5337064", "0.5335857", "0.5332904", "0.5330293", "0.5330293", "0.532996", "0.5319138", "0.5307208" ]
0.753174
0
Handler for unknown URLs
function error404() { $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'); $code='404'; $text='Not Found'; header($protocol . ' ' . $code . ' ' . $text); //header("Status: 404 Not Found"); //http_response_code(404); echo "<h1>404 Page Does Not Exist</h1>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function notFoundPageHandler() {\n $valid = true;\n $url_route = !empty($this->request->get['_route_']) ? $this->request->get['_route_'] : '';\n\n // Check non alias\n $url_base = $this->request->server['HTTPS'] ? $this->config->get('config_ssl') : $this->config->get('config_url');\n $url_request = ($this->request->server['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n if (!$url_route) {\n $url_route = urldecode(str_replace($url_base, '', $url_request));\n }\n\n\n // Blacklist 404 that start with this word\n $blacklist = array('admin/', 'asset/', 'assets/', 'image/', 'cache/', 'view/');\n foreach ($blacklist as $block) {\n if (strpos($url_route, $block) !== false) {\n $valid = false;\n break;\n }\n }\n\n if ($valid) {\n $route = $this->{$this->callModel}->MissingPageWorker($url_route, $this->storeId);\n\n if ($route) {\n // Info: Chrome and Firefox cache a 301 redirect with no expiry date\n $this->response->redirect($url_base . ltrim($route, '/'), 301);\n }\n }\n }", "public function handle_404()\n {\n }", "public function force404();", "public function force404();", "function process_urls($urls) {\n\tif (count($urls) > 0) {\n\t\techo '<p>Getting url:'.$urls[0].', '. count($urls) .' remaining</p>';\n\t\tget_url_info($urls[0], $urls);\n\t}\n}", "function redirect_guess_404_permalink()\n {\n }", "function maybe_redirect_404()\n {\n }", "public function show404();", "public function badUrlProvider() {\n\n $badRedirects[\"ip: 127.0.0.1\"] = array(\"http://127.0.0.1\", false);\n\n // Anything that resolves to zero needs to be tested carefully due to falsiness\n $badRedirects[\"ip: 0\"] = array(\"http://0/data.json\", false);\n\n // Hex is bad\n $badRedirects[\"ip: hex\"] = array(\"http://0x7f000001/data.json\", false);\n\n // So is octal\n $badRedirects[\"ip: octal\"] = array(\"http://0123/data.json\", false);\n\n // We don't like mixed hex and octal either\n $badRedirects[\"ip: mixed hex/octal/decimal\"] = array(\"http://0x7f.0x0.0.0/data.json\", false);\n\n // We don't even like dotted-quads\n $badRedirects[\"ip: dotted-quad\"] = array(\"http://111.22.34.56/data.json\", false);\n\n // Don't you come around here with any of that IPv6 crap\n $badRedirects[\"ipv6: localhost\"] = array(\"http://[::1]\", false);\n\n // Domains that resolve to IPv4 localhost? NFW.\n $badRedirects[\"localhost.ip4\"] = array(\"https://localhost.ip4/\", [['type' => 'A', 'ip' => '127.0.0.1']]);\n\n // Domains that resolve to IPv6 localhost? Get out!\n $badRedirects[\"localhost.ip6\"] = array(\"https://localhost.ip6:443\", [['type' => 'AAAA', 'ipv6' => '::1']]);\n\n // Domains that resolve to IPv6 addresses that represent IPv4 private ranges? Not on our watch!\n $badRedirects[\"localhost2.ip6\"] = array(\"http://localhost2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.1']]);\n $badRedirects[\"private1.ip6\"] = array(\"https://private1.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:192.168.1.18']]);\n $badRedirects[\"private2.ip6\"] = array(\"https://private2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:10.0.0.1']]);\n $badRedirects[\"private3.ip6\"] = array(\"http://private3.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.2']]);\n\n // Domains that resolve to IPv6 link-local adddresses? Hell no!\n $badRedirects[\"linklocal.ip6\"] = array(\"https://linklocal.ip6/\", [['type' => 'AAAA', 'ipv6' => 'fe80::']]);\n\n return $badRedirects;\n }", "public function initializeRedirectUrlHandlers() {}", "function _404() {\n die();\n }", "private function route_not_found() {\r\n\t\t\t// Also when in debug mode - show comprehensive messages\r\n\t\t\tdie(\"404 Page not found\");\r\n\t\t}", "public static function http404() {\n\t\tself::$global['CONTEXT']=$_SERVER['REQUEST_URI'];\n\t\tself::error(\n\t\t\tself::resolve(self::TEXT_NotFound),404,debug_backtrace(FALSE)\n\t\t);\n\t}", "public function purgeInvalidUrls();", "function drupal_fast_404(){}", "public function register_hooks() {\n\t\t\\add_filter( 'pre_handle_404', [ $this, 'handle_404' ] );\n\t}", "public function uriError()\n {\n header(\"HTTP/1.0 404\");\n exit();\n }", "public static function validRoutes(){\n $routes = self::$urled;\n $urlroute = $_GET['url'];\n $response1 = 0;\n\n\n foreach ($routes as $route) {\n if($urlroute == $route){\n $response1 += 1;\n }\n }\n if($response1 == 0){\n $response = ['error'=>'404 - not valid url'];\n echo json_encode($response);\n\n }\n }", "public function register_hooks() {\n\t\tadd_filter( 'pre_handle_404', array( $this, 'handle_404' ) );\n\t}", "public function is_404();", "static function dispatch() {\n\t\t\t//$path = '';\n\t\t\tif (isset($_GET['path'])) {\n\t\t\t\t$path = filter_input(INPUT_GET, 'path', FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\t}else{\n\t\t\t\t$path = '';\n\t\t\t}\n\t\t\tswitch($path) {\n\t\t\t\t//case '404':\n\t\t\t\t\t//include_once '/core/template/404.tpl.php';\n\t\t\t\t\t//return;\n\t\t\t}\n\t\t\t$array = Database::query('SELECT pages.url, modules.name as moduleName, pages.listener, pages.options FROM pages INNER JOIN modules ON pages.moduleID=modules.id WHERE (equal=false AND %s like CONCAT(url,\"%\")) OR (equal=true AND url=%s)ORDER BY length(url) DESC;', $path, $path);\n\t\t\tforeach($array as $page) {\n\t\t\t\t$event = new Event($page->url);\n\t\t\t\t$event->end = false;\n\t\t\t\t$event->options = $page->options;\n\t\t\t\t$event->overURL = substr($path, strlen($page->url));\n\t\t\t\t$moduleObject = ModuleManager::getModule($page->moduleName);\n\t\t\t\tif ($moduleObject === null)\tcontinue;\n\t\t\t\t$listener = $page->listener;\n\t\t\t\t$moduleObject->$listener($event);\n\t\t\t\tif ($event->end) return; \n\t\t\t}\n\t\t\t//var_dump($array);\n\t\t\theader('HTTP/1.1 404 Not Found');\n\t\t\tinclude_once 'core\\template\\404.tpl.php';\n\t\t\t//Log::info($_SERVER['QUERY_STRING'].' - '.$_SERVER['REQUEST_URI']);\n\t\t}", "public function routeUrlDestinationAutodetect()\n {\n\n }", "function sanitize_trackback_urls($to_ping)\n {\n }", "function request_not_found(&$url, $page) {\n if(substr($url, -1) != '/') {\n $page = \\femto\\Page::resolve($url.'/');\n if($page) {\n header('Location: '.$page['url'], true, 301);\n exit();\n }\n }\n}", "private static function pageNotFound()\n {\n if (self::$notFound && is_callable(self::$notFound)) {\n call_user_func(self::$notFound);\n } else {\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n throw new ExceptionHandler(\"Hata\", \"Controller bulunamadı\");\n }\n }", "public function onBeforeGet($url){}", "public function get_allowed_urls()\n {\n }", "function ajax_action_check_url() {\n\n\t\t$hadError = true;\n\n\t\t$url = isset( $_REQUEST['url'] ) ? $_REQUEST['url'] : '';\n\n\t\tif ( strlen( $url ) > 0 && function_exists( 'get_headers' ) ) {\n\t\t\t\t\n\t\t\t$file_headers = @get_headers( $url );\n\t\t\t$exists = $file_headers && $file_headers[0] != 'HTTP/1.1 404 Not Found';\n\t\t\t$hadError = false;\n\t\t}\n\n\t\techo '{ \"exists\": '. ($exists ? '1' : '0') . ($hadError ? ', \"error\" : 1 ' : '') . ' }';\n\n\t\tdie();\n\t}", "public function set_404()\n {\n }", "private function urlExist() {\n if (!$this->webhook->url) {\n // throw an exception\n $this->missingEx('url');\n }\n }", "function fixup_protocolless_urls($in)\n{\n require_code('urls2');\n return _fixup_protocolless_urls($in);\n}", "private function check_url() {\n\t\t$check_url_object = new Router();\n\t\t$this->loader->add_action( 'init', $check_url_object, 'boot' );\n\t}", "function notFound() {\n header('HTTP/1.0 404 Not Found');\n }", "public function handle_404( $handled ) {\n\n\t\tif ( is_feed() ) {\n\t\t\treturn $this->is_feed_404( $handled );\n\t\t}\n\n\t\treturn $handled;\n\t}", "function notfound() {\n\t\t$this->fw->render('404');\n\t}", "public function checkPageUnavailableHandler() {}", "public function notFound()\n {\n Controller::getController('PageNotFoundController')->run();\n }", "public function handle_404( $handled ) {\n\t\tif ( ! $this->is_feed_404() ) {\n\t\t\treturn $handled;\n\t\t}\n\n\t\t$this->set_404();\n\t\t$this->set_headers();\n\n\t\t\\add_filter( 'old_slug_redirect_url', '__return_false' );\n\t\t\\add_filter( 'redirect_canonical', '__return_false' );\n\n\t\treturn true;\n\t}", "public function notFound()\n {\n }", "function url_analyze ($url)\n{\n\trequire (\"url_handling_parameters.php\");\n\n\t// return-values:\n\t// 0 = url is not allowed, unable to handle\n\t// 1 = url is ok -> make picture\n\t// 2 = url is email\n\t// 3 = url is downloadable file\n\n\t\n\t// allowed?\n\tif (eregiArray($url_forbidden,$url)) return 0;\n\t// email\n\tif (eregiArray($url_email,$url)) return 2; \n\t// downloadable files\n\telseif (eregiArray($url_download,$url)) return 3;\n\t// allowed url\n\telseif (eregiArray($url_allowed,$url)) return 1;\n\t\n\telse return 0;\n}", "public function notFound($url) {\n $this->commitReplace($this->view->get404(), '#two');\n }", "public function executePage404(sfWebRequest $request)\n {\n }", "static function matchUrl($_non404=True){\n\t\t$cBindA = $_non404? self::$bindA : self::$bind404A;\n\n\t\t//collect detected url's\n\t\t$bondA = [];\n\t\tforeach ($cBindA as $cBind)\n\t\t\tif ($cBind->match())\n\t\t\t\t$bondA[] = $cBind;\n\n\t\tif (!count($bondA))\n\t\t\treturn;\n\t\t\n\t\treturn $bondA;\n\t}", "function error_404() {\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n exit(); //don't do any additional php, we are done\n }", "private function loadURLs() {\r\n $status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\tforeach ($this->_url as $scriptname => $modes)\r\n\t{\r\n\t\t$this->url[$scriptname] = $modes[$status];\r\n\t}\r\n }", "private function parseURLRequest() {\n\t\t# Redirects the user upon success and redirects to following error-messages upon errors:\n\t\t# 201 - Missing url-entry for the given ID\n\n\t\t$this->parseCustomURL();\t# Let's see if there's an custom-url we gotten our hands on\n\n\t\t$urlID = $this->baseToInt($_GET['u']);\n\t\t$this->verifyID($urlID);\n\n\t\t# assuming everything's good, moving on.\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT `url` FROM urls WHERE `id` = :id\");\n\t\t$query->bindParam(\":id\", $urlID);\n\t\t$query->execute();\n\t\t\n\t\t$data = $query->fetch();\n\t\t\n\t\tif(!isset($data['url'])) {\n\t\t\t$this->debugLog(\"The database did not return any URL for ID {$_GET['u']}\");\n\t\t\theader(\"Location:{$this->siteURL}error/201\");\n\t\t\tdie;\n\t\t}\n\t\telse {\n\t\t\t$this->debugLog(\"Redirecting to {$data['url']}\");\n\t\t\t$this->logUrlClick($urlID);\n\t\t\theader(\"HTTP/1.1 301 Moved Permanently\");\n\t\t\theader(\"Location: {$data['url']}\"); # Should we use URL-encode here?\n\t\t\tdie;\n\t\t}\n\t}", "public function testUrlCatchAllRoute(): void\n {\n Router::createRouteBuilder('/')\n ->connect('/*', ['controller' => 'Categories', 'action' => 'index']);\n $result = Router::url(['controller' => 'Categories', 'action' => 'index', '0']);\n $this->assertSame('/0', $result);\n\n $expected = [\n 'plugin' => null,\n 'controller' => 'Categories',\n 'action' => 'index',\n 'pass' => ['0'],\n '_matchedRoute' => '/*',\n ];\n $result = Router::parseRequest($this->makeRequest('/0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n\n $result = Router::parseRequest($this->makeRequest('0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n }", "public function notFound()\n {\n http_response_code(404);\n error_log('404 page not found: '.$this->getRequest());\n kodexy()->loadView('system/notFound');\n $this->completeRequest();\n }", "function pageNotFound()\n {\n $this->global['pageTitle'] = 'Garuda Informatics : 404 - Page Not Found';\n \n $this->loadViews(\"404\", $this->global, NULL, NULL);\n }", "public function error404()\n {\n }", "private function initUrlProcess() {\n $url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $urld = urldecode($url);\n $url = trim(str_replace($this->subdir, \"\", $urld), '/');\n\n // Redirect index aliases\n if (in_array($url, ['home', 'index', 'index.php'])) {\n redirect($this->subdir, 301);\n }\n\n $this->url = $url;\n $this->segments = empty($url) ? [] : explode('/', $url);\n }", "function notFound()\n{\n error404('<h1>404 Not Found</h1>The page that you have requested could not be found.');\n}", "public function sniff_requests() {\r\n global $wp;\r\n\r\n if(isset($wp->query_vars['__api'])){\r\n $this->handle_request();\r\n exit;\r\n }\r\n }", "public function handler404()\n {\n $this->getResponse()->setStatusCode(404);\n return;\n }", "function phishtank_check_add( $false, $url ) {\n $url = yourls_sanitize_url( $url );\n\n // only check for 'http(s)'\n if( !in_array( yourls_get_protocol( $url ), array( 'http://', 'https://' ) ) )\n return $false;\n \n // is the url malformed?\n if ( phishtank_is_blacklisted( $url ) === yourls_apply_filter( 'phishtank_malformed', 'malformed' ) ) {\n\t\treturn array(\n\t\t\t'status' => 'fail',\n\t\t\t'code' => 'error:nourl',\n\t\t\t'message' => yourls__( 'Missing or malformed URL' ),\n\t\t\t'errorCode' => '400',\n\t\t);\n }\n\t\n // is the url blacklisted?\n if ( phishtank_is_blacklisted( $url ) != false ) {\n\t\treturn array(\n\t\t\t'status' => 'fail',\n\t\t\t'code' => 'error:spam',\n\t\t\t'message' => 'Ce domaine est sur liste noire',\n\t\t\t'errorCode' => '403',\n\t\t);\n }\n\t\n\t// All clear, not interrupting the normal flow of events\n\treturn $false;\n}", "function unknownHandler($d, $data, $clientid){\n\t}", "protected function getLinkHandlers() {}", "protected function getLinkHandlers() {}", "public function executeIndex()\n {\n $this->forward404();\n }", "private function notFound() {\n if (file_exists(APP . 'Controller/error.php')) {\n header('Location: ' . BASE_URL . 'error');\n } else {\n die('Sorry, the requested content could not be found');\n }\n }", "public function onPageNotFound($sender, $param) {\r\n\t}", "public function is_404()\n {\n }", "function lb_show_404_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'page_404',\n\t\t)\n\t);\n}", "protected function _setupNotFoundErrorHandling()\n\t{\n\t\t// we store current handler, so as to pass-thru to it if needed\n\t\t$this->joomlaErrorHandler = JError::getErrorHandling(E_ERROR);\n\n\t\t// then override Joomla! handler\n\t\tJError::setErrorHandling(E_ERROR, 'callback', array($this, 'sh404sefErrorPage'));\n\t\tset_exception_handler(array($this, 'sh404sefErrorPage'));\n\t}", "private function analyzeURL() {\n\t\tif (!$this->_isAnalyzed) {\n\t\t\t// Don't call this method twice!\n\t\t\t$this->_isAnalyzed = true;\n\t\t\t$this->_isAnalyzing = true;\n\t\t\t\n\t\t\ttry {\n\t\t\t\ttry {\n\t\t\t\t\t$trunkURL = new URL(Config::getEmptyURLPrefix());\n\t\t\t\t} catch (FormatException $e) {\n\t\t\t\t\tthrow new CorruptDataException('The url prefix is not a valid url: '.\n\t\t\t\t\t\tConfig::getEmptyURLPrefix());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// The request url might not be a valid url...\n\t\t\t\ttry {\n\t\t\t\t\t$requestURL = new URL($this->_url);\n\t\t\t\t} catch (FormatException $e) {\n\t\t\t\t\t$this->_pageNode = new PageNotFoundNode(new StructurePageNode(), '');\n\t\t\t\t\t$this->_relativeRequestURL = '';\n\t\t\t\t\t$this->_isAnalyzing = false;\n\t\t\t\t\t$this->_project = Project::getOrganization();\n\t\t\t\t\t$this->_language = Language::getDefault();\n\t\t\t\t\t$this->_edition = Edition::COMMON;\n\t\t\t\t\treturn; \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// We can't use the URL class here because the template contains\n\t\t\t\t// characters ({ and }) that are now allowed in a url\n\t\t\t\tpreg_match('/[^:]+\\:\\/\\/(?P<host>[^\\/]+)(?<path>.*)/i',\n\t\t\t\t\tConfig::getURLTemplate(), $matches);\n\t\t\t\t$templateHost = $matches['host'];\n\t\t\t\t$templatePath = $matches['path'];\n\t\t\t\t\t\n\t\t\t\t// Goes through all elements and checks if they match to any available\n\t\t\t\t// template.\n\t\t\t\t// Returns the index of the element after the last used one\n\t\t\t\t$walker = function($elements, $templates, $trunkElements,\n\t\t\t\t\t$breakOnFailure, $state)\n\t\t\t\t{\n\t\t\t\t\tif (count($trunkElements)) {\n\t\t\t\t\t\tif (count($elements) > count($trunkElements))\n\t\t\t\t\t\t\tarray_splice($elements, -count($trunkElements));\n\t\t\t\t\t\tif (count($templates) > count($trunkElements))\n\t\t\t\t\t\t\tarray_splice($templates, -count($trunkElements));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfor ($i = 0; $i < count($elements); $i++) {\n\t\t\t\t\t\t$element = $elements[$i];\n\t\t\t\t\t\tforeach ($templates as $templateKey => $template) {\n\t\t\t\t\t\t\t// Check if the lement matches the template. Test the strongest\n\t\t\t\t\t\t\t// defined template at first.\n\t\t\t\t\t\t\t$ok = false;\n\t\t\t\t\t\t\tswitch ($template) {\n\t\t\t\t\t\t\t\tcase '{edition}':\n\t\t\t\t\t\t\t\t\tswitch ($element) {\n\t\t\t\t\t\t\t\t\t\tcase 'mobile':\n\t\t\t\t\t\t\t\t\t\t\t$state->edition = Edition::MOBILE;\n\t\t\t\t\t\t\t\t\t\t\t$ok = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 'print':\n\t\t\t\t\t\t\t\t\t\t\t$state->edition = Edition::PRINTABLE;\n\t\t\t\t\t\t\t\t\t\t\t$ok = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcase '{language}':\n\t\t\t\t\t\t\t\t\t$lang = Language::getByName($element);\n\t\t\t\t\t\t\t\t\tif ($lang) {\n\t\t\t\t\t\t\t\t\t\t$state->language = $lang;\n\t\t\t\t\t\t\t\t\t\t$ok = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the element matches the template, \n\t\t\t\t\t\t\tif ($ok) {\n\t\t\t\t\t\t\t\tunset($templates[$templateKey]);\n\t\t\t\t\t\t\t\t// unset does not reorder the indices, so use array_splice\n\t\t\t\t\t\t\t\tarray_splice($elements, 0, 1);\n\t\t\t\t\t\t\t\t$i--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($breakOnFailure && !$ok) {\n\t\t\t\t\t\t\tarray_splice($elements, 0, $i);\n\t\t\t\t\t\t\treturn $elements;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn $elements;\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\t// requestURL - emptyURLPrefix = significant data\n\t\t\t\t// urlTemplate - emptyURLPrefix = template for the data\n\t\t\t\t\n\t\t\t\t$state = (object)\n\t\t\t\t\t(array('edition' => Edition::COMMON, 'language' => null));\n\t\t\t\t\n\t\t\t\t// Domain part\n\t\t\t\t$trunkElements = self::explodeRemoveEmpty($trunkURL->getHost(), '.');\n\t\t\t\t$elements = self::explodeRemoveEmpty($requestURL->getHost(), '.');\n\t\t\t\t$templates = self::explodeRemoveEmpty($templateHost, '.');\n\t\t\t\tcall_user_func($walker, $elements, $templates, $trunkElements, false,\n\t\t\t\t\t$state);\n\t\t\t\t\n\t\t\t\t// Path part\n\t\t\t\t$trunkElements = self::explodeRemoveEmpty($trunkURL->getPath(), '/');\n\t\t\t\t$elements = self::explodeRemoveEmpty($requestURL->getPath(), '/');\n\t\t\t\t$templates = self::explodeRemoveEmpty($templatePath, '/');\n\t\t\t\t$elements = call_user_func($walker, $elements, $templates,\n\t\t\t\t\t$trunkElements, true, $state);\n\t\n\t\t\t\tif (!$state->language) {\n\t\t\t\t\tforeach (self::parseHTTPLanguageHeader() as $code) {\n\t\t\t\t\t\tif ($lang = Language::getByName($code)) {\n\t\t\t\t\t\t\t$state->language = $lang;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!$state->language)\n\t\t\t\t\t\t$state->language = Language::getDefault();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$this->_language = $state->language;\n\t\t\t\t$this->_edition = $state->edition;\n\t\t\t\t\n\t\t\t\t$this->_relativeRequestURL = implode('/', $elements);\n\t\t\t\t\n\t\t\t\tif (!$node = PageNode::fromPath($elements, $impact, $isBackend)) {\n\t\t\t\t\tif ($isBackend) {\n\t\t\t\t\t\t$rest = $this->_relativeRequestURL;\n\t\t\t\t\t\tif ($impact)\n\t\t\t\t\t\t\t$rest = Strings::substring($rest,\n\t\t\t\t\t\t\t\tStrings::length($impact->getURL()) - ($rest[0] == '!' ? 2 : 0));\n\t\t\t\t\t\t$node = new BackendPageNotFoundNode($impact, $rest);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$node = new PageNotFoundNode($impact,\n\t\t\t\t\t\t\tStrings::substring($this->_relativeRequestURL,\n\t\t\t\t\t\t\t\tStrings::length($impact->getURL())));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->_pageNode = $node;\n\t\t\t\t$this->_project = $node->getProject();\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$this->_isAnalyzing = false;\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t\t$this->_isAnalyzing = false;\n\t\t}\n\t}", "protected function process($urls) {\n // by default assume no match\n $match = false;\n \n // loop through list of URL regex patterns to find a match - \n // processing stops as soon as a match is found so URL patterns \n // should be ordered with the most important first\n foreach ($urls as $regEx => $dest) {\n $requestVars = array();\n \n // does the current URL match - if so capture matched sub-groups\n if (preg_match(\"#^$regEx(\\?.*)?$#\", $this->get_request_uri(), $this->requestVars)) {\n // the first match is the full URL - we not really \n // interested in that so drop\n array_shift($requestVars);\n \n // rule could be simple mapping to action or more complex \n // details containing mapping type etc\n if (is_array($dest)) {\n // if complex form a mapping type must be present (action, redirect, sub-patterns etc)\n if (!empty($dest['type'])) {\n switch ($dest['type']) {\n // sets name of action in class property\n case 'action':\n if (!empty($dest['action'])) {\n $this->set_action($dest['action'], $this->requestVars);\n } else {\n throw new HaploNoActionDefinedException(\"No action defined for $regEx.\");\n }\n break;\n // performs http redirect (301, 302, 404 etc)\n case 'redirect':\n if (!empty($dest['url'])) {\n if (!empty($dest['code'])) {\n $this->redirect($dest['url'], $dest['code']);\n } else {\n $this->redirect($dest['url']);\n }\n } else {\n throw new HaploNoRedirectUrlDefinedException(\"No redirect URL defined for $regEx.\");\n }\n break;\n case 'sub-patterns':\n // process sub URL patterns - this allows one to create sub pattern matches under \n // a base pattern for efficency reasons\n $subPatterns = array();\n \n foreach ($dest['sub-patterns'] as $subRegEx => $subDest) {\n $subPatterns[$regEx.$subRegEx] = $subDest;\n }\n $this->process($subPatterns);\n break;\n default:\n throw new HaploActionTypeNotSupportedException(\"Action type not supported for $regEx. Should be one of 'action', 'redirect' or 'sub-patterns'.\");\n }\n } else {\n throw new HaploNoActionDefinedException(\"No action type defined for $regEx. Should be one of 'action', 'redirect' or 'sub-patterns'.\");\n }\n } else {\n $this->set_action($dest);\n }\n \n $match = true;\n // we don't want to continue processing patterns if a matching one has been found\n break;\n }\n }\n \n // if none of the URL patterns matches look for a default 404 action\n if (!$match) {\n // send http 404 error header\n header('HTTP/1.1 404 Not Found');\n \n // check for existence of a 404 action\n if (file_exists(\"$this->actionsPath/page-not-found.php\")) {\n $this->set_action('page-not-found');\n } else {\n throw new HaploNoDefault404DefinedException(\"No default 404 action found. Add a file named page-not-found.php to $this->actionsPath/ to suppress this message.\");\n }\n }\n \n return $match;\n }", "public function handleRequest($url){\r\n if(array_key_exists($url,$this->routes)){\r\n $controller = $this->routes[$url];\r\n $this->callController($controller);\r\n }else{\r\n $this->getErrorPage($url);\r\n }\r\n }", "private function loadURLs()\r\n\t{\r\n\t\t$status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\t\tforeach ($this->url as $scriptname => $modes)\r\n\t\t\t$this->url_script[$scriptname] = $modes[$status];\r\n\t}", "public function testErrorIsThrownIfURLNotFound()\n {\n $this->mockHttpResponses([new Response(404, [], view('tests.google-404')->render())]);\n\n self::$importer->get('google-not-found-url', now()->subYear(), now()->addYear());\n }", "public function testUrlError() {\n\t\t$this->Helper->url('nope.js');\n\t}", "function lb_show_404_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'page-404',\n\t\t)\n\t);\n}", "static public function invalidUriMethodProvider()\n {\n return array(\n array('some crap', 'GET'),\n array('*', 'POST'),\n array('ftp://example.com/baz/bar', 'GET'),\n array('host:433', 'HEAD'),\n array('http://example.com/path', 'CONNECT')\n );\n }", "public function handle_redirection()\n {\n }", "public static function _notFound() {\n self::response(false)\n ->status(404)\n ->write(\n '<h1>404 Not Found</h1>'.\n '<h3>The page you have requested could not be found.</h3>'.\n str_repeat(' ', 512)\n )\n ->send();\n }", "protected function handleNotFound(ServerRequestInterface $request)\n {\n // 重写路由找不到的处理逻辑\n return admin_abort([\"msg\" => \"页面不存在\"],404);\n }", "public function invalidUrlProvider() : array\n {\n return Yaml::parseFile(__DIR__ . DIRECTORY_SEPARATOR . 'urls.yml')['invalid'];\n }", "public function badRedirectProvider() {\n $badUrls = $this->badUrlProvider();\n $badRedirects = array();\n foreach($badUrls as $name => $badUrl) {\n $urlParts = parse_url(array_shift($badUrl));\n unset($urlParts['scheme']);\n\n // The redir.xpoc.pro tool is provided by sp1d3R in the HackerOne Bug Bounty program\n // If it goes away, we'll need some other way to easily generate a redirect to an internal URL\n $badRedirects[$name] = array(\"http://redir.xpoc.pro/\".implode($urlParts), array_shift($badUrl));\n }\n return $badRedirects;\n }", "function error_404() {\n\t\theader($_SERVER[\"SERVER_PROTOCOL\"] . \" 404 Not Found\");\n\t\texit();\n\t}", "public static function permalinkHandler($segments) {\n\n\t\t$viewtype = array_shift($segments);\n\t\t$referrer_hash = array_shift($segments);\n\t\tif (!preg_match('/^[a-f0-9]{32}$/i', $referrer_hash)) {\n\t\t\t// The hash was moved into URL query parameters\n\t\t\t$guid = $referrer_hash;\n\t\t\t$referrer_hash = get_input('uh');\n\t\t} else {\n\t\t\t$guid = array_shift($segments);\n\t\t\tset_input('uh', $referrer_hash);\n\t\t}\n\n\t\tswitch ($viewtype) {\n\t\t\tcase 'image' :\n\t\t\t\t// BC router\n\t\t\t\t$size = array_shift($segments);\n\t\t\t\t$ia = elgg_set_ignore_access(true);\n\t\t\t\t$entity = get_entity($guid);\n\t\t\t\t$url = $entity->getIconURL($size);\n\t\t\t\telgg_set_ignore_access($ia);\n\t\t\t\tforward($url);\n\t\t\t\treturn;\n\n\t\t\tdefault :\n\n\t\t\t\tswitch ($viewtype) {\n\t\t\t\t\tcase 'json+oembed' :\n\t\t\t\t\tcase 'json oembed' :\n\t\t\t\t\t\t$viewtype = 'json';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'xml+oembed' :\n\t\t\t\t\tcase 'xml oembed' :\n\t\t\t\t\t\t$viewtype = 'xml';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!elgg_is_registered_viewtype($viewtype)) {\n\t\t\t\t\t$viewtype = 'default';\n\t\t\t\t}\n\n\t\t\t\telgg_set_viewtype($viewtype);\n\n\t\t\t\tif (!$guid || !elgg_entity_exists($guid)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$ia = elgg_set_ignore_access();\n\t\t\t\t$entity = get_entity($guid);\n\n\t\t\t\tif (!has_access_to_entity($entity) && !is_discoverable($entity)) {\n\t\t\t\t\telgg_set_ignore_access($ia);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\telgg_register_plugin_hook_handler('head', 'page', function($hook, $type, $return) use ($entity) {\n\t\t\t\t\tif (isset($return['links']['canonical'])) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (elgg_is_active_plugin('hypeSeo')) {\n\t\t\t\t\t\t$svc = \\hypeJunction\\Seo\\RewriteService::getInstance();\n\t\t\t\t\t\t$data = $svc->getRewriteRulesFromGUID($entity->getURL());\n\t\t\t\t\t\tif (isset($data['sef_path'])) {\n\t\t\t\t\t\t\t$return['links']['canonical'] = [\n\t\t\t\t\t\t\t\t'href' => elgg_normalize_url($data['sef_path']),\n\t\t\t\t\t\t\t\t'rel' => 'canonical',\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\treturn $return;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$return['links']['canonical'] = [\n\t\t\t\t\t\t'href' => $entity->getURL(),\n\t\t\t\t\t\t'rel' => 'canonical',\n\t\t\t\t\t];\n\n\t\t\t\t\treturn $return;\n\t\t\t\t});\n\n\t\t\t\t$forward_url = false;\n\n\t\t\t\t$is_walled = elgg_get_config('walled_garden') && !elgg_is_logged_in();\n\t\t\t\tif (has_access_to_entity($entity) && $viewtype == 'default' && !$is_walled) {\n\t\t\t\t\t$forward_url = $entity->getURL();\n\t\t\t\t}\n\n\t\t\t\t$forward_url = elgg_trigger_plugin_hook('entity:referred', $entity->getType(), array(\n\t\t\t\t\t'entity' => $entity,\n\t\t\t\t\t'user_hash' => $referrer_hash,\n\t\t\t\t\t'referrer' => $_SERVER['HTTP_REFERER'],\n\t\t\t\t\t\t), $forward_url);\n\n\t\t\t\tif ($forward_url) {\n\t\t\t\t\telgg_set_ignore_access($ia);\n\t\t\t\t\tforward($forward_url);\n\t\t\t\t}\n\n\t\t\t\tif (elgg_get_plugin_setting('nocrawl', 'hypeDiscovery')) {\n\t\t\t\t\telgg_set_http_header('X-Robots-Tag: noindex', true);\n\n\t\t\t\t\telgg_register_plugin_hook_handler('head', 'page', function($hook, $type, $return) {\n\t\t\t\t\t\t$return['metas'][] = [\n\t\t\t\t\t\t\t'name' => 'robots',\n\t\t\t\t\t\t\t'content' => 'noindex',\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\treturn $return;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\techo elgg_view_resource('permalink', [\n\t\t\t\t\t'viewtype' => $viewtype,\n\t\t\t\t\t'user_hash' => $referrer_hash,\n\t\t\t\t\t'guid' => $guid,\n\t\t\t\t\t'entity' => $entity,\n\t\t\t\t]);\n\n\t\t\t\telgg_set_ignore_access($ia);\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function notFound()\n {\n $this->response = $this->response->withStatus(404);\n $this->jsonBody($this->payload->getInput());\n }", "function helperCheckForWrongUrl() {\n\t\t$status = array();\n\n\t\tif ($GLOBALS['TSFE']->config['config']['baseURL'] != '' || $GLOBALS['TSFE']->config['config']['absRefPrefix']) {\n\t\t\t$currentDomain = t3lib_div::getIndpEnv('TYPO3_HOST_ONLY');\n\t\t\t$linkDomain = $this->pi_getPageLink($GLOBALS['TSFE']->id);\n\n\t\t\tif ($linkDomain != '' && strpos($linkDomain, $currentDomain) === false) {\n\t\t\t\t$status['current']\t= $currentDomain;\n\t\t\t\t$status['link']\t\t\t= $linkDomain;\n\t\t\t}\n\t\t}\n\n\t\treturn $status;\n\t}", "public function getMalformedURISchemes()\n {\n return array(\"\",);\n }", "function show_404() {\n\t\tredirect( 'users', 'location' );\n\t\texit();\n\t}", "function canHandleCurrentUrl() ;", "public static function getUrlHandlers($url = null)\n {\n if (!valid($url))\n {\n $url = self::getUrlQ();\n }\n if (!valid($url))\n {\n $url = BaseConfig::HOME_URL;\n }\n $url_parts = explode(\"/\", $url);\n $num_parts = count($url_parts);\n\n $sql = \"SELECT uh.module, uh.permission, md.status FROM url_handler uh LEFT JOIN module md ON (uh.module = md.name) WHERE (num_parts='$num_parts' OR num_parts='0') AND md.status = 1\";\n $c = 0;\n $args = array();\n foreach ($url_parts as $part)\n {\n $sql .= \" AND (p$c = '::p$c' OR p$c = '%')\";\n $args[\"::p$c\"] = $part;\n $c++;\n }\n $sql .= \" ORDER BY num_parts DESC\";\n\n $db = Sweia::getInstance()->getDB();\n\n $rs = $db->query($sql, $args);\n $handlers = array();\n\n /* Store the handlers */\n while ($handler = $db->fetchObject($rs))\n {\n $handlers[$handler->module] = array(\"module\" => $handler->module, \"permission\" => $handler->permission);\n }\n return $handlers;\n }", "public function _remap () {\n show_404();\n }", "function init__urls()\n{\n global $HTTPS_PAGES_CACHE;\n $HTTPS_PAGES_CACHE = null;\n\n global $CAN_TRY_URL_SCHEMES_CACHE;\n $CAN_TRY_URL_SCHEMES_CACHE = null;\n\n global $HAS_KEEP_IN_URL_CACHE;\n $HAS_KEEP_IN_URL_CACHE = null;\n\n global $URL_REMAPPINGS;\n $URL_REMAPPINGS = null;\n\n global $CONTENT_OBS;\n $CONTENT_OBS = null;\n\n global $SMART_CACHE, $LOADED_MONIKERS_CACHE;\n if ($SMART_CACHE !== null) {\n $test = $SMART_CACHE->get('NEEDED_MONIKERS');\n if ($test === null) {\n $LOADED_MONIKERS_CACHE = array();\n } else {\n foreach ($test as $c => $_) {\n list($url_parts, $zone, $effective_id) = unserialize($c);\n\n $LOADED_MONIKERS_CACHE[$url_parts['type']][$url_parts['page']][$effective_id] = true;\n }\n }\n }\n\n global $SELF_URL_CACHED;\n $SELF_URL_CACHED = null;\n\n global $HAS_NO_KEEP_CONTEXT, $NO_KEEP_CONTEXT_STACK;\n $HAS_NO_KEEP_CONTEXT = false;\n $NO_KEEP_CONTEXT_STACK = array();\n\n if (!defined('SELF_REDIRECT')) {\n define('SELF_REDIRECT', '!--:)defUNLIKELY');\n }\n}", "static function http404()\n {\n header('HTTP/1.1 404 Not Found');\n exit;\n }", "public function testOnNotFound()\n {\n // Start of user code RouterSpecialEventsControllerTest.testonNotFound\n $controller = new RouterSpecialEventsController();\n $httpResponse = $controller->onNotFound(new AssociativeArray('string'));\n $this->assertEquals(404, $httpResponse->getStatusCode());\n $this->assertEquals(\n \"<html><h1>Error 404</h1><p>No ressource available at this URI</p><p>TiBeN Framework</p></html>\", \n $httpResponse->getMessage()\n );\n // End of user code\n }", "function check($value)\r\n\t{\r\n\t\tif (!preg_match(\"~^(https?://[a-zA-Z\\.]+)?/?([a-zA-Z\\.]+/?)+(\\??[^\\?]*)#?[^#]*$~i\", $value))\r\n\t\t{\r\n\t\t\t$this->error('BAD_URL');\r\n\t\t} \r\n\r\n\t}", "function wp_guess_url()\n {\n }", "function churl_reachability( $churl_reachable, $url, $keyword = '' ) {\n global $ydb;\n\n preg_match( '!^[a-zA-Z0-9\\+\\.-]+:(//)?!', $url, $matches );\n $protocol = ( isset( $matches[0] ) ? $matches[0] : '' );\n $different_protocols = array (\n 'http://',\n 'https://'\n );\n\n if ($protocol == '') {\n \t$protocol = 'http://';\n \t$url = 'http://' . $url;\n }\n\n $check_url = in_array( $protocol, $different_protocols );\n\n // Return to normal routine if non-http(s) protocol is valid\n if ($check_url == false){\n return false;\n }\n\n // Check if the long URL is reachable\n $resURL = curl_init();\n curl_setopt($resURL, CURLOPT_URL, $url);\n curl_setopt($resURL, CURLOPT_BINARYTRANSFER, 1);\n curl_setopt($resURL, CURLOPT_HEADERFUNCTION, 'curlHeaderCallback');\n curl_setopt($resURL, CURLOPT_FAILONERROR, 1);\n curl_exec ($resURL);\n $intReturnCode = curl_getinfo($resURL, CURLINFO_HTTP_CODE);\n curl_close ($resURL);\n\n // Return error if the entered URL is unreachable\n if ($intReturnCode == '' || $intReturnCode == 404) {\n $return['status'] = 'fail';\n $return['code'] = 'error:url';\n $return['message'] = 'The entered URL is unreachable. Check the URL or try again later.';\n $return['statusCode'] = 200; // regardless of result, this is still a valid request\n return yourls_apply_filter( 'add_new_link_fail_unreachable', $return, $url, $keyword, $title );\n }\n\n return false;\n}", "public function isDynamicUrl();", "private function getErrorPage($url){\r\n header(\"HTTP/1.0 404 Not Found\");\r\n die(strtoupper(\"error 404 $url not found\"));\r\n }", "public function notFound(BaseResponse $response);", "public function onPrivmsg()\n {\n $source = $this->getEvent()->getSource();\n $user = $this->getEvent()->getNick();\n\n $pattern = '#'.($this->detectSchemeless ? '' : 'https?://').'(?:([0-9]{1,3}(?:\\.[0-9]{1,3}){3})(?![^/]) | ('\n .($this->detectSchemeless ? '(?<!http:/|https:/)[@/\\\\\\]' : '').')?(?:(?:[a-z0-9_-]+\\.?)+\\.[a-z0-9]{1,6}))[^\\s]*#xis';\n\n // URL Match\n if (preg_match_all($pattern, $this->getEvent()->getArgument(1), $matches, PREG_SET_ORDER)) {\n $responses = array();\n foreach ($matches as $m) {\n $url = trim(rtrim($m[0], ', ].?!;'));\n\n // Check to see if the URL was from an email address, is a directory, etc\n if (!empty($m[2])) {\n $this->debug('Invalid Url: URL is either an email or a directory path. (' . $url . ')');\n continue;\n }\n\n // Parse the given URL\n if (!$parsed = $this->parseUrl($url)) {\n $this->debug('Invalid Url: Could not parse the URL. (' . $url . ')');\n continue;\n }\n\n // allow out-of-class renderers to handle this URL\n foreach ($this->renderers as $renderer) {\n if ($renderer->renderUrl($parsed) === true) {\n // renderers should return true if they've fully\n // rendered the passed URL (they're responsible\n // for their own output)\n $this->debug('Handled by renderer: ' . get_class($renderer));\n continue 2;\n }\n }\n\n // Check to see if the given IP/Host is valid\n if (!empty($m[1]) and !$this->checkValidIP($m[1])) {\n $this->debug('Invalid Url: ' . $m[1] . ' is not a valid IP address. (' . $url . ')');\n continue;\n }\n\n // Process TLD if it's not an IP\n if (empty($m[1])) {\n // Get the TLD from the host\n $pos = strrpos($parsed['host'], '.');\n $parsed['tld'] = ($pos !== false ? substr($parsed['host'], ($pos+1)) : '');\n\n // Check to see if the URL has a valid TLD\n if (is_array($this->tldList) && !in_array(strtolower($parsed['tld']), $this->tldList)) {\n $this->debug('Invalid Url: ' . $parsed['tld'] . ' is not a supported TLD. (' . $url . ')');\n continue;\n }\n }\n\n // Check to see if the URL is to a secured site or not and handle it accordingly\n if ($parsed['scheme'] == 'https' && !extension_loaded('openssl')) {\n if (!$this->sslFallback) {\n $this->debug('Invalid Url: HTTPS is an invalid scheme, OpenSSL isn\\'t available. (' . $url . ')');\n continue;\n } else {\n $parsed['scheme'] = 'http';\n }\n }\n\n if (!in_array($parsed['scheme'], array('http', 'https'))) {\n $this->debug('Invalid Url: ' . $parsed['scheme'] . ' is not a supported scheme. (' . $url . ')');\n continue;\n }\n $url = $this->glueURL($parsed);\n unset($parsed);\n\n // Convert url\n $shortenedUrl = $this->shortener->shorten($url);\n if (!$shortenedUrl) {\n $this->debug('Invalid Url: Unable to shorten. (' . $url . ')');\n continue;\n }\n\n // Prevent spamfest\n if ($this->checkUrlCache($url, $shortenedUrl)) {\n $this->debug('Invalid Url: URL is in the cache. (' . $url . ')');\n continue;\n }\n\n $title = self::getTitle($url);\n if (!empty($title)) {\n $responses[] = str_replace(\n array(\n '%title%',\n '%link%',\n '%nick%'\n ), array(\n $title,\n $shortenedUrl,\n $user\n ), $this->messageFormat\n );\n }\n\n // Update cache\n $this->updateUrlCache($url, $shortenedUrl);\n unset($title, $shortenedUrl, $title);\n }\n /**\n * Check to see if there were any URL responses, format them and handle if they\n * get merged into one message or not\n */\n if (count($responses) > 0) {\n if ($this->mergeLinks) {\n $message = str_replace(\n array(\n '%message%',\n '%nick%'\n ), array(\n implode('; ', $responses),\n $user\n ), $this->baseFormat\n );\n $this->doPrivmsg($source, $message);\n } else {\n foreach ($responses as $response) {\n $message = str_replace(\n array(\n '%message%',\n '%nick%'\n ), array(\n implode('; ', $responses),\n $user\n ), $this->baseFormat\n );\n $this->doPrivmsg($source, $message);\n }\n }\n }\n }\n }", "function hcpu_catch_file_request() {\n\tif ( ! isset( $_GET['hc-get-file'] ) ) {\n\t\treturn;\n\t}\n\n\t// Serve file or redirect to login.\n\tif ( is_user_member_of_blog() ) {\n\t\thcpu_serve_file();\n\t} else {\n\t\tbp_do_404();\n\t}\n}", "public function testUrlGenerationWithUrlFilterFailureClosure(): void\n {\n $this->expectException(CakeException::class);\n $this->expectExceptionMessageMatches(\n '/URL filter defined in .*RouterTest\\.php on line \\d+ could not be applied\\.' .\n ' The filter failed with: nope/'\n );\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/{lang}/{controller}/{action}/*');\n $request = new ServerRequest([\n 'params' => [\n 'plugin' => null,\n 'lang' => 'en',\n 'controller' => 'Posts',\n 'action' => 'index',\n ],\n ]);\n Router::setRequest($request);\n\n Router::addUrlFilter(function ($url, $request): void {\n throw new RuntimeException('nope');\n });\n Router::url(['controller' => 'Posts', 'action' => 'index', 'lang' => 'en']);\n }", "public function isValidUrlInvalidRessourceDataProvider() {}", "public static function check_store($url,$controller,$methode){\n foreach($GLOBALS[\"route_url\"] as $key => $value){\n if(explode(\"/\",$key)[1] === $url && $value[\"controller\"] === $controller && $value[\"method\"] === $methode ){\n\n Wrong::_404(\"route; DOUBLE ROUTING \");\n\n }\n if($key === $url && $value[\"controller\"] === $controller && $value[\"method\"] === $methode ){\n Wrong::_404(\"route; DOUBLE ROUTING \");\n \n \n\n }\n \n \n }\n\n\n\n }", "function sysError404(){\n\tsysError( \"Please check the address and try again.\", \"The page you requested was not found.\", \"Page Not Found\" );\t\n\texit();\n}" ]
[ "0.69054794", "0.65330166", "0.6211636", "0.6211636", "0.6200396", "0.61715794", "0.61610186", "0.61190236", "0.60491496", "0.60266644", "0.59287953", "0.5892336", "0.58870935", "0.58764046", "0.5874127", "0.58679694", "0.586796", "0.58470917", "0.5840845", "0.5830301", "0.58294386", "0.5829111", "0.58278614", "0.5811365", "0.5780885", "0.57134", "0.57117647", "0.5711083", "0.5686871", "0.5685709", "0.56795335", "0.5665076", "0.5654948", "0.56537515", "0.5635838", "0.56171036", "0.5614772", "0.56126374", "0.56126034", "0.56124216", "0.5610781", "0.55583644", "0.55447274", "0.5541496", "0.5541115", "0.5540167", "0.5538085", "0.552695", "0.550233", "0.54929423", "0.5490679", "0.5476087", "0.54757184", "0.5471405", "0.5457789", "0.54559004", "0.5451078", "0.5451078", "0.54479104", "0.54374874", "0.54361063", "0.543004", "0.54296833", "0.54170763", "0.5410227", "0.5409703", "0.5406676", "0.54034334", "0.5401279", "0.53902066", "0.53889996", "0.5388752", "0.53859043", "0.53852445", "0.53795373", "0.53675216", "0.53663695", "0.53543663", "0.53529936", "0.53439426", "0.5331357", "0.5325465", "0.5321028", "0.53204274", "0.53196204", "0.53193617", "0.53189695", "0.5312059", "0.53081375", "0.5302048", "0.53020275", "0.5288848", "0.52827364", "0.5268558", "0.5263869", "0.52489424", "0.52455", "0.52384335", "0.52365005", "0.5235702", "0.5229679" ]
0.0
-1
Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { // For security, start by assuming the visitor is NOT authorized. $isValid = False; // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; } // Or, you may restrict access to only certain users based on their username. if (in_array($UserGroup, $arrGroups)) { $isValid = true; } if (($strUsers == "") && false) { $isValid = true; } } return $isValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkPageAllowed() {\n\n if (!$this->user->isPersonnalManager()) {\n\n header('Location: ./index.php');\n exit();\n }\n }", "public function restricted()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n if (isset($_SESSION['type']))\n $site->printNav($_SESSION['type']);\n echo \"You are not allowed to access this resource. Return <a href=\\\"index.php\\\">Home</a>\";\n $site->printFooter();\n\n }", "function user_can_access_admin_page()\n {\n }", "public function restrict() {\n\t\tif (!$this->is_logged_in()) {\n\t\t\tredirect('login', 'refresh');\n\t\t}\n\t}", "function isRestricted() {\t\n\n\t\tif (isset($_SESSION['logged-in']) && $_SESSION['isAdmin']) {\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Location: restricted.php\");//Instant Re direct to Restricted due to lack of permissions.\n\t\t}\t\t\t\n\t}", "public function manage_comments_page_access() {\n\t\tif ( ! current_user_can( 'moderate_comments' ) ) {\n\t\t\twp_die(\n\t\t\t\t__( 'You do not have permission to moderate comments.', 'wpcampus-network' ),\n\t\t\t\t__( 'Moderating Comments', 'wpcampus-network' ),\n\t\t\t\t[ 'back_link' => true ]\n\t\t\t);\n\t\t}\n\t}", "public function canManagePages();", "function show_deny() {\n\t\t\tshow_error(\n\t\t\t\t'403 Forbidden',\n\t\t\t\t'You do not have sufficient clearance to view this page.'\n\t\t\t);\n\t\t}", "public function checkAccessToPage($path){\n\t\t//Get current authenticated user data\n\t\t$admin = Auth::user();\n\t\t//Get user role\n\t\t$admin_roles = Roles::select('slug', 'access_pages')->where('slug', '=', $admin['role'])->first();\n\t\t//Check for Grant-access rules\n\t\tif($admin_roles->access_pages == 'grant_access'){\n\t\t\treturn true;\n\t\t}\n\n\t\t//Get accesses list for current role (access_pages is forbidden pages list)\n\t\t$forbidden_pages = (array)json_decode($admin_roles->access_pages);\n\t\t//get path for current page\n\t\t$natural_path = $this->getNaturalPath($path);\n\t\t//Get current page data\n\t\t$current_page = AdminMenu::select('id', 'slug')->where('slug', '=', $natural_path)->first();\n\n\t\t//if there is no id of current page in forbidden pages list\n\t\tif(!in_array($current_page->id, array_keys($forbidden_pages))){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//Check for CRUD restrictions\n\t\t\t$forbidden_pages = json_decode($admin_roles->access_pages);\n\t\t\t$current_page_id = $current_page->id;\n\n\t\t\t//convert current page path to full-slash view\n\t\t\t$path = (substr($path, 0,1) != '/')? '/'.$path: $path;\n\t\t\t//create path to links array\n\t\t\t$path_array = array_values(array_diff(explode('/',$path), ['']));\n\t\t\t//check for action-path\n\t\t\tswitch($path_array[count($path_array) -1]){\n\t\t\t\tcase 'edit':\n\t\t\t\tcase 'update':\n\t\t\t\t\tif(strpos($forbidden_pages->$current_page_id, 'u') !== false){\n\t\t\t\t\t\treturn abort(503);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'create':\n\t\t\t\tcase 'store':\n\t\t\t\t\tif(strpos($forbidden_pages->$current_page_id, 'c') !== false){\n\t\t\t\t\t\treturn abort(503);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif(strpos($forbidden_pages->$current_page_id, 'r') !== false){\n\t\t\t\t\t\treturn abort(503);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "public function responsableDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_RESPONSABLE');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_RESPONSABLE', null, 'User tried to access a page without having ROLE_RESPONSABLE');\n}", "public function testRestrictPage()\n {\n $this->assertTrue(true);\n }", "function require_permission($required)\n{\n require_login();\n\n // owners have full access\n if ($_SESSION['permission'] == OWN) {\n return;\n }\n\n if ($required != $_SESSION['permission']) {\n redirect_to(url_for(\"/index.php\"));\n }\n}", "abstract public function require_access();", "function allow_user_privileges() {\n\tif(!$_SESSION['role']):\n\t\theader('Location: ?q=start');\n\tendif;\n}", "protected function restrict() {\n $this->restrict_to_permission('blog');\n }", "public function veterinaireDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_VETERINAIRE');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_VETERINAIRE', null, 'User tried to access a page without having ROLE_VETERINAIRE');\n}", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "public static function denyAccess()\n {\n static::redirect(static::adminPath(), cbTrans('denied_access'));\n }", "public function page_test() {\n\n\t\tprint_r($this->permissions->check(\"can_view_admin\"));\n\t}", "function restrictedToAdmin(\n $redirectPage\n) {\n restrictedToAuthorized($redirectPage);\n $authUser = Authorizer::getAuthorizedUser();\n if ($authUser == null || ! $authUser->isAdmin()) {\n header(\"Location: \" . $redirectPage);\n exit();\n }\n}", "protected function _isAllowed()\n {\n \treturn true;\n }", "public function index()\n {\n if (Gate::allows('admin-only', auth()->user())) {\n \n return view('page.page01');\n\n }else if(Gate::allows('about-page', auth()->user())){\n\n return view('page.page01');\n\n }else{\n \n return redirect('/denied')->with('error','You dont have access to page -ABOUT- ! Your Admin Premission without page access!'); \n }\n }", "abstract protected function canAccess();", "public function restrict($url){\n if($this->session->get('auth') == null){\n header(\"Location : $url\");\n exit();\n }\n }", "function page_allowed($conn,$conn_admin,$id,$page)\n {\n $sql=\"select cn.id from customer_navbar cn left outer join customer_navbar_corresponding_pages cncp on cn.id=cncp.navbar_id where cn.link='$page' or cncp.link='$page' \";\n $res=$conn_admin->query($sql);\n if($res->num_rows>0)\n {\n $row=$res->fetch_assoc();\n $nid=$row['id'];\n $sql=\"select access from navbar_access where navbar_id=$nid and staff_id=$id\";\n \t\tif($res=$conn->query($sql))\n \t\t{\n \t\t\tif($res->num_rows>0)\n \t\t\t{\n \t\t\t\t$row=$res->fetch_assoc();\n \t\t\t\tif($row['access']!=0)\n \t\t\t\t\treturn true;\n \t\t\t\telse\n \t\t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$sql=\"\";\n \t\t\treturn false;\n \t\t}\n }\n\t\telse\n\t\t{\n\t\t\t$sql=\"\";\n\t\t\treturn false;\n\t\t} \n }", "public function authorize()\n {\n return auth()->user()->ability('admin','update_pages');\n }", "function admEnforceAccess()\n{\n if( !admCheckAccess() ) {\n // no access. stop right now.\n\n // should print error message, but hey. let's just dump back to homepage\n header( \"Location: /\" ); \n exit;\n }\n}", "public function livreurDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_LIVREUR');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_LIVREUR', null, 'User tried to access a page without having ROLE_LIVREUR');\n}", "public function adminDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_ADMINISTRATEUR');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_ADMINISTRATEUR', null, 'User tried to access a page without having ROLE_ADMINISTRATEUR');\n}", "function authorizedAdminOnly(){\n global $authenticatedUser;\n if(!$authenticatedUser['admin']){\n header(\"HTTP/1.1 403 Forbidden\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-403\");\n exit();\n }\n }", "function securePage($uri) {\n\n //Separate document name from uri\n $tokens = explode('/', $uri);\n $page = $tokens[sizeof($tokens) - 1];\n global $mysqli, $db_table_prefix, $loggedInUser;\n //retrieve page details\n $stmt = $mysqli->prepare(\"SELECT \n\t\tid,\n\t\tpage,\n\t\tprivate\n\t\tFROM \" . $db_table_prefix . \"pages\n\t\tWHERE\n\t\tpage = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"s\", $page);\n $stmt->execute();\n $stmt->bind_result($id, $page, $private);\n while ($stmt->fetch()) {\n $pageDetails = array('id' => $id, 'page' => $page, 'private' => $private);\n }\n $stmt->close();\n //If page does not exist in DB, allow access\n if (empty($pageDetails)) {\n return true;\n }\n //If page is public, allow access\n elseif ($pageDetails['private'] == 0) {\n return true;\n }\n //If user is not logged in, deny access\n elseif (!isUserLoggedIn()) {\n header(\"Location: index.php\");\n return false;\n } else {\n //Retrieve list of permission levels with access to page\n $stmt = $mysqli->prepare(\"SELECT\n\t\t\tpermission_id\n\t\t\tFROM \" . $db_table_prefix . \"permission_page_matches\n\t\t\tWHERE page_id = ?\n\t\t\t\");\n $stmt->bind_param(\"i\", $pageDetails['id']);\n $stmt->execute();\n $stmt->bind_result($permission);\n while ($stmt->fetch()) {\n $pagePermissions[] = $permission;\n }\n $stmt->close();\n //Check if user's permission levels allow access to page\n if ($loggedInUser->checkPermission($pagePermissions)) {\n return true;\n }\n //Grant access if master user\n elseif ($loggedInUser->user_id == $master_account) {\n return true;\n } else {\n header(\"Location: account.php\");\n return false;\n }\n }\n}", "public function denyAccess(): AccessResultInterface;", "function userCanEditPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageEdit(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}", "public function checkAccess() {\n // if the user is not allowed access to the ACL, then redirect him\n if (!$this->user->isAllowed(ACL_RESOURCE, ACL_PRIVILEGE)) {\n // @todo change redirect to login page\n $this->redirect('Denied:');\n }\n }", "function restrict($id_module='0', $teh=null)\r\n\t{\r\n\t\tif($this->is_logged_in() === FALSE) {\r\n\r\n\t\t\tredirect(base_url());\r\n\r\n\t\t} else if($id_module != 0 && $this->izin($id_module, $teh) === FALSE) {\r\n\r\n\t\t\tredirect(base_url('admin/access_forbidden'));\r\n\r\n\t\t\tdie();\r\n\r\n\t\t}\r\n\t}", "public function denyLink()\n {\n }", "function userCanViewPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageView(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}", "public function authorize()\n {\n abort_if(Gate::denies('permission_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n return true;\n }", "function restrictedToAuthorized(\n $redirectPage = null\n) {\n if ($redirectPage == null) {\n $redirectPage = $GLOBALS[\"pagelink\"][\"register\"];\n }\n if (!Authorizer::userIsAuthorized()) {\n $_SESSION['redirect_url'] = \\Web\\Framework\\Request\\getSubUrl();\n header(\"Location: \" . $redirectPage);\n exit();\n }\n}", "public function checkAccess()\n {\n // need to be modified for security\n }", "function deny($message = null) {\n // Ignore soft 403 for ajax requests as redirections is transparent.\n if (config\\SOFT_403 != false && !\\melt\\request\\is_ajax()) {\n $user = get_user();\n if ($user === null) {\n if (config\\LAST_DENY_AUTOREDIRECT)\n $_SESSION['userx\\LAST_DENY_PATH'] = APP_ROOT_URL . \\substr(REQ_URL, 1);\n if ($message === null)\n $message = _(\"Access denied. You are not logged in.\");\n \\melt\\messenger\\redirect_message(config\\SOFT_403, $message, \"bad\");\n } else {\n if ($message === null)\n $message = _(\"Access denied. Insufficient permissions.\");\n \\melt\\messenger\\redirect_message(config\\SOFT_403, $message, \"bad\");\n }\n } else\n \\melt\\request\\show_xyz(403);\n exit;\n}", "function allow_admin_privileges() {\n\tif($_SESSION['role']!=='administrator'):\n\t\theader('Location: ?q=start');\n\tendif;\n}", "function checkAccess() ;", "function securePage($uri){\r\n\t\r\n\t//Separate document name from uri\r\n\t$tokens = explode('/', $uri);\r\n\t$page = $tokens[sizeof($tokens)-1];\r\n\tglobal $mysqli,$db_table_prefix,$loggedInUser;\r\n\t//retrieve page details\r\n\t$stmt = $mysqli->prepare(\"SELECT \r\n\t\tid,\r\n\t\tpage,\r\n\t\tprivate\r\n\t\tFROM \".$db_table_prefix.\"pages\r\n\t\tWHERE\r\n\t\tpage = ?\r\n\t\tLIMIT 1\");\r\n\t$stmt->bind_param(\"s\", $page);\r\n\t$stmt->execute();\r\n\t$stmt->bind_result($id, $page, $private);\r\n\twhile ($stmt->fetch()){\r\n\t\t$pageDetails = array('id' => $id, 'page' => $page, 'private' => $private);\r\n\t}\r\n\t$stmt->close();\r\n\t//If page does not exist in DB, allow access\r\n\tif (empty($pageDetails)){\r\n\t\treturn true;\r\n\t}\r\n\t//If page is public, allow access\r\n\telseif ($pageDetails['private'] == 0) {\r\n\t\treturn true;\t\r\n\t}\r\n\t//If user is not logged in, deny access\r\n\telseif(!isUserLoggedIn()) \r\n\t{\r\n\t\theader(\"Location: login.php\");\r\n\t\treturn false;\r\n\t}\r\n\telse {\r\n\t\t//Retrieve list of permission levels with access to page\r\n\t\t$stmt = $mysqli->prepare(\"SELECT\r\n\t\t\tpermission_id\r\n\t\t\tFROM \".$db_table_prefix.\"permission_page_matches\r\n\t\t\tWHERE page_id = ?\r\n\t\t\t\");\r\n\t\t$stmt->bind_param(\"i\", $pageDetails['id']);\t\r\n\t\t$stmt->execute();\r\n\t\t$stmt->bind_result($permission);\r\n\t\twhile ($stmt->fetch()){\r\n\t\t\t$pagePermissions[] = $permission;\r\n\t\t}\r\n\t\t$stmt->close();\r\n\t\t//Check if user's permission levels allow access to page\r\n\t\tif ($loggedInUser->checkPermission($pagePermissions)){ \r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t//Grant access if master user\r\n\t\telseif ($loggedInUser->user_id == $master_account){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\theader(\"Location: account.php\");\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t}\r\n}", "public function isForbidden();", "private function authorize()\n {\n $authorized = FALSE;\n\n if ( in_array(ee()->session->userdata['group_id'], ee()->publisher_setting->can_admin_publisher()))\n {\n $authorized = TRUE;\n }\n\n if (ee()->session->userdata['group_id'] == 1)\n {\n $authorized = TRUE;\n }\n\n if ( !$authorized)\n {\n ee()->publisher_helper_url->redirect(ee()->publisher_helper_cp->mod_link('view_unauthorized'));\n }\n }", "function AllowAnonymousUser() {\n\t\tswitch (EW_PAGE_ID) {\n\t\t\tcase \"add\":\n\t\t\tcase \"register\":\n\t\t\tcase \"addopt\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"edit\":\n\t\t\tcase \"update\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"delete\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"view\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"search\":\n\t\t\t\treturn FALSE;\n\t\t\tdefault:\n\t\t\t\treturn FALSE;\n\t\t}\n\t}", "public function customAccessPage() {\r\n return [\r\n '#markup' => $this->t('This menu entry will not be visible and access will result\r\n in a 403 error unless the user has the \"authenticated\" role. This is\r\n accomplished with a custom access check plugin.'),\r\n ];\r\n }", "public function authorize() {\n\t\treturn false;\n }", "public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }", "function protect_page() {\n if(!logged_in()) {\n header('Location: protected.php');\n exit();\n }\n }", "abstract public function url_authorize();", "private function prepareForViewing($pagename) {\n Wi3::inst()->sitearea->setpage($pagename); // Will also execute the \"wi3.init.sitearea.page.loaded\" event\n // Now check the rights for this page\n // Pages can only be viewed if the page has not set any 'viewright' or if the user that requests the page is logged in and has that required viewright\n $page = Wi3::inst()->sitearea->page;\n // TODO: rewrite with ACL, see adminarea\n if (!empty($page->viewright))\n {\n // Check for required role\n $requiredrole = $page->viewright;\n $hasrequiredrole = false;\n // Check if there is a logged-in user for this site at all\n $user = Wi3::inst()->sitearea->auth->user;\n if (is_object($user))\n {\n // Check user rights\n $roles = $user->roles;\n foreach($roles as $role)\n {\n if (strtolower($role->name) === strtolower($requiredrole) OR $role->name === strtolower(\"admin\"))\n {\n $hasrequiredrole = true;\n break;\n }\n }\n }\n // Check\n if (!$hasrequiredrole)\n {\n // Redirect to the loginpage of the site (if known, that is)\n $site = Wi3::inst()->sitearea->site;\n if(strlen($site->loginpage) > 0)\n {\n Request::instance()->redirect(Wi3::inst()->urlof->page($site->loginpage));\n }\n else\n {\n throw(new ACL_Exception_403()); // Permission denied\n exit;\n }\n }\n }\n // Caching is per user\n Wi3::inst()->cache->requireCacheParameter(\"user\");\n $user = Wi3::inst()->sitearea->auth->user;\n if (is_object($user)) {\n $userid = $user->id;\n } else {\n $userid = \"\";\n }\n //Wi3::inst()->cache->doRemoveCacheWhenAllRequiredCacheParametersAreFilled();\n Wi3::inst()->cache->fillCacheParameter(\"user\", $userid);\n // By default, don't cache pages\n // This can be overridden in the user template, if desired\n Wi3::inst()->cache->doNotCache();\n }", "public function getExplicitlyAllowAndDeny() {}", "public function allow()\n {\n ++$this->allowed;\n\n if (NODE_ACCESS_DENY !== $this->result) {\n $this->result = NODE_ACCESS_ALLOW;\n }\n }", "private function userNotPermit(){\n throw new \\Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException('Bad user',null, 403);\n }", "private function userHasAccessToPages() {\n\t\t$configurationProxy = tx_oelib_configurationProxy::getInstance('realty');\n\n\t\t$objectsPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForRealtyObjectsAndImages'\n\t\t);\n\t\t$canWriteObjectsPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $objectsPid), 16\n\t\t);\n\n\t\t$auxiliaryPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForAuxiliaryRecords'\n\t\t);\n\t\t$canWriteAuxiliaryPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $auxiliaryPid), 16\n\t\t);\n\n\t\tif (!$canWriteObjectsPage) {\n\t\t\t$this->storeErrorMessage('objects_pid', $objectsPid);\n\t\t}\n\t\tif (!$canWriteAuxiliaryPage) {\n\t\t\t$this->storeErrorMessage('auxiliary_pid', $auxiliaryPid);\n\t\t}\n\n\t\treturn $canWriteObjectsPage && $canWriteAuxiliaryPage;\n\t}", "function plasso_protect_pages() {\n\t$options = get_theme_mod('plasso');\n\t$protected = $options['space_page'];\n\n\t// If we are on a protected page.\n if(is_page($protected)) {\n $plassoBilling = new PlassoBilling((isset($_GET['__logout']))?'logout':(isset($_GET['_plasso_token'])?$_GET['_plasso_token']:NULL));\n\t}\n}", "function securePage($uri){ // every file in the framework uses this\r\n\t//Separate document name from uri\r\n\r\n\t$tokens = explode('/', $uri);\r\n\r\n\t$page = $tokens[sizeof($tokens)-1];\r\n\r\n\tglobal $mysqli,$db_table_prefix,$loggedInUser;\r\n\r\n\t//retrieve page details\r\n\r\n\t$stmt = $mysqli->prepare(\"SELECT \r\n\r\n\t\tid,\r\n\r\n\t\tpage,\r\n\r\n\t\tprivate\r\n\r\n\t\tFROM \".$db_table_prefix.\"pages\r\n\r\n\t\tWHERE\r\n\r\n\t\tpage = ?\r\n\r\n\t\tLIMIT 1\");\r\n\r\n\t$stmt->bind_param(\"s\", $page);\r\n\r\n\t$stmt->execute();\r\n\r\n\t$stmt->bind_result($id, $page, $private);\r\n\r\n\twhile ($stmt->fetch()){\r\n\r\n\t\t$pageDetails = array('id' => $id, 'page' => $page, 'private' => $private);\r\n\r\n\t}\r\n\r\n\t$stmt->close();\r\n\r\n\t//If page does not exist in DB, allow access\r\n\r\n\tif (empty($pageDetails)){\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\t//If page is public, allow access\r\n\r\n\telseif ($pageDetails['private'] == 0) {\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\t//If user is not logged in, deny access and prompt them to log in\r\n\r\n\telseif(!isUserLoggedIn()) \r\n\r\n\t{\t\r\n\t\theader(\"Location: login.php\"); exit();\r\n\t\t\r\n\t}\r\n\r\n\telse {\r\n\r\n\t\t// The page exists, it is private, and user is logged in, so...\r\n\t\t//Retrieve list of permission levels with access to page\r\n\r\n\t\t$stmt = $mysqli->prepare(\"SELECT\r\n\r\n\t\t\tpermission_id\r\n\r\n\t\t\tFROM \".$db_table_prefix.\"permission_page_matches\r\n\r\n\t\t\tWHERE page_id = ?\r\n\r\n\t\t\t\");\r\n\r\n\t\t$stmt->bind_param(\"i\", $pageDetails['id']);\t\r\n\r\n\t\t$stmt->execute();\r\n\r\n\t\t$stmt->bind_result($permission);\r\n\r\n\t\twhile ($stmt->fetch()){\r\n\r\n\t\t\t$pagePermissions[] = $permission;\r\n\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\r\n\t\t//Check if user's permission levels allow access to page\r\n\r\n\t\tif ($loggedInUser->checkPermission($pagePermissions)){ \r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t\t//Grant access if master user\r\n\r\n\t\telseif ($loggedInUser->user_id == $master_account){\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t\telse {\r\n\r\n\t\t\theader(\"Location: account.php\"); // why here? User is logged in, but can't get to the requested page. Dump them to account\r\n\r\n\t\t\treturn false;\t\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}", "protected function restrict() {\n $this->restrict_to_permission('manage_products');\n }", "public function action_access_denied()\r\n\t{\r\n\t\t$this->title = \"Access Denied\";\r\n\t\t$this->template->content = View::factory('access_denied');\r\n\t}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "function applies() {\n\t\t$context =& $this->_router->getContext($this->_request);\n\t\treturn ( $context && $context->getSetting('restrictSiteAccess'));\n\t}", "function chekPrivies($privReq = '0', $privChek = '0'){\n\n\t// Get User Privilege from session\n\n\t$privChek = (int)$_SESSION['Privilege']; //Cast as int\n\n\t//if Priv less then access required redirect to main index.\n\tif ($privChek < $privReq){\n\t\t$myURL = VIRTUAL_PATH;\n\t\tmyRedirect($myURL);\n\t}\n}", "function admin_protect() {\n global $user_data;\n if($user_data['type'] != 1) {\n header(\"location: index.php\");\n exit();\n }\n }", "public function claimPageAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET LOGGED IN USER INFORMATION \n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET LEVEL ID\n if (!empty($viewer_id)) {\n $level_id = $viewer->level_id;\n } else {\n $authorizationTable = Engine_Api::_()->getItemTable('authorization_level');\n $authorization = $authorizationTable->fetchRow(array('type = ?' => 'public', 'flag = ?' => 'public'));\n if (!empty($authorization))\n $level_id = $authorization->level_id;\n }\n\n $getPackageClaim = Engine_Api::_()->sitepage()->getPackageAuthInfo('sitepage');\n $this->_helper->layout->setLayout('default-simple');\n\n //GET PAGE ID\n $page_id = $this->_getParam('page_id', null);\n\n //SET PARAMS\n $paramss = array();\n $paramss['page_id'] = $page_id;\n $paramss['viewer_id'] = $viewer_id;\n $inforow = Engine_Api::_()->getDbtable('claims', 'sitepage')->getClaimStatus($paramss);\n\n $this->view->status = 0;\n if (!empty($inforow)) {\n $this->view->status = $inforow->status;\n }\n\n\t\t//GET ADMIN EMAIL\n\t\t$coreApiSettings = Engine_Api::_()->getApi('settings', 'core');\n\t\t$adminEmail = $coreApiSettings->getSetting('core.mail.contact', $coreApiSettings->getSetting('core.mail.from', \"[email protected]\"));\n\t\tif(!$adminEmail) $adminEmail = $coreApiSettings->getSetting('core.mail.from', \"[email protected]\");\n \n //CHECK STATUS\n if ($this->view->status == 2) {\n echo '<div class=\"global_form\" style=\"margin:15px 0 0 15px;\"><div><div><h3>' . $this->view->translate(\"Alert!\") . '</h3>';\n echo '<div class=\"form-elements\" style=\"margin-top:10px;\"><div class=\"form-wrapper\" style=\"margin-bottom:10px;\">' . $this->view->translate(\"You have already send a request to claim for this page which has been declined by the site admin.\") . '</div>';\n echo '<div class=\"form-wrapper\"><button onclick=\"parent.Smoothbox.close()\">' . $this->view->translate(\"Close\") . '</button></div></div></div></div></div>';\n }\n\n $this->view->claimoption = $claimoption = Engine_Api::_()->authorization()->getPermission($level_id, 'sitepage_page', 'claim');\n\n //FETCH\n $paramss = array();\n $this->view->userclaim = $userclaim = 0;\n $paramss['page_id'] = $page_id;\n $paramss['limit'] = 1;\n $pageclaiminfo = Engine_Api::_()->getDbtable('pages', 'sitepage')->getSuggestClaimPage($paramss);\n\n if (!$claimoption || !$pageclaiminfo[0]['userclaim'] || !Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.claimlink', 1)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (isset($pageclaiminfo[0]['userclaim'])) {\n $this->view->userclaim = $userclaim = $pageclaiminfo[0]['userclaim'];\n }\n\n if ($inforow['status'] == 3 || $inforow['status'] == 4) {\n echo '<div class=\"global_form\" style=\"margin:15px 0 0 15px;\"><div><div><h3>' . $this->view->translate(\"Alert!\") . '</h3>';\n echo '<div class=\"form-elements\" style=\"margin-top:10px;\"><div class=\"form-wrapper\" style=\"margin-bottom:10px;\">' . $this->view->translate(\"You have already filed a claim for this page: \\\"%s\\\", which is either on hold or is awaiting action by administration.\", Engine_Api::_()->getItem('sitepage_page', $page_id)->title) . '</div>';\n echo '<div class=\"form-wrapper\"><button onclick=\"parent.Smoothbox.close()\">' . $this->view->translate(\"Close\") . '</button></div></div></div></div></div>';\n }\n\n if (!$inforow['status'] && $claimoption && $userclaim) {\n //GET FORM \n $this->view->form = $form = new Sitepage_Form_Claimpage();\n\n //POPULATE FORM\n if (!empty($viewer_id)) {\n $value['email'] = $viewer->email;\n $value['nickname'] = $viewer->displayname;\n $form->populate($value);\n }\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n\n //GET EMAIL\n $email = $values['email'];\n\n //CHECK EMAIL VALIDATION\n $validator = new Zend_Validate_EmailAddress();\n if (!$validator->isValid($email)) {\n $form->addError(Zend_Registry::get('Zend_Translate')->_('Please enter a valid email address.'));\n return;\n }\n\n //GET CLAIM TABLE\n $tableClaim = Engine_Api::_()->getDbTable('claims', 'sitepage');\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n //SAVE VALUES\n if (!empty($getPackageClaim)) {\n\n //GET SITEPAGE ITEM\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n\n //GET PAGE URL\n $page_url = Engine_Api::_()->sitepage()->getPageUrl($page_id);\n\n //SEND SITEPAGE TITLE TO THE TPL\n $page_title = $sitepage->title;\n\n //SEND CHANGE OWNER EMAIL\n\t\t\t\t\t\tif(Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.claim.email', 1) && Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.claimlink', 1)) {\n\t\t\t\t\t\t\tEngine_Api::_()->getApi('mail', 'core')->sendSystem($adminEmail, 'SITEPAGE_CLAIMOWNER_EMAIL', array(\n\t\t\t\t\t\t\t\t\t'page_title' => $page_title,\n\t\t\t\t\t\t\t\t\t'page_title_with_link' => '<a href=\"' . 'http://' . $_SERVER['HTTP_HOST'] .\n\t\t\t\t\t\t\t\t\tZend_Controller_Front::getInstance()->getRouter()->assemble(array('page_url' => $page_url), 'sitepage_entry_view', true) . '\" >' . $page_title . ' </a>',\n\t\t\t\t\t\t\t\t\t'object_link' => 'http://' . $_SERVER['HTTP_HOST'] .\n\t\t\t\t\t\t\t\t\tZend_Controller_Front::getInstance()->getRouter()->assemble(array('page_url' => $page_url), 'sitepage_entry_view', true),\n\t\t\t\t\t\t\t\t\t'email' => $coreApiSettings->getSetting('core.mail.from', \"[email protected]\"),\n\t\t\t\t\t\t\t\t\t'queue' => true\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\n $row = $tableClaim->createRow();\n $row->page_id = $page_id;\n $row->user_id = $viewer_id;\n $row->about = $values['about'];\n $row->nickname = $values['nickname'];\n $row->email = $email;\n $row->contactno = $values['contactno'];\n $row->usercomments = $values['usercomments'];\n $row->status = 3;\n $row->save();\n }\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => true,\n 'parentRefreshTime' => '60',\n 'parentRefresh' => 'true',\n 'format' => 'smoothbox',\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your request has been send successfully. You will now receive an email confirming Admin approval of your request.'))\n ));\n }\n }\n }", "public static function refererProtect() {\r\n\r\n $referer = Environment::get(\"HTTP_REFERER\");\r\n\r\n $match = preg_match(VALID_REFERER, $referer);\r\n\r\n if ($match === 1) {\r\n return true;\r\n } else {\r\n\r\n $template = Template::init('v_403_forbidden');\r\n $template->render(403);\r\n\r\n exit();\r\n }\r\n\r\n }", "function accessPage($con, $accID)\n\t{\n\t\t$accountAccess = allowAccess($con, $accID);\n\n\t\tif($accountAccess == 1 || $accountAccess == 2)\n\t\t{\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('location: error.php');\n\t\t}\n\n\t\t#return $accessPage;\n\t}", "protected function _isAllowed() {\r\n return Mage::getSingleton('admin/session')->isAllowed('sales/bookme/reseauchx_reservationreseau/siege');\r\n }", "public function notAllowedDeliverHook()\n {\n if (CHAMELEON_CHECK_VALID_USER_SESSION_ON_PROTECTED_DOWNLOADS) {\n throw new AccessDeniedHttpException('Access denied.');\n }\n }", "function effect() {\n\t\t// Get the user\n\t\t$user =& $this->_request->getUser();\n\t\tif (!is_a($user, 'PKPUser')) return AUTHORIZATION_DENY;\n\n\t\t// Get the copyeditor submission\n\t\t$copyeditorSubmission =& $this->getAuthorizedContextObject(ASSOC_TYPE_ARTICLE);\n\t\tif (!is_a($copyeditorSubmission, 'CopyeditorSubmission')) return AUTHORIZATION_DENY;\n\n\t\t// Copyeditors can only access submissions\n\t\t// they have been explicitly assigned to.\n\t\tif ($copyeditorSubmission->getUserIdBySignoffType('SIGNOFF_COPYEDITING_INITIAL') != $user->getId()) return AUTHORIZATION_DENY;\n\n\t\treturn AUTHORIZATION_PERMIT;\n\t}", "public function verifyAccess (\n\t)\t\t\t\t\t// RETURNS <void> redirects if user is not allowed editing access.\n\t\n\t// $contentForm->verifyAccess();\n\t{\n\t\tif(Me::$clearance >= 6) { return; }\n\t\t\n\t\t// Check if guest users are allowed to post on this site\n\t\tif(!$this->guestPosts) { $this->redirect(); }\n\t\t\n\t\t// Make sure you own this content\n\t\tif($this->contentData['uni_id'] != Me::$id)\n\t\t{\n\t\t\tAlert::error(\"Invalid User\", \"You do not have permissions to edit this content.\", 7);\n\t\t\t\n\t\t\t$this->redirect();\n\t\t}\n\t\t\n\t\t// If this entry is set to official, guest submitters cannot change it any longer\n\t\tif($this->contentData['status'] >= Content::STATUS_OFFICIAL)\n\t\t{\n\t\t\tAlert::saveInfo(\"Editing Disabled\", \"This entry is now an official live post, and cannot be edited.\");\n\t\t\t\n\t\t\t$this->redirect();\n\t\t}\n\t}", "function btwp_restrict_admin_access() {\n\t\n\tglobal $current_user;\n\tget_currentuserinfo();\n\t\n\tif( !array_key_exists( 'administrator', $current_user->caps ) ) {\n\t\twp_redirect( get_bloginfo( 'url' ) );\n\t\texit;\n\t}\n\n}", "public function indexAction()\n {\n echo 'Forbidden access';\n }", "private function _limited_access_by_page($page, $global = FALSE) {\n\t\t// Let's check the page variable, because\n\t\t// we don't want to show anything if we're\n\t\t// not on the right page.\n\t\t// \n\t\t// ignore this if it's global.\n\t\tif ($global !== 'yes') {\n\t\t\tif ($page) {\n\t\t\t\t// Allow for bar|separated|pages\n\t\t\t\tif (strpos($page, '|')) {\n\t\t\t\t\t$pages = explode('|', $page);\n\t\t\t\t} else {\n\t\t\t\t\t$pages = array($page);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Let's use a boolean to check for permissions\n\t\t\t\t$yo_brother_can_i_access_your_blog = FALSE;\n\t\t\t\t$default_page = $this->mojo->site_model->default_page();\n\t\t\t\t\n\t\t\t\t// Loop through the pages and check\n\t\t\t\tforeach ($pages as $possible_page) {\n\t\t\t\t\t$url = implode('/', $this->mojo->uri->rsegments);\n\t\t\t\t\t\n\t\t\t\t\tif ('page/content/' . $possible_page == $url || $possible_page == $default_page) {\n\t\t\t\t\t\t$yo_brother_can_i_access_your_blog = TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Are we on the right page? No? Well leave!\n\t\t\t\tif (!$yo_brother_can_i_access_your_blog) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// I'm glad we got that over with\n\t\treturn TRUE;\n\t}", "function restrict_menus() {\n if (!current_user_can('manage_options') && is_user_logged_in()) {\n $path = get_site_url();\n $screen = get_current_screen();\n $base = $screen->id;\n\n if( 'profile' == $base || 'edit-contact' == $base || 'contact' == $base || 'edit-category' == $base ) {\n // only load these pages\n } else {\n wp_redirect($path.'/wp-admin/edit.php?post_type=contact');\n }\n }\n}", "function can_access($group_id = FALSE, $page = FALSE)\n {\n $count = $this->db\n ->from('group_permission')\n ->where('group_id', $group_id)\n ->where('module_id', '0')\n ->count_all_results();\n if ($count) {\n return TRUE;\n }\n\n // if not allowed to access everything\n // check if allowed to access requested page\n return $this->db\n ->from('module')\n ->join('group_permission', 'group_permission.module_id = module.module_id')\n ->where('group_permission.group_id', $group_id)\n ->where('module.url', $page)\n ->count_all_results();\n }", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->redirect('contao/main.php?act=error');\n\t}", "public function authorize()\n {\n //return false;\n\t\treturn true;\n }", "public function authorize()\n {\n //return false;\n\t\treturn true;\n }", "public function authorize()\n {\n //return false;\n\t\treturn true;\n }", "function failed_access_blocker_adminGate($allow, $page) {\n\t//\tclean out expired attempts\n\t$sql = 'DELETE FROM '.prefix('plugin_storage').' WHERE `type`=\"failed_access\" AND `aux` < \"'.(time()-getOption('failed_access_blocker_timeout')*60).'\"';\n\tquery($sql);\n\t//\tadd this attempt\n\t$sql = 'INSERT INTO '.prefix('plugin_storage').' (`type`, `aux`,`data`) VALUES (\"failed_access\", \"'.time().'\",\"'.getUserIP().'\")';\n\tquery($sql);\n\t//\tcheck how many times this has happened recently\n\t$sql = 'SELECT COUNT(*) FROM '.prefix('plugin_storage'). 'WHERE `type`=\"failed_access\" AND `data`=\"'.getUserIP().'\"';\n\t$result = query($sql);\n\t$count = db_result($result, 0);\n\tif ($count >= getOption('failed_access_blocker_attempt_threshold')) {\n\t\t$block = getOption('failed_access_blocker_forbidden');\n\t\tif ($block) {\n\t\t\t$block = unserialize($block);\n\t\t} else {\n\t\t\t$block = array();\n\t\t}\n\t\t$block[getUserIP()] = time();\n\t\tsetOption('failed_access_blocker_forbidden',serialize($block));\n\t}\n\treturn $allow;\n}", "public function authorize()\n {\n return true; //admin guard\n }", "public function deny()\n {\n ++$this->denied;\n\n $this->result = NODE_ACCESS_DENY;\n\n // Where the actual magic happens please read the README.md file.\n if (!$this->byVote) {\n $this->stopPropagation();\n }\n }", "public function privacy_policy()\n {\n $url = array('url' => current_url());\n\n $this->session->set_userdata($url);\n\n $this->data['privacy'] = $this->home_m->get_data('privacy')->row_array();\n\n\n $body = 'privacy' ;\n\n $this->load_pages($body,$this->data);\n }", "public function authorize() {\n\t\tif (Auth::user()->user_type == \"S\" || Auth::user()->user_type == \"O\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tabort(404);\n\t\t}\n\t}", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "function verify_access($user_access){\n\n switch($user_access){\n case \"ADMIN\":\n break;\n default:\n header('Location:index.php?error=0000000001');\n }\n}", "public function is_allowed_to_set_content_object_rights();", "public static function protect(){\n\t\tif(!(isset($_SESSION[\"user\"]) && isset($_SESSION[\"user\"]['userId']))){\n\t\t\theader(\"location: \".$GLOBALS['web_root']);\n\t\t\texit();\n\t\t}\n\n\t}", "function beforeFilter() {\n\t\t//parent::beforeFilter(); \n\t\t//$this->Auth->allow('*');\n\t\tif( $this->Session->read('Auth.User.status') == 0 ) // status means admin\n\t\t\t$this->redirect( array('controller'=>'pages') );\n\t}", "public function authorize()\n {\n abort_if(Gate::denies('comment_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n return false;\n }", "function chksecurity($page,$type=0,$redirect=0){\n $checkAll\t = false;\n $Secure\t = false;\n $obj_kind\t = $type;\n $operator\t = getUser();\n $otherRight = \"\";\n switch($type){\n\tcase 0://SYSTEM CHECK\n\t\t$objectParam=0;\n\tbreak;\n\tcase 1:// GROUP CHECK\n\t\t$objectParam=get_param(\"group\");\n\tbreak;\n\tcase 2:// SHOP CHECK\n\t\t$objectParam=get_param(\"group\").\";\".get_param(\"shop\");\n\tbreak;\n\tcase 3:// TERMINAL CHECK\n\t\t$objectParam=get_param(\"group\").\";\".get_param(\"shop\").\";\".get_param(\"term\");\n //$otherRight=\"_term\";\n\tbreak;\n\tcase 99: //CHECK IN ALL OPERATOR'S RIGHTS.\n\t\t$checkAll=true;\n\tbreak;\n }\n $pageRight =get_db_value(\"select mask from webpages where name='$page'\");\n if(!$checkAll){\n\t//take Operator's rights.\n\t$operRights=get_db_value(\"select rights$otherRight from obj_rights where op_kind=0 and obj_kind=$obj_kind and operator='$operator' and object='$objectParam;'\");\n\t//take page's security\n\tif (( (abs($pageRight) & abs($operRights)) == abs($pageRight))&& (!($pageRight==\"\")))\n\t\t$Secure=true;\n }//IF ! CHECK ALL\n else{ // -=check all=-\n\t $Secure=(get_db_value(\"select count(*) from obj_rights where operator='$operator' and (rights$otherRight|'$pageRight') = rights$otherRight\" )>0);\n\t }//end else check all\nif ($Secure&&(strlen($pageRight)))\n\treturn true;\nelse\n if ($redirect)\n \t header(\"Location: norights.php\");\n else\n return false;\n\n\n}" ]
[ "0.7619632", "0.7072883", "0.6896645", "0.68458045", "0.67869216", "0.67810124", "0.6758489", "0.6695543", "0.66813356", "0.66748095", "0.6660849", "0.66419417", "0.66035354", "0.6597928", "0.65839565", "0.6561224", "0.6559891", "0.6547126", "0.6542498", "0.654157", "0.65374285", "0.6510251", "0.6503634", "0.6488583", "0.6481371", "0.6481033", "0.6461588", "0.64409184", "0.6408593", "0.639587", "0.63882416", "0.6376586", "0.6367722", "0.6365693", "0.63590765", "0.6345976", "0.6312543", "0.63119256", "0.62939626", "0.6293003", "0.62697554", "0.62571824", "0.6252476", "0.62506735", "0.6249124", "0.62476355", "0.62416345", "0.62395346", "0.62347794", "0.6223548", "0.62130183", "0.62100637", "0.62006515", "0.6175869", "0.61735314", "0.616581", "0.61515886", "0.614226", "0.61223227", "0.6121973", "0.6090235", "0.6089613", "0.60849833", "0.60849833", "0.60841084", "0.60841084", "0.60841084", "0.60828453", "0.60828453", "0.60828453", "0.60805935", "0.60798395", "0.60769314", "0.60737383", "0.60648197", "0.60587317", "0.6045292", "0.6039892", "0.6034163", "0.6022825", "0.6022147", "0.60191447", "0.6017539", "0.6016024", "0.6008946", "0.6007557", "0.60060716", "0.60060716", "0.60060716", "0.6003628", "0.599973", "0.59893143", "0.5988885", "0.5979292", "0.5976822", "0.5975322", "0.59720373", "0.5970474", "0.59683084", "0.5959371", "0.59488744" ]
0.0
-1
The encodings must be accessible in the exact same order than they are specified in the command's parameters, since they are also applied in this order.
public function test_keywordOrder() : void { $subject = <<<'EOT' {showencoded: "text" urlencode: idnencode:} EOT; $command = $this->parseCommand($subject); $this->assertTrue($command->isURLEncoded()); $this->assertTrue($command->isIDNEncoded()); $list = $command->getActiveEncodings(); $this->assertCount(2, $list); $this->assertSame(Mailcode_Commands_Keywords::TYPE_URLENCODE, $list[0]); $this->assertSame(Mailcode_Commands_Keywords::TYPE_IDN_ENCODE, $list[1]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_encoding()\n {\n }", "public function getEncoding();", "function convert_data_encodings($known_utf8 = false)\n{\n global $VALID_ENCODING, $CONVERTED_ENCODING;\n $VALID_ENCODING = true;\n\n if ($CONVERTED_ENCODING) {\n return; // Already done it\n }\n\n if (preg_match('#^[\\x00-\\x7F]*$#', serialize($_POST) . serialize($_GET) . serialize($_FILES)) != 0) { // Simple case, all is ASCII\n $CONVERTED_ENCODING = true;\n return;\n }\n\n require_code('character_sets');\n _convert_data_encodings($known_utf8);\n}", "protected static function resolveDefaultEncoding() {}", "protected function getCharsetConversion() {}", "public static function setCharsetEncoding () {\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::getInstance ();\r\n\t\t}\r\n\t\tself::$instance->exec (\r\n\t\t\t\"SET NAMES 'utf8';\r\n\t\t\tSET character_set_connection=utf8;\r\n\t\t\tSET character_set_client=utf8;\r\n\t\t\tSET character_set_results=utf8\" );\r\n\t}", "abstract protected function _getEncodingTable();", "protected function _getEncodingTable() {}", "protected function _getEncodingTable() {}", "protected function _getEncodingTable() {}", "public function getContentEncoding()\n {\n }", "public function updateAutoEncoding() {}", "public function getEncoding(): string;", "protected function setUpSystemLocaleAndEncodings () {\n\t\tif ($this->responseEncoding === NULL) {\n\t\t\t$this->responseEncoding = $this->response ? $this->response->GetEncoding() : NULL;\n\t\t\t$this->responseEncoding = ($this->responseEncoding === NULL\n\t\t\t\t? $this->defaultEncoding\n\t\t\t\t: strtoupper($this->responseEncoding));\n\t\t}\n\t\t$this->systemEncoding = NULL;\n\t\tif ($this->lang !== NULL && $this->locale !== NULL) {\n\t\t\t$systemEncodings = [];\n\t\t\tforeach ($this->localeCategories as $localeCategory) {\n\t\t\t\t$newRawSystemLocaleValue = \\MvcCore\\Ext\\Tools\\Locale::SetLocale(\n\t\t\t\t\t$localeCategory,\n\t\t\t\t\t$this->langAndLocale . '.' . $this->responseEncoding\n\t\t\t\t);\n\t\t\t\tif ($newRawSystemLocaleValue === FALSE) continue;\n\t\t\t\t$systemParsedLocale = \\MvcCore\\Ext\\Tools\\Locale::GetLocale($localeCategory);\n\t\t\t\tif ($systemParsedLocale !== NULL && $systemParsedLocale->encoding !== NULL)\n\t\t\t\t\t$systemEncodings[] = $systemParsedLocale->encoding;\n\t\t\t}\n\t\t\tif ($systemEncodings && count($systemEncodings) == count($this->localeCategories))\n\t\t\t\t$this->systemEncoding = $systemEncodings[0];\n\t\t}\n\t\t$this->encodingConversion = (\n\t\t\t$this->systemEncoding !== $this->responseEncoding &&\n\t\t\t$this->systemEncoding !== NULL &&\n\t\t\t$this->responseEncoding !== NULL\n\t\t);\n\t}", "public function encoding($encoding);", "public function getContentEncoding();", "public function fixCharsets() {}", "function get_encodings()\r\n {\r\n $rez = array();\r\n $sql = \"SHOW CHARACTER SET\";\r\n $res = @mysql_query($sql);\r\n if(mysql_num_rows($res) > 0)\r\n {\r\n while ($row = mysql_fetch_assoc ($res))\r\n {\r\n $rez[$row[\"Charset\"]] = (\"\" != $row[\"Description\"] ? $row[\"Description\"] : $row[\"Charset\"]); //some MySQL databases return empty Description field\r\n }\r\n }\r\n return $rez;\r\n }", "public function convPOSTCharset() {}", "function setEncoding($encode){\n\t\t$this->encodetext=$encode;\n\t}", "public static function getSupportedEncodings()\n {\n return static::$encodings;\n }", "function Encoding ( $sEncoding=null )\n{\n if ( isset($sEncoding) ) {\n $this->_Encoding = $sEncoding;\n return true;\n } else {\n return $this->_Encoding;\n }\n}", "private function _setUTFEncoder($encoder = 'iconv')\n\t{\n\t\t$this->_encoderFunction = '';\n\t\tif ($encoder == 'iconv') {\n\t\t\t$this->_encoderFunction = function_exists('iconv') ? 'iconv' : 'mb_convert_encoding';\n\n\t\t} elseif ($encoder == 'mb') {\n\n\t\t}\n\t}", "public function getOptions($encoding = 'UTF-8') {}", "public static function content_encoding()\n {\n }", "function mb_list_encodings()\n{\n}", "function GetAnsiEncoding() { return 'windows-1252'; }", "function getDoXmlUtf8Encoding()\n {\n return $this->_props['DoXmlUtf8Encoding'];\n }", "public static function accept_encoding($url, $args)\n {\n }", "function setCharEncoding($sEncoding)\n\t{\n\t\t$this->sEncoding = $sEncoding;\n\t}", "public static function encoding($charset)\n {\n }", "public function passOnEncodingAuto()\n {\n return false;\n }", "public function getEncodings()\n {\n return $this->_encodings;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding(){\n\t\treturn $this->encoding;\n\t}", "public function getEncodings(): array\n {\n if (null !== $this->encodings) {\n return $this->encodings;\n }\n\n return $this->encodings = array_keys(AcceptHeader::fromString($this->header('accept-encoding'))->all());\n }", "protected function checkConnectionCharset() {}", "function utf8_to_iso_8859_1() {\r\n\t\t$result = preg_match('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', $this->code, $encoding_matches);\r\n\t\tif($result) {\r\n\t\t\t$this->code = iconv(\"UTF-8\", \"CP1252\" . \"//TRANSLIT\", $this->code);\r\n\t\t\t$this->code = htmlspecialchars($this->code);\r\n\t\t\t$this->code = htmlentities($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = preg_replace('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"', $this->code);\r\n\t\t}\r\n\t}", "public function getEncoding(object|string $structure): string {\n if (property_exists($structure, 'parameters')) {\n foreach ($structure->parameters as $parameter) {\n if (strtolower($parameter->attribute) == \"charset\") {\n return EncodingAliases::get($parameter->value, $this->fallback_encoding);\n }\n }\n } elseif (property_exists($structure, 'charset')) {\n return EncodingAliases::get($structure->charset, $this->fallback_encoding);\n } elseif (is_string($structure) === true) {\n $result = mb_detect_encoding($structure);\n return $result === false ? $this->fallback_encoding : $result;\n }\n\n return $this->fallback_encoding;\n }", "public function dataEncodingProperty()\n {\n $config = new stubSoapClientConfiguration('http://example.net/', 'urn:foo');\n $this->assertEquals('iso-8859-1', $config->getDataEncoding());\n $this->assertSame($config, $config->setDataEncoding('utf-8'));\n $this->assertEquals('utf-8', $config->getDataEncoding());\n }", "public function init_charset()\n {\n }", "function setDoXmlUtf8Encoding($value)\n {\n $this->_props['DoXmlUtf8Encoding'] = $value;\n }", "public function getCharacterEncoding(): CharacterEncodingInterface;", "function setEncoding($enc) {\n\t\treturn $this->_execute('SET NAMES ' . $enc) != false;\n\t}", "final public function setUTF() {\n mysqli_query($this->resourceId,\"SET NAMES 'utf8'\");\n }", "public function getEncodingFrom()\n {\n return $this->getInputEncoding();\n }", "public function encodeEncodesCorrectlyDataProvider() {}", "function wp_set_internal_encoding()\n {\n }", "function set_encoding($encoding=\"\")\r\n {\r\n if(\"\" == $encoding)\r\n $encoding = $this->encoding;\r\n $sql = \"SET SESSION character_set_database = \" . $encoding; //'character_set_database' MySQL server variable is [also] to parse file with rigth encoding\r\n $res = @mysql_query($sql);\r\n return mysql_error();\r\n }", "function getEncoding(): string\n {\n return $this->getEncodingInfo()['encoding'];\n }", "public function getContentEncoding(): ?string\n {\n }", "function setEncoding($enc) {\n\t\tif (!in_array($enc, array(\"UTF-8\", \"UTF-16\", \"UTF-16le\", \"UTF-16be\"))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_execute(\"PRAGMA encoding = \\\"{$enc}\\\"\") !== false;\n\t}", "public function __construct ($version, $encoding) {}", "private function detect_encoding( $str ) {\r\n }", "public static function getPredefinedEncodingTable($encoding) {}", "private function set_charset() {\n\t\t//regresa bool\n\t\t$this->conn->set_charset(\"utf8\");\n\t}", "public abstract function getCharset();", "public abstract function getContentTransferEncoding();", "public static function change_encoding($data, $input, $output)\n {\n }", "abstract protected function encodingTables();", "public function __construct()\n {\n $this->charset = strtoupper('UTF-8');\n }", "public function set_input_encoding($encoding = \\false)\n {\n }", "function Set_CharacterEncoding($charSet)\r\n\t{\r\n $this->_charEncoding = $charSet;\r\n\t}", "public function testEncoding() {\n $content = utf8_decode(self::ENCODING_CONTENT);\n file_put_contents($this->destination_encoding_file, $content);\n //The first time, the file should be converted, as its content is not utf8 encoded.\n $this->assertTrue(HermesHelper::encodeUTF8($this->destination_encoding_file));\n //The next time, the file should be already converted, and nothing should be done.\n $this->assertFalse(HermesHelper::encodeUTF8($this->destination_encoding_file));\n }", "public function encoding()\n {\n return $this->getEncoding();\n }", "public static function isPredefinedEncoding($encoding) {}", "public function getInputEncoding()\n {\n return $this->input_encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function setEncodings($encodings) {\n $this->properties['encodings'] = $encodings;\n\n return $this;\n }", "function decodeUTF8InputOn()\n\t{\n\t\t$this->bDecodeUTF8Input = true;\n\t}", "public function getOutputCondition($encoding = 'UTF-8') {}", "public function characterSetEncode($charset) {\n if ($this->characterSetEncodeFile && isset($this->element->mimeTypeDetails['charsetUpdatable']) && $this->element->mimeTypeDetails['charsetUpdatable'] && $charset != $this->element->characterSet) {\n $this->element->oldCharacterSet = $this->element->characterSet;\n \n //Set file content to the encoded string of the file\n $this->element->fileContent = mb_convert_encoding(file_get_contents($this->element->path.$this->element->fileName),$this->characterSet,$this->element->oldCharacterSet);\n \n //Add Conversion To Element\n $this->element->fileContentConversions['charset'][] = $charset;\n \n $this->element->characterSet = $this->characterSet; \n } else {\n $this->element->fileContent = file_get_contents($this->element->path.$this->element->fileName);\n }\n }", "abstract public function setUTF();", "public function setAll(array $data, $encoding = 'UTF-8') {}", "protected static function encoding()\n {\n return static::$encoding;\n }", "function setXmlEncoding($value)\n {\n $this->_props['XmlEncoding'] = $value;\n }", "public function setEncoding($encoding) {\n\t\t$this->encoding = is_null($encoding) ? \"ASCII\" : $encoding;\n\t}", "function getDoXmlUtf8Decoding()\n {\n return $this->_props['DoXmlUtf8Decoding'];\n }", "protected function getEncoding(): int\n {\n return $this->encoding;\n }", "public function getEncoding(): string\n {\n return $this->encoding;\n }", "public function getEncoding(): string\n {\n return $this->encoding;\n }", "function pg_set_client_encoding($connection = NULL, $encoding)\n{\n}", "public function acceptsEncoding($encoding = null) {\n if (!isset($encoding))\n return $this->encodings;\n return in_array($encoding, $this->encodings);\n }", "function setEncoding( $encoding )\n\t{\n\t\t$this->encoding\t=\t$encoding;\n\t}", "function options_reading_blog_charset()\n {\n }", "protected function setCharacterSet() {}", "protected function setUtf8Context()\n {\n setlocale(LC_ALL, $locale = 'en_US.UTF-8');\n putenv('LC_ALL=' . $locale);\n }", "function mb_internal_encoding($charset='')\n {\n }", "function _encoding($val)\n{\n\tif ( is_string($val) )\n\t\t$val = iconv('cp1251', 'utf-8', $val);\n\t\n\tif ( is_array($val) )\n\t\tforeach ($val as $k => $v)\n\t\t\t\t$val[$k] = _encoding($v);\n\t\t\t\t\n\treturn $val;\n}", "function setup_is_unicodedb() {\n $rs = $this->db->Execute(\"SELECT parameter, value FROM nls_database_parameters where parameter = 'NLS_CHARACTERSET'\");\n if ($rs && !$rs->EOF) {\n $encoding = $rs->fields['value'];\n if (strtoupper($encoding) == 'AL32UTF8') {\n return true;\n }\n }\n return false;\n }", "function pdo_client_encoding($link=NULL) {\r\n return pdo_query(\"SELECT @@character_set_client AS cs\", pdo_handle($link))->fetchObject()->cs;\r\n }", "public static function handle()\n {\n mb_internal_encoding('UTF-8');\n mb_detect_order([\n 'CP1251', 'CP1252', 'ISO-8859-1', 'UTF-8',\n ]);\n }", "protected function setUtf8Context()\n {\n $locale = 'en_US.UTF-8';\n setlocale(LC_ALL, $locale);\n putenv('LC_ALL=' . $locale);\n }", "public function setCharset($charset)\n {\n parent::setCharset($charset);\n if (isset($this->paramEncoder)) {\n $this->paramEncoder->charsetChanged($charset);\n }\n }", "function _encoding(&$text, $in_charset, $out_charset)\r\n\t{\r\n\t\t// refer to schinese.php for example\r\n\t\t$text =& XoopsLocal::convert_encoding($text, $out_charset, $in_charset);\r\n\t}", "public function getCharset();", "public function getCharset();", "public function getEncoding()\r\n\t{\r\n\t\t//TODO: Parse the raw response header info for content type\r\n\t\t//EXAMPLE OF RETURNED DATA FROM $this->_solrResponse->getRawResponseHeaders()\r\n\t\t/*\r\n\t\t\"HTTP/1.1 200 OK\r\n\t\tContent-Type: text/xml; charset=utf-8\r\n\t\tContent-Length: 764\r\n\t\tServer: Jetty(6.1.3)\r\n\r\n\t\t\"\r\n\t\t*/\r\n\t\treturn 'utf-8';\r\n\t}" ]
[ "0.6302802", "0.62848127", "0.62653583", "0.6216917", "0.6205931", "0.61924034", "0.6186263", "0.617216", "0.617216", "0.6169729", "0.6118754", "0.611461", "0.6073608", "0.6056752", "0.6045394", "0.5933516", "0.5896256", "0.58647335", "0.585733", "0.58248407", "0.57616097", "0.57562125", "0.5751702", "0.57482076", "0.57380456", "0.5735438", "0.55964464", "0.5583341", "0.55616355", "0.55584353", "0.5532925", "0.55319524", "0.5527531", "0.5507273", "0.5500992", "0.550014", "0.54993165", "0.5497886", "0.54911554", "0.5471602", "0.5470288", "0.544603", "0.54356295", "0.5434048", "0.54286087", "0.54259026", "0.5390599", "0.5376719", "0.5374554", "0.5366341", "0.53642166", "0.5355335", "0.5354734", "0.53479934", "0.5343531", "0.5337827", "0.5336075", "0.53302914", "0.5321017", "0.52884823", "0.5287161", "0.52783954", "0.52771926", "0.5277144", "0.526855", "0.5267598", "0.526728", "0.5261975", "0.5261975", "0.5261975", "0.5261975", "0.5260979", "0.5255407", "0.5251243", "0.5240024", "0.5237563", "0.5235426", "0.5234119", "0.5230438", "0.5228548", "0.52191997", "0.5214254", "0.52111435", "0.52111435", "0.52061623", "0.5205348", "0.5196032", "0.51790947", "0.5177579", "0.5168696", "0.5168401", "0.516794", "0.51666874", "0.5162002", "0.5159934", "0.5157321", "0.5157113", "0.51543933", "0.51538056", "0.51538056", "0.51520455" ]
0.0
-1
endregion region: Support methods
private function parseCommand(string $subject) : Mailcode_Commands_Command_ShowEncoded { $command = $this->parseCommandStringValid($subject); $this->assertInstanceOf(Mailcode_Commands_Command_ShowEncoded::class, $command); return $command; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function _i() {\n }", "private function __() {\n }", "public function custom()\n\t{\n\t}", "private function method2()\n\t{\n\t}", "protected function _refine() {\n\n\t}", "final private function __construct() {}", "final private function __construct() {}", "private function method1()\n\t{\n\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "public function ex4()\n {\n }", "public function someStuff()\n {\n \n }", "protected function __init__() { }", "abstract protected function external();", "final private function __construct(){\r\r\n\t}", "public function method() {\n\t}", "private function __construct()\t{}", "private final function __construct() {}", "public function inOriginal();", "protected final function __construct() {}", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "abstract protected function requiredOperations1(): void;", "protected function fixSelf() {}", "protected function fixSelf() {}", "protected abstract function performImpl();", "public function method()\n {\n\n }", "public static function returnInfo() {\n ##\n }", "public static function returnInfo() {\n ##\n }", "abstract protected function safetyCheck() : self;", "private function j() {\n }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct () {}", "private function aFunc()\n {\n }", "abstract protected function _process();", "abstract protected function _process();", "abstract protected function handle();", "private function __construct( )\n {\n\t}", "private static function support()\n {\n require_once static::$root.'Support'.'/'.'FunctionArgs.php';\n }" ]
[ "0.6392347", "0.6260835", "0.62089545", "0.59734416", "0.5953748", "0.59213614", "0.5870459", "0.5870459", "0.5815629", "0.5779484", "0.5779484", "0.5779484", "0.57474643", "0.5724304", "0.57206154", "0.5710351", "0.56842476", "0.5647836", "0.5639234", "0.560744", "0.5595825", "0.5564359", "0.5552362", "0.5552362", "0.5552362", "0.5551414", "0.5540516", "0.5540516", "0.55396414", "0.5538208", "0.551893", "0.551893", "0.5509513", "0.5491623", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.54910314", "0.5490554", "0.5487396", "0.5487396", "0.5483221", "0.54830706", "0.54818165", "0.5476678", "0.5476678", "0.54707295", "0.54646355", "0.5462155" ]
0.0
-1
PHP functions: echoFormFieldHtml, jsStringify, echoSelectTableInputHtml, doSkipField
function doSelectForInput($name) { #global $fields_to_make_selects; $fields_to_make_selects = Config::$config['fields_to_make_selects']; return in_array($name, $fields_to_make_selects ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function returnFieldJS() {}", "function getFormHTML()\n\t{\n\t\tstatic $id_num = 1000;\n\n\t\t$type = $this->type;\n\t\t$name = $this->name;\n\t\t$value = $this->_getTypeValue($this->type, $this->value);\n\t\t$default = $this->_getTypeValue($this->type, $this->default);\n\t\t$column_name = 'extra_vars' . $this->idx;\n\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t$buff = array();\n\t\tswitch($type)\n\t\t{\n\t\t\t// Homepage\n\t\t\tcase 'homepage' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"homepage\" />';\n\t\t\t\tbreak;\n\t\t\t// Email Address\n\t\t\tcase 'email_address' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"email_address\" />';\n\t\t\t\tbreak;\n\t\t\t// Phone Number\n\t\t\tcase 'tel' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[0] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[1] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[2] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\tbreak;\n\t\t\t// textarea\n\t\t\tcase 'textarea' :\n\t\t\t\t$buff[] = '<textarea name=\"' . $column_name . '\" rows=\"8\" cols=\"42\">' . $value . '</textarea>';\n\t\t\t\tbreak;\n\t\t\t// multiple choice\n\t\t\tcase 'checkbox' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] =' <li><input type=\"checkbox\" name=\"' . $column_name . '[]\" id=\"' . $tmp_id . '\" value=\"' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '\" ' . $checked . ' /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// single choice\n\t\t\tcase 'select' :\n\t\t\t\t$buff[] = '<select name=\"' . $column_name . '\" class=\"select\">';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$selected = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$selected = ' selected=\"selected\"';\n\t\t\t\t\t}\n\t\t\t\t\t$buff[] = ' <option value=\"' . $v . '\" ' . $selected . '>' . $v . '</option>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</select>';\n\t\t\t\tbreak;\n\t\t\t// radio\n\t\t\tcase 'radio' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] = '<li><input type=\"radio\" name=\"' . $column_name . '\" id=\"' . $tmp_id . '\" ' . $checked . ' value=\"' . $v . '\" class=\"radio\" /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// date\n\t\t\tcase 'date' :\n\t\t\t\t// datepicker javascript plugin load\n\t\t\t\tContext::loadJavascriptPlugin('ui.datepicker');\n\n\t\t\t\t$buff[] = '<input type=\"hidden\" name=\"' . $column_name . '\" value=\"' . $value . '\" />'; \n\t\t\t\t$buff[] =\t'<input type=\"text\" id=\"date_' . $column_name . '\" value=\"' . zdate($value, 'Y-m-d') . '\" class=\"date\" />';\n\t\t\t\t$buff[] =\t'<input type=\"button\" value=\"' . Context::getLang('cmd_delete') . '\" class=\"btn\" id=\"dateRemover_' . $column_name . '\" />';\n\t\t\t\t$buff[] =\t'<script type=\"text/javascript\">';\n\t\t\t\t$buff[] = '//<![CDATA[';\n\t\t\t\t$buff[] =\t'(function($){';\n\t\t\t\t$buff[] =\t'$(function(){';\n\t\t\t\t$buff[] =\t' var option = { dateFormat: \"yy-mm-dd\", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\\'-100:+10\\', onSelect:function(){';\n\t\t\t\t$buff[] =\t' $(this).prev(\\'input[type=\"hidden\"]\\').val(this.value.replace(/-/g,\"\"))}';\n\t\t\t\t$buff[] =\t' };';\n\t\t\t\t$buff[] =\t' $.extend(option,$.datepicker.regional[\\'' . Context::getLangType() . '\\']);';\n\t\t\t\t$buff[] =\t' $(\"#date_' . $column_name . '\").datepicker(option);';\n\t\t\t\t$buff[] =\t' $(\"#dateRemover_' . $column_name . '\").click(function(){';\n\t\t\t\t$buff[] =\t' $(this).siblings(\"input\").val(\"\");';\n\t\t\t\t$buff[] =\t' return false;';\n\t\t\t\t$buff[] =\t' })';\n\t\t\t\t$buff[] =\t'});';\n\t\t\t\t$buff[] =\t'})(jQuery);';\n\t\t\t\t$buff[] = '//]]>';\n\t\t\t\t$buff[] = '</script>';\n\t\t\t\tbreak;\n\t\t\t// address\n\t\t\tcase \"kr_zip\" :\n\t\t\t\tif(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' ))\n\t\t\t\t{\n\t\t\t\t\t$buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// General text\n\t\t\tdefault :\n\t\t\t\t$buff[] =' <input type=\"text\" name=\"' . $column_name . '\" value=\"' . ($value ? $value : $default) . '\" class=\"text\" />';\n\t\t}\n\t\tif($this->desc)\n\t\t{\n\t\t\t$oModuleController = getController('module');\n\t\t\t$oModuleController->replaceDefinedLangCode($this->desc);\n\t\t\t$buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>';\n\t\t}\n\t\t\n\t\treturn join(PHP_EOL, $buff);\n\t}", "function inputDataToTemplate ($idHtml, $labelHtml, $type, $eventFunction, $projectName,$value,$disabled) {\n\n\tswitch($type){\n\t\tcase \"INPUT\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml:</label>\";\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"$idHtml\\\" id=\\\"$idHtml\\\"\";\n\t\t\techo \"value = \\\"$value\\\"\";\n\t\t\tif ($disabled==\"D\")\n\t\t\techo \"Disabled=\\\"Disabled\\\"\";\n\t\t\techo \" />\";\n\t\t\techo\"<br>\";\n\t\t\tbreak;\n\t\tcase \"SELECT\":\n\t\t\t$idHtmltemp = getOptions($idHtml);\n\t\t\tfor($i=0;$i<count($idHtmltemp);$i++){\n\t\t\t\tif($idHtmltemp[$i]==$value){\n\t\t\t\t\t$j=$i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($idHtml!=\"billinginfo\")\n\t\t\t$j++;\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml :</label>\";\n\t\t\techo \"<select name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" onchange=\\\"$eventFunction\\\">\";\n\t\t\tif (count($idHtmltemp)!= 1){\n\t\t\t\techo \"<option value =\\\"\\\">Please Select</option>\";\n\t\t\t\tfor($i=0;$i<count($idHtmltemp);$i++){\n\t\t\t\t\t$idHtmltemp1=explode(\":\",$idHtmltemp[$i]);\n\t\t\t\t\tif($idHtmltemp1[0]==$value)\n\t\t\t\t\techo \"<option value =\\\"$idHtmltemp[$i]\\\" Selected>$idHtmltemp1[0]</option>\";\n\t\t\t\t\telse\n\t\t\t\t\techo \"<option value =\\\"$idHtmltemp[$i]\\\">$idHtmltemp1[0]</option>\";\n\t\t\t\t}\n\t\t\t\techo \"<option value =\\\"Rejected\\\">Rejected</option>\";\n\t\t\t}\n\t\t\telse\n\t\t\techo \"<option value =\\\"$idHtmltemp[0]\\\">$idHtmltemp[0]</option>\";\n\t\t\techo \"</select><br>\";\n\n\n\t\t\tbreak;\n\t\tcase \"SELECT_ARRAY\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml :</label>\";\n\t\t\techo \"<select name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" onchange=\\\"$eventFunction\\\">\";\n\t\t\techo \"<option value =\\\"\\\">Please Select</option>\";\n\t\t\tfor($i=0;$i<Count($projectName);$i++){\n\t\t\t\tif($projectName[$i]==$value)\n\t\t\t\techo \"<option value =\\\"$projectName[$i]\\\"Selected>$projectName[$i]</option>\";\n\t\t\t\telse\n\t\t\t\techo \"<option value =\\\"$projectName[$i]\\\">$projectName[$i]</option>\";\n\t\t\t}\n\t\t\techo \"</select><br>\";\n\t\t\tbreak;\n\n\t\tcase \"DATE\":\n echo\"<br>\";\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml: (yyyy-mm-dd)</label>\";\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"$idHtml\\\" id=\\\"$idHtml\\\"\";\n\t\t\techo \" value = \\\"$value\\\"\";\n\t\t\tif ($disabled==\"D\")\n\t\t\techo \"Disabled=\\\"Disabled\\\"\";\n\t\t\techo \" />\";\n\t\t\t$idHtmlbtn=\"$idHtml\".\"btn\";\n\t\t\techo \"<button id= \\\"$idHtmlbtn\\\"\";\n\t\t\tif ($disabled==\"D\")\n\t\t\techo \"Disabled=\\\"Disabled\\\"\";\n\t\t\techo \">:::</button>\";\n\t\t\techo \"<script type=\\\"text/javascript\\\">\";\n\t\t\techo \"var cal = Calendar.setup({\";\n\t\t\techo \"onSelect: function(cal) { cal.hide() }\";\n\t\t\techo \"});\";\n\t\t\techo \"cal.manageFields( \\\"$idHtmlbtn\\\",\\\"$idHtml\\\", \\\"%Y-%m-%d\\\");\";\n\t\t\techo \"cal.manageFields( \\\"$idHtmlbtn\\\", \\\"$idHtml\\\",\\\"%Y-%m-%d\\\");\";\n\t\t\techo \"</script>\";\n\t\t\techo\"<br>\";\n\t\t\tbreak;\n\t}\n}", "abstract protected function getInputHtml();", "function getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields,$generatedtype,$module_name,$mode='',$mandatory=0,$typeofdata=\"\")\n{\n\tglobal $log;\n\t$log->debug(\"Entering getOutputHtml() method ...\");\n\tglobal $adb,$log;\n\tglobal $theme;\n\tglobal $mod_strings;\n\tglobal $app_strings;\n\tglobal $current_user;\n\tglobal $noof_group_rows;\n\n\n\t$theme_path=\"themes/\".$theme.\"/\";\n\t$image_path=$theme_path.\"images/\";\n\t//$fieldlabel = from_html($fieldlabel);\n\t$fieldvalue = Array();\n\t$final_arr = Array();\n\t$value = $col_fields[$fieldname];\n\t$custfld = '';\n\t$ui_type[]= $uitype;\n\t$editview_fldname[] = $fieldname;\n\n\tif($generatedtype == 2)\n\t\t$mod_strings[$fieldlabel] = $fieldlabel;\n\tif(!isset($mod_strings[$fieldlabel])) {\n\t\t$mod_strings[$fieldlabel] = $fieldlabel;\n\t}\n\n\tif($uitype == 5)\n\t{\t\n\t\tif($value=='')\n\t\t{\n\t\t\tif($mandatory == 1) {\n\t\t\t\t$disp_value = getNewDisplayDate();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$disp_value = getDisplayDate($value);\n\t\t}\n\t\t$editview_label[] = $mod_strings[$fieldlabel];\t\t\n\t\t$fieldvalue[] = $disp_value;\n\t}\n\telseif($uitype == 15 || $uitype == 16 || $uitype == 111) //uitype 111 added for non editable picklist - ahmed\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t//changed by dingjianting on 2007-10-3 for cache pickListResult\n\t\t$key = \"picklist_array_\".$fieldname;\n\t\t$picklist_array = getSqlCacheData($key);\n\t\tif(!$picklist_array) {\n\t\t\t$pick_query=\"select colvalue from ec_picklist where colname='\".$fieldname.\"' order by sequence asc\";\n\t\t\t$pickListResult = $adb->getList($pick_query);\t\t\t\n\t\t\t$picklist_array = array();\n\t\t\tforeach($pickListResult as $row) {\n\t\t\t\t$picklist_array[] = $row['colvalue'];\n\t\t\t}\n\t\t\t\n\t\t\tsetSqlCacheData($key,$picklist_array);\n\t\t}\n\n\t\t//Mikecrowe fix to correctly default for custom pick lists\n\t\t$options = array();\n\t\t$found = false;\n\t\tforeach($picklist_array as $pickListValue)\n\t\t{\n\t\t\tif($value == $pickListValue)\n\t\t\t{\n\t\t\t\t$chk_val = \"selected\";\t\n\t\t\t\t$found = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\t$chk_val = '';\n\t\t\t}\n\t\t\t$options[] = array($pickListValue=>$chk_val );\t\n\t\t}\n\t\t$fieldvalue [] = $options;\n\t}\n elseif($uitype == '1021'||$uitype == '1022'||$uitype == '1023'){\n $typearr=explode(\"::\",$typeofdata);\n $multifieldid=$typearr[1];\n $editview_label[]=$mod_strings[$fieldlabel];\n $fieldvalue [] =getMultiFieldEditViewValue($multifieldid,$uitype,$col_fields);\n $fieldvalue [] =$multifieldid;\n //print_r($fieldvalue);\n }\n\t// Related other module id ,support new module\n\t/*\n\t\tCREATE TABLE ec_crmentityrel (\n\t\t`module` VARCHAR( 100 ) NOT NULL ,\n\t\t`relmodule` VARCHAR( 100 ) NOT NULL ,\n\t\tUNIQUE (`module` ,`relmodule` )\n\t\t) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci \n\t*/\n\telseif($uitype == 10) {\n\t\t$query = \"SELECT ec_entityname.* FROM ec_crmentityrel inner join ec_entityname on ec_entityname.modulename=ec_crmentityrel.relmodule WHERE ec_crmentityrel.module='\".$module_name.\"' and ec_entityname.entityidfield='\".$fieldname.\"'\";\n\t\t$fldmod_result = $adb->query($query);\n\t\t$rownum = $adb->num_rows($fldmod_result);\n\t\tif($rownum > 0) {\n\t\t\t$rel_modulename = $adb->query_result($fldmod_result,0, 'modulename');\n\t\t\t$rel_tablename = $adb->query_result($fldmod_result,0, 'tablename');\n\t\t\t$rel_entityname = $adb->query_result($fldmod_result,0, 'fieldname');\n\t\t\t$rel_entityid = $adb->query_result($fldmod_result,0, 'entityidfield');\n\t\t}\n\t\tif($value != '')\n\t\t{\n\t\t\t$module_entityname = getEntityNameForTen($rel_tablename,$rel_entityname,$fieldname,$value);\n\t\t}\n\t\telseif(isset($_REQUEST[$fieldname]) && $_REQUEST[$fieldname] != '')\n\t\t{\n\t\t\tif($_REQUEST['module'] == $rel_modulename)\n\t\t\t{\n\t\t\t\t$module_entityname = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = $_REQUEST[$fieldname];\n\t\t\t\t$module_entityname = getEntityNameForTen($rel_tablename,$rel_entityname,$fieldname,$value);\n\t\t\t}\n\n\t\t}\n\t\tif(isset($app_strings[$fieldlabel])) {\n\t\t\t$editview_label[] = $app_strings[$fieldlabel];\n\t\t} elseif(isset($mod_strings[$fieldlabel])) {\n\t\t\t$editview_label[] = $mod_strings[$fieldlabel];\n\t\t} else {\n\t\t\t$editview_label[] = $fieldlabel;\n\t\t}\n\t\t$fieldvalue[] = $module_entityname;\n\t\t$fieldvalue[] = $value;\n\t\t$fieldvalue[] = $rel_entityname;\n\t\t$fieldvalue[] = $rel_modulename;\n\t} // END\n\telseif($uitype == 17)\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue [] = $value;\n\t}\n\telseif($uitype == 85) //added for Skype by Minnie\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue [] = $value;\n\t}\n\telseif($uitype == 86) //added for qq by Minnie\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue [] = $value;\n\t}\n\telseif($uitype == 87) //added for msn by Minnie\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue [] = $value;\n\t}\n\telseif($uitype == 88) //added for trade by Minnie\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue [] = $value;\n\t}\n\telseif($uitype == 89) //added for Yahoo by Minnie\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue [] = $value;\n\t}\n\telseif($uitype == 33)\n\t{\n\t\t$pick_query=\"select colvalue from ec_picklist where colname='\".$fieldname.\"' order by sequence asc\";\n\t\t\t\t$pickListResult = $adb->getList($pick_query);\t\t\t\n\t\t\t\t$picklist_array = array();\n\t\t\t\tforeach($pickListResult as $row) {\n\t\t\t\t\t$picklist_array[] = $row['colvalue'];\n\t\t\t\t}\n\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$mulsel=\"select colvalue from ec_picklist where colname='\".$fieldname.\"' order by sequence asc\";\n\t\t$multiselect_result = $adb->query($mulsel);\n\t\t$noofoptions = $adb->num_rows($multiselect_result);\n\t\t$options = array();\n\t\t$found = false;\n\t\t$valur_arr = explode(' |##| ',$value);\n\t\tfor($j = 0; $j < $noofoptions; $j++)\n\t\t{\n\t\t\t$multiselect_combo = $adb->query_result($multiselect_result,$j,\"colvalue\");\n\t\t\tif(in_array($multiselect_combo,$valur_arr))\n\t\t\t{\n\t\t\t\t$chk_val = \"selected\";\n\t\t\t\t$found = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$chk_val = '';\n\t\t\t}\n\t\t\t$options[] = array($multiselect_combo=>$chk_val );\n\t\t}\n\t\t$fieldvalue [] = $options;\n\t}\n\telseif($uitype == 19 || $uitype == 20)\n\t{\n\t\tif(isset($_REQUEST['body']))\n\t\t{\n\t\t\t$value = ($_REQUEST['body']);\n\t\t}\n\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t//$value = to_html($value);\n\t\t//$value = htmlspecialchars($value, ENT_QUOTES, \"UTF-8\");\n\t\t$fieldvalue [] = $value;\n\t}\n\telseif($uitype == 21 || $uitype == 24)\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue [] = $value;\n\t}\n\telseif($uitype == 22)\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue[] = $value;\n\t}\n\telseif($uitype == 52)\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\tglobal $current_user;\n\t\tif($value != '')\n\t\t{\n\t\t\t$assigned_user_id = $value;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$assigned_user_id = $current_user->id;\n\t\t}\n\t\t$combo_lbl_name = 'assigned_user_id';\n\t\tif($fieldlabel == 'Assigned To')\n\t\t{\n\t\t\t$user_array = get_user_array(FALSE, \"Active\", $assigned_user_id);\n\t\t\t$users_combo = get_select_options_array($user_array, $assigned_user_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$user_array = get_user_array(FALSE, \"Active\", $assigned_user_id);\n\t\t\t$users_combo = get_select_options_array($user_array, $assigned_user_id);\n\t\t}\n\t\t$fieldvalue [] = $users_combo;\n\t}\n\telseif($uitype == 77)\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\tglobal $current_user;\n\t\tif($value != '')\n\t\t{\n\t\t\t$assigned_user_id = $value;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$assigned_user_id = $current_user->id;\n\t\t}\n\t\t\n\t\t$combo_lbl_name = 'assigned_user_id';\t\t\n\t\t$user_array = get_user_array(FALSE, \"Active\", $assigned_user_id);\n\t\t$users_combo = get_select_options_array($user_array, $assigned_user_id);\n\t\t$fieldvalue [] = $users_combo;\n\t}\n\telseif($uitype == 53) \n\t{ \n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\tglobal $current_user;\n\t\tif($value != '' && $value != 0)\n\t\t{\n\t\t\t$assigned_user_id = $value;\n\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$assigned_user_id = $current_user->id;\n\t\t}\n\t\t\n\t\tif($fieldlabel == 'Assigned To')\n\t\t{\n\t\t\t$user_array = get_user_array(FALSE, \"Active\", $assigned_user_id);\n\t\t\t$users_combo = get_select_options_array($user_array, $assigned_user_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$user_array = get_user_array(FALSE, \"Active\", $assigned_user_id);\n\t\t\t$users_combo = get_select_options_array($user_array, $assigned_user_id);\n\t\t}\n\n\t\t$fieldvalue[]=$users_combo; \n\t}\n\telseif($uitype == 1004) //display creator in editview page\n\t{\n\t\tif(isset($mod_strings[$fieldlabel])) {\n\t\t\t$editview_label[] = $mod_strings[$fieldlabel];\n\t\t} else {\n\t\t\t$editview_label[] = $fieldlabel;\n\t\t}\n\t\tif(empty($value)) {\n\t\t\tglobal $current_user;\n\t\t\t$value = $current_user->id;\n\t\t}\n\t\t$fieldvalue[] = getUserName($value);\n\t}\n\telseif($uitype == 1008) //display approvedby in editview page\n\t{\n\t\tif(isset($mod_strings[$fieldlabel])) {\n\t\t\t$editview_label[] = $mod_strings[$fieldlabel];\n\t\t} else {\n\t\t\t$editview_label[] = $fieldlabel;\n\t\t}\n\t\tif(empty($value)) {\n\t\t\tglobal $current_user;\n\t\t\t$value = $current_user->id;\n\t\t}\n\t\t$fieldvalue[] = getUserName($value);\n\t}\n\telseif($uitype == 51 || $uitype == 50 || $uitype == 73)\n\t{\n\t\t$account_name = \"\";\n\t\t/*$convertmode = \"\";\n\t\tif(isset($_REQUEST['convertmode']))\n\t\t{\n\t\t\t$convertmode = $_REQUEST['convertmode'];\n\t\t}\n\t\tif($convertmode != 'update_quote_val' && $convertmode != 'update_so_val')\n\t\t{\n\t\t\tif(isset($_REQUEST['account_id']) && $_REQUEST['account_id'] != '')\n\t\t\t\t$value = $_REQUEST['account_id'];\t\n\t\t}*/\n\t\tif(isset($_REQUEST['account_id']) && $_REQUEST['account_id'] != '')\n\t\t\t\t$value = $_REQUEST['account_id'];\t\n\t\t\n\t\tif($value != '')\n\t\t{\t\t\n\t\t\t$account_name = getAccountName($value);\t\n\t\t}\n\t\t\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue[]=$account_name; \n\t\t$fieldvalue[] = $value; \n\t}\n\telseif($uitype == 54)\n\t{\n\t\t$options =Array();\n\t\tif($value == \"\") {\n\t\t\t$key = \"currentuser_group_\".$current_user->id;\n\t\t\t$currentuser_group = getSqlCacheData($key);\n\t\t\tif(!$currentuser_group) {\n\t\t\t\t$query = \"select ec_groups.groupname from ec_groups left join ec_users2group on ec_users2group.groupid=ec_groups.groupid where ec_users2group.userid='\".$current_user->id.\"' and ec_users2group.groupid!=0\";\n\t\t\t\t$result = $adb->query($query);\n\t\t\t\t$noofrows = $adb->num_rows($result);\n\t\t\t\tif($noofrows > 0) {\n\t\t\t\t\t$currentuser_group = $adb->query_result($result,0,\"groupname\");\n\t\t\t\t}\n\t\t\t\tsetSqlCacheData($key,$currentuser_group);\n\t\t\t}\n\t\t\t$value = $currentuser_group;\n\t\t}\n\t\t$key = \"picklist_array_group\";\n\t\t$picklist_array = getSqlCacheData($key);\n\t\tif(!$picklist_array) {\t\t\t\n\t\t\t$pick_query=\"select * from ec_groups order by groupid\";\n\t\t\t$pickListResult = $adb->getList($pick_query);\t\t\t\n\t\t\t$picklist_array = array();\n\t\t\tforeach($pickListResult as $row) {\n\t\t\t\t$picklist_array[] = $row[\"groupname\"];\n\t\t\t}\t\t\t\n\t\t\tsetSqlCacheData($key,$picklist_array);\n\t\t}\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\tforeach($picklist_array as $pickListValue)\n\t\t{\n\t\t\tif($value == $pickListValue)\n\t\t\t{\n\t\t\t\t$chk_val = \"selected\";\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\t$chk_val = '';\t\n\t\t\t}\n\t\t\t$options[] = array($pickListValue => $chk_val );\n\t\t}\n\t\t$fieldvalue[] = $options;\n\n\t}\n\telseif($uitype == 59)\n\t{\n\t\t\n\t\tif($value != '')\n\t\t{\t\t\n\t\t\t$product_name = getProductName($value);\t\n\t\t}\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue[]=$product_name;\n\t\t$fieldvalue[]=$value;\n\t}\n\telseif($uitype == 64)\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']);\n\t\t$fieldvalue[] = $value;\n\t}\n\telseif($uitype == 56)\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue[] = $value;\t\n\t}\n\telseif($uitype == 57)\n\t{\n $accountid=$col_fields['account_id'];\n if(empty($accountid)){\n $convertmode = \"\";\n if(isset($_REQUEST['convertmode']))\n {\n $convertmode = $_REQUEST['convertmode'];\n }\n if($convertmode != 'update_quote_val' && $convertmode != 'update_so_val')\n {\n if(isset($_REQUEST['account_id']) && $_REQUEST['account_id'] != '')\n $accountid = $_REQUEST['account_id'];\t\n }\n }\n\t\t$contact_name = '';\t\n//\t\tif(trim($value) != '')\n//\t\t{\n//\t\t\t$contact_name = getContactName($value);\n//\t\t}\n//\t\telseif(isset($_REQUEST['contact_id']) && $_REQUEST['contact_id'] != '')\n//\t\t{\n//\t\t\tif(isset($_REQUEST['module']) && $_REQUEST['module'] == 'Contacts' && $fieldname = 'contact_id')\n//\t\t\t{\n//\t\t\t\t$contact_name = '';\t\n//\t\t\t}\n//\t\t\telse\n//\t\t\t{\n//\t\t\t\t$value = $_REQUEST['contact_id'];\n//\t\t\t\t$contact_name = getContactName($value);\t\t\n//\t\t\t}\n//\n//\t\t}\n if(trim($value) == ''){\n if(isset($_REQUEST['module']) && $_REQUEST['module'] == 'Contacts' && $fieldname = 'contact_id'){\n \n }else{\n $value = $_REQUEST['contact_id'];\n }\n }\n $contactopts=getContactOptions($accountid,$value);\n\n\t\t//Checking for contacts duplicate\n\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n//\t\t$fieldvalue[] = $contact_name;\n $fieldvalue[] = $contactopts;\n\t\t$fieldvalue[] = $value;\n\t}\n\telseif($uitype == 76)\n\t{\n\t\tif($value != '')\n\t\t{\n\t\t\t$potential_name = getPotentialName($value);\n\t\t}\n\t\telseif(isset($_REQUEST['potential_id']) && $_REQUEST['potential_id'] != '')\n\t\t{\n\t\t\t$value = $_REQUEST['potental_id'];\n\t\t\t$potential_name = getPotentialName($value);\n\t\t}\t\n\t\telseif(isset($_REQUEST['potentialid']) && $_REQUEST['potentialid'] != '')\n\t\t{\n\t\t\t$value = $_REQUEST['potentalid'];\n\t\t\t$potential_name = getPotentialName($value);\n\t\t}\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue[] = $potential_name;\n\t\t$fieldvalue[] = $value;\n\t}\n\n\telseif($uitype == 80)\n\t{\n\t\tif($value != '')\n\t\t{\n\t\t\t$salesorder_name = getSoName($value);\n\t\t}\n\t\telseif(isset($_REQUEST['salesorder_id']) && $_REQUEST['salesorder_id'] != '')\n\t\t{\n\t\t\t$value = $_REQUEST['salesorder_id'];\n\t\t\t$salesorder_name = getSoName($value);\n\t\t}\t\t \t\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n\t\t$fieldvalue[] = $salesorder_name;\n\t\t$fieldvalue[] = $value;\n\t}\n\telseif($uitype == 101)\n\t{\n\t\t$editview_label[]=$mod_strings[$fieldlabel];\n $fieldvalue[] = getUserName($value);\n $fieldvalue[] = $value;\n\t}\n\telse\n\t{\n\t\t$editview_label[] = $mod_strings[$fieldlabel];\n\t\t$fieldvalue[] = $value;\n\t}\n\t$final_arr[]=$ui_type;\n\t$final_arr[]=$editview_label;\n\t$final_arr[]=$editview_fldname;\n\t$final_arr[]=$fieldvalue;\n\t$log->debug(\"Exiting getOutputHtml method ...\");\n\treturn $final_arr;\n}", "static function GetFields($data,&$fields,&$js) { return \"\"; }", "function getAsField_html( &$aFields, &$aAsFields, $table )\r\n\t{\r\n\t\t$element \t=& $this->getElement();\r\n\t\t$params \t= $this->getParams();\r\n\r\n\t\t$db =& JFactory::getDBO();\r\n\t\t$fullElName = $table . \"___\" . $element->name;\r\n\t\t\r\n\t\t\r\n\t\t//check if main database is the same as the elements database\r\n\t\tif ($db == $this->getDb()) {\r\n\t\t\t//it is so continue as if it were a database join\r\n\t\t\t//make sure same connection as this table\r\n\t\t\t\r\n\t\t\t$join =& $this->getJoin();\r\n\t\t\t$k = \"`$join->keytable`.`$element->name`\";\r\n\t\t\tFabrikString::safeColName($k);\r\n\t\t\t$k2 = $this->getJoinLabelColumn();\r\n\t\t\tFabrikString::safeColName($k2);\r\n\r\n\t\t\t$aFields[]\t\t\t\t= \"$k AS `$fullElName\" . \"_raw`\" ;\r\n\t\t\t$aAsFields[]\t\t\t= \"`$fullElName\". \"_raw`\";\r\n\t\t\t$aFields[] \t\t\t\t= \"$k2 AS `$fullElName`\" ;\r\n\t\t\t$aAsFields[] \t\t\t= \"`$fullElName`\";\r\n\t\t} else {\r\n\t\t\t$k \t\t\t\t= \"`$table`.`$element->name`\";\r\n\t\t\tFabrikString::safeColName($k);\r\n\t\t\t//its not so revert back to selecting the id\r\n\t\t\t$aFields[]\t\t\t\t= \"$k AS `$fullElName\" . \"_raw`\" ;\r\n\t\t\t$aAsFields[]\t\t\t= \"`$fullElName\". \"_raw`\";\r\n\t\t\t$aFields[]\t\t\t\t= \"$k AS `$fullElName`\" ;\r\n\t\t\t$aAsFields[]\t\t\t= \"`$fullElName`\";\r\n\t\t}\r\n\t}", "function MakeSelectField($name,$values,$valuenames,$selected=\"\",$disableds=array(),$titles=array(),$title=\"\",$maxlen=0,$noincludedisableds=FALSE,$multiple=FALSE,$onchange=NULL,$options=array())\n{\n return\n $this->Htmls_Select\n (\n $name,$values,$valuenames,$selected,\n array\n (\n \"Disableds\" => $disableds,\n \"Titles\" => $titles,\n \"Title\" => $title,\n \"MaxLen\" => $maxlen,\n \"ExcludeDisableds\" => $noincludedisableds,\n \"Multiple\" => $multiple,\n \"OnChange\" => $onchange,\n ),\n $options\n );\n \n /* $selectedok=FALSE; */\n\n /* $options[ \"NAME\" ]=$name; */\n /* if (!empty($onchange)) { $options[ \"ONCHANGE\" ]=$onchange; } */\n /* if (!empty($title)) { $options[ \"TITLE\" ]=$title; } */\n /* if ($multiple) { $options[ \"MULTIPLE\" ]=\"\"; } */\n\n /* $select=\"\"; */\n /* foreach ($values as $n => $value) */\n /* { */\n /* $valuename=$valuenames[$n]; */\n /* $selectopt=array(); */\n /* if ( */\n /* count($values)==1 */\n /* || */\n /* $this->TestIfSelected($value,$values,$n,$selected) */\n /* ) */\n /* { */\n /* $selectopt[ \"SELECTED\" ]=\"\"; */\n /* $selectedok=TRUE; */\n /* } */\n\n /* $class=\"\"; */\n /* $disabled=FALSE; */\n /* if ( */\n /* !empty($disableds[$n]) */\n /* || */\n /* preg_match('/^disabled$/',$values[$n])) */\n /* { */\n /* $selectopt[ \"DISABLED\" ]=\"\"; */\n /* $values[ $n]=\"\"; */\n /* $class=\"disabled\"; */\n /* $disabled=TRUE; */\n /* } */\n\n /* if (isset($titles[ $n ])) { $selectopt[ \"TITLE\" ]=$titles[ $n ]; } */\n\n /* $valuename=html_entity_decode($valuename,ENT_QUOTES,\"UTF-8\"); */\n /* if ($maxlen>0 && strlen($valuename)>$maxlen) */\n /* { */\n /* $valuename=substr($valuename,0,$maxlen); */\n /* } */\n\n /* if (!$noincludedisableds || !$disabled) */\n /* { */\n /* if (!empty($class)) */\n /* { */\n /* $selectopt[ \"CLASS\" ]=$class; */\n /* } */\n\n /* $selectopt[ \"VALUE\" ]=$values[$n]; */\n /* $select.= */\n /* \" \". */\n /* $this->HtmlTags */\n /* ( */\n /* \"OPTION\", */\n /* $valuename, */\n /* $selectopt */\n /* ).\"\\n\"; */\n\n /* if ($this->Debug>=2) */\n /* { */\n /* $select.=\" [\".$values[$n].\"]\\n\"; */\n /* } */\n /* } */\n /* } */\n\n /* $select=$this->HtmlTags(\"SELECT\",\"\\n\".$select,$options).\"\\n\"; */\n\n /* if (!$selectedok && !empty($selected) && !is_array($selected)) */\n /* { */\n /* $this->AddMsg(\"Warning MakeSelectField: $name, Value: '$selected' undefined\"); */\n /* } */\n\n /* return \"\\n\".$select; */\n}", "function show_search_form($sosl_search){\r\n\r\n\r\nprint \"<script>\\n\";\r\n\r\nprint <<<SEARCH_BUILDER_SCRIPT\r\n\r\nfunction toggleFieldDisabled(){\r\n\tif(document.getElementById('SB_searchString').value){\r\n\t\tdocument.getElementById('SB_limit').disabled = false;\r\n\t\tdocument.getElementById('SB_fieldTypeSelect').disabled = false;\r\n\t\tdocument.getElementById('SB_objSelect1').disabled = false;\r\n\t\tdocument.getElementById('SB_objDetail1').disabled = false;\r\n\t} else {\r\n\t\tdocument.getElementById('SB_limit').disabled = true;\r\n\t\tdocument.getElementById('SB_fieldTypeSelect').disabled = true;\r\n\t\tdocument.getElementById('SB_objSelect1').disabled = true;\r\n\t\tdocument.getElementById('SB_objDetail1').disabled = true;\r\n\t}\r\n\t\r\n\tif(!document.getElementById('SB_objSelect1').value || document.getElementById('SB_objSelect1').disabled){\r\n\t\tdocument.getElementById('SB_objDetail1').disabled = true;\r\n\t\tdocument.getElementById('SB_objSelect2').disabled = true;\r\n\t\tdocument.getElementById('SB_objDetail2').disabled = true;\r\n\t} else {\r\n\t\tdocument.getElementById('SB_objDetail1').disabled = false;\r\n\t\tdocument.getElementById('SB_objSelect2').disabled = false;\r\n\t\tdocument.getElementById('SB_objDetail2').disabled = false;\r\n\t}\r\n\r\n\tif(!document.getElementById('SB_objSelect2').value || document.getElementById('SB_objSelect2').disabled){\r\n\t\tdocument.getElementById('SB_objDetail2').disabled = true;\r\n\t\tdocument.getElementById('SB_objSelect3').disabled = true;\r\n\t\tdocument.getElementById('SB_objDetail3').disabled = true;\r\n\t} else {\r\n\t\tdocument.getElementById('SB_objDetail2').disabled = false;\r\n\t\tdocument.getElementById('SB_objSelect3').disabled = false;\r\n\t\tdocument.getElementById('SB_objDetail3').disabled = false;\r\n\t}\r\n\t\r\n\tif(!document.getElementById('SB_objSelect3').value || document.getElementById('SB_objSelect3').disabled){\r\n\t\tdocument.getElementById('SB_objDetail3').disabled = true;\r\n\t} else {\r\n\t\tdocument.getElementById('SB_objDetail3').disabled = false;\r\n\t}\r\n}\r\n\r\n//function updateObject(){\r\n// document.search_form.justUpdate.value = 1;\r\n// document.search_form.submit();\r\n//}\r\n\r\nfunction build_search(){\r\n\ttoggleFieldDisabled();\r\n\t\r\n\tvar searchString = 'FIND {' + document.getElementById('SB_searchString').value + '}';\r\n\t\r\n\tvar fieldTypeSelect = '';\r\n\tif(document.getElementById('SB_fieldTypeSelect').value && !document.getElementById('SB_fieldTypeSelect').disabled){\r\n\t\tfieldTypeSelect = ' IN ' + document.getElementById('SB_fieldTypeSelect').value;\r\n\t}\r\n\t\r\n\tvar objSelect1 = '';\r\n\tif(document.getElementById('SB_objSelect1').value && !document.getElementById('SB_objSelect1').disabled){\r\n\t\tobjSelect1 = ' RETURNING ' + document.getElementById('SB_objSelect1').value;\r\n\r\n\t\tif(document.getElementById('SB_objDetail1').value && !document.getElementById('SB_objDetail1').disabled){\r\n\t\t\tobjSelect1 += '(' + document.getElementById('SB_objDetail1').value + ')';\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar objSelect2 = '';\r\n\tif(document.getElementById('SB_objSelect2').value && !document.getElementById('SB_objSelect2').disabled){\r\n\t\tobjSelect2 = ', ' + document.getElementById('SB_objSelect2').value;\r\n\r\n\t\tif(document.getElementById('SB_objDetail2').value && !document.getElementById('SB_objDetail2').disabled){\r\n\t\t\tobjSelect2 += '(' + document.getElementById('SB_objDetail2').value + ')';\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar objSelect3 = '';\r\n\tif(document.getElementById('SB_objSelect3').value && !document.getElementById('SB_objSelect3').disabled){\r\n\t\tobjSelect3 = ', ' + document.getElementById('SB_objSelect3').value;\r\n\r\n\t\tif(document.getElementById('SB_objDetail3').value && !document.getElementById('SB_objDetail3').disabled){\r\n\t\t\tobjSelect3 += '(' + document.getElementById('SB_objDetail3').value + ')';\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar limit = '';\r\n\tif(document.getElementById('SB_limit').value && !document.getElementById('SB_limit').disabled){\r\n\t\tlimit = ' LIMIT ' + document.getElementById('SB_limit').value;\r\n\t}\r\n\r\n\r\n\tif (searchString)\r\n\t\tdocument.getElementById('sosl_search_textarea').value = searchString + fieldTypeSelect + objSelect1 + objSelect2 + objSelect3 + limit;\r\n\r\n}\r\n</script>\r\nSEARCH_BUILDER_SCRIPT;\r\n\r\n\tif($_SESSION['config']['autoJumpToSearchResults']){\r\n\t\tprint \"<form method='POST' name='search_form' action='$_SERVER[PHP_SELF]#sr'>\\n\";\r\n\t} else {\r\n\t\tprint \"<form method='POST' name='search_form' action='$_SERVER[PHP_SELF]#sr'>\\n\";\r\n\t}\r\n\t\r\n\tprint \"<p><strong>Enter a search string and optionally select the objects and fields to return to build a SOSL search below:</strong></p>\\n\";\r\n\tprint \"<table border='0' width=1>\\n<tr>\\n\";\r\n \r\n print \"<td>Search for </td><td><input type='text' id='SB_searchString' name='SB_searchString' value=\\\"\" . htmlspecialchars($_SESSION['SB_searchString'],ENT_QUOTES,'UTF-8') . \"\\\" size='37' onKeyUp='build_search();' /> in \";\r\n \r\n\t$fieldTypeSelectOptions = array(\r\n\t\t'ALL FIELDS' => 'All Fields',\r\n\t\t'NAME FIELDS' => 'Name Fields',\r\n\t\t'PHONE FIELDS' => 'Phone Fields',\r\n\t\t'EMAIL FIELDS' => 'Email Fields'\t\t\t\r\n\t);\r\n\tprint \"<select id='SB_fieldTypeSelect' name='SB_fieldTypeSelect' onChange='build_search();'>\\n\";\r\n\tforeach ($fieldTypeSelectOptions as $op_key => $op){\r\n\t\tprint \"<option value='$op_key'\";\r\n\t\tif (isset($_SESSION['SB_fieldTypeSelect']) && $op_key == $_SESSION['SB_fieldTypeSelect']) print \" selected='selected' \";\r\n\t\tprint \">$op</option>\";\r\n\t}\r\n\tprint \"</select>\";\r\n\r\n print \" limited to <input id='SB_limit' name='SB_limit' type='text' value='\" . htmlspecialchars($_SESSION['SB_limit'],ENT_QUOTES,'UTF-8') . \"' size='5' onKeyUp='build_search();' /> maximum records</td></tr>\\n\";\r\n\r\n\tprint \"<tr><td colspan='2'></td></tr>\";\r\n\tprint \"<tr><td>returning object </td><td NOWRAP>\";\r\n\tmyGlobalSelect($_SESSION['SB_objSelect1'],'SB_objSelect1',20,\"onChange='build_search();'\");\r\n\tprint \" including fields <input id='SB_objDetail1' name='SB_objDetail1' type='text' value=\\\"\" . htmlspecialchars($_SESSION['SB_objDetail1'],ENT_QUOTES,'UTF-8') . \"\\\" size='40' onKeyUp='build_search();' />\";\r\n\t\tprint \"&nbsp;<img onmouseover=\\\"Tip('List the API names of the fields to be returned; otherwise, only the Id is returned. Optionally include WHERE and LIMIT statements to futher filter search results.')\\\" align='absmiddle' src='images/help16.png'/>\";\r\n\t\tprint \"</td></tr>\";\r\n\tprint \"<tr><td colspan='2'></td></tr>\";\r\n\tprint \"<tr><td>and object </td><td NOWRAP>\";\r\n\tmyGlobalSelect($_SESSION['SB_objSelect2'],'SB_objSelect2',20,\"onChange='build_search();'\");\r\n\tprint \" including fields <input id='SB_objDetail2' name='SB_objDetail2' type='text' value=\\\"\" . htmlspecialchars($_SESSION['SB_objDetail2'],ENT_QUOTES,'UTF-8') . \"\\\" size='40' onKeyUp='build_search();' /></td></tr>\";\r\n\t\r\n\tprint \"<tr><td colspan='2'></td></tr>\";\r\n\tprint \"<tr><td>and object </td><td NOWRAP>\";\r\n\tmyGlobalSelect($_SESSION['SB_objSelect3'],'SB_objSelect3',20,\"onChange='build_search();'\");\r\n\tprint \" including fields <input id='SB_objDetail3' name='SB_objDetail3' type='text' value=\\\"\" . htmlspecialchars($_SESSION['SB_objDetail3'],ENT_QUOTES,'UTF-8') . \"\\\" size='40' onKeyUp='build_search();' /></td></tr>\";\r\n\r\n\tprint \"<tr><td valign='top' colspan='3'><br/>Enter or modify a SOSL search below:\" .\r\n\t\t\t\"<br/><textarea id='sosl_search_textarea' type='text' name='sosl_search' cols='100' rows='4' style='overflow: auto; font-family: monospace, courier;'>\". htmlspecialchars($sosl_search,ENT_QUOTES,'UTF-8') . \"</textarea>\" .\r\n\t\t \"</td></tr>\";\r\n\r\n\r\n\tprint \"<tr><td colspan=3><input type='submit' name='searchSubmit' value='Search' />\";\r\n\tprint \"<input type='reset' value='Reset' />\";\r\n\tprint \"</td></tr></table><p/></form>\\n\";\r\n}", "function inputDashboardTemplate ($idHtml, $labelHtml, $type, $eventFunction, $projectName) {\n\tswitch($type){\n\t\tcase \"INPUT\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml:</label>\";\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" />\";\n\t\t\techo\"<br>\";\n\t\t\tbreak;\n\t\tcase \"SELECT\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml :</label>\";\n\t\t\techo \"<select name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" onchange=\\\"$eventFunction\\\">\";\n\t\t\t$idHtmltemp= getOptions($idHtml);\n\n\t\t\techo \"<option value =\\\"\\\">Please Select</option>\";\n\t\t\tfor($i=0;$i<Count($idHtmltemp);$i++){\n\t\t\t\tif(strstr($idHtmltemp[$i],\":\")){\n\t\t\t\t\t$idHtmltemp1=explode(\":\",$idHtmltemp[$i]);\n\t\t\t\t\techo \"<option value =\\\"$idHtmltemp[$i]\\\">$idHtmltemp1[0]</option>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\techo \"<option value =\\\"$idHtmltemp[$i]\\\">$idHtmltemp[$i]</option>\";\n\t\t\t}\n\t\t\techo \"<option value =\\\"Rejected\\\">Rejected</option>\";\n\t\t\techo \"</select><br>\";\n\t\t\tbreak;\n\t\tcase \"SELECT_ARRAY\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml :</label>\";\n\t\t\techo \"<select name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" onchange=\\\"$eventFunction\\\">\";\n\t\t\techo \"<option value =\\\"\\\">Please Select</option>\";\n\t\t\tfor($i=0;$i<Count($projectName);$i++){\n\t\t\t\techo \"<option value =\\\"$projectName[$i]\\\">$projectName[$i]</option>\";\n\t\t\t}\n\t\t\techo \"</select><br>\";\n\t\t\tbreak;\n\t\tcase \"DATE\":\n\t\t\techo\"<br>\";\n echo \"<label for=\\\"$idHtml\\\">$labelHtml: (yyyy-mm-dd)</label>\";\n echo \"<input type=\\\"text\\\" name=\\\"$idHtml\\\" id=\\\"$idHtml\\\"\";\n echo \" value = \\\"$value\\\"\";\n if ($disabled==\"D\")\n echo \"Disabled=\\\"Disabled\\\"\";\n echo \" />\";\n $idHtmlbtn=\"$idHtml\".\"btn\";\n echo \"<button id= \\\"$idHtmlbtn\\\"\";\n if ($disabled==\"D\")\n echo \"Disabled=\\\"Disabled\\\"\";\n echo \">:::</button>\";\n echo \"<script type=\\\"text/javascript\\\">\";\n echo \"var cal = Calendar.setup({\";\n echo \"onSelect: function(cal) { cal.hide() }\";\n echo \"});\";\n echo \"cal.manageFields( \\\"$idHtmlbtn\\\",\\\"$idHtml\\\", \\\"%Y-%m-%d\\\");\";\n echo \"cal.manageFields( \\\"$idHtmlbtn\\\", \\\"$idHtml\\\",\\\"%Y-%m-%d\\\");\";\n echo \"</script>\";\n echo\"<br>\";\n break;\n\t}\n}", "protected function tableBodyHTML()\r\n\t{\r\n\t\tglobal $wpdb;\r\n\t\tglobal $WPGMZA_TABLE_NAME_CUSTOM_FIELDS;\r\n\t\t\r\n\t\t$fields = $wpdb->get_results(\"SELECT * FROM $WPGMZA_TABLE_NAME_CUSTOM_FIELDS\");\r\n\t\t\r\n\t\tforeach($fields as $obj)\r\n\t\t{\r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<input readonly name=\"ids[]\" value=\"<?php echo $obj->id; ?>\"/>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<input name=\"names[]\" value=\"<?php echo addslashes($obj->name); ?>\"/>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<input class=\"wpgmza-fontawesome-iconpicker\" name=\"icons[]\" value=\"<?php echo $obj->icon; ?>\"/>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->attributeTableHTML($obj);\r\n\t\t\t\t\t\r\n\t\t\t\t\t?>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t$options = array(\r\n\t\t\t\t\t\t'none'\t\t\t=> 'None',\r\n\t\t\t\t\t\t'text'\t\t\t=> 'Text',\r\n\t\t\t\t\t\t'dropdown'\t\t=> 'Dropdown',\r\n\t\t\t\t\t\t'checkboxes'\t=> 'Checkboxes'\r\n\t\t\t\t\t);\r\n\t\t\t\t\t?>\r\n\t\t\t\t\r\n\t\t\t\t\t<select name=\"widget_types[]\">\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\tforeach($options as $value => $text)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<option value=\"<?php echo $value; ?>\"\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\tif($obj->widget_type == $value)\r\n\t\t\t\t\t\t\t\techo ' selected=\"selected\"';\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<?php echo __($text, 'wp-google-maps'); ?>\r\n\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Use this filter to add options to the dropdown\r\n\t\t\t\t\t\t$custom_options = apply_filters('wpgmza_custom_fields_widget_type_options', $obj);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(is_string($custom_options))\r\n\t\t\t\t\t\t\techo $custom_options;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t</select>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<button type='button' class='button wpgmza-delete-custom-field'><i class='fa fa-trash-o' aria-hidden='true'></i></button>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t<?php\r\n\t\t}\r\n\t}", "function _generateSelection()\n {\n $i = 0;\n foreach ($_POST as $key=>$value) {\n echo \"<input type='hidden' name=$key value=$value required>\";\n echo \"<div class='form-group'>\";\n if (isset($value) && $this->\n _childexists($value, $this->_getRubriekFromDb())) {\n echo $this->_generateRubriekVerkoopList($value, $this->_getRubriekFromDb(), \"subrubriek\" . $i);\n echo \"<script type='text/javascript'>\n document.getElementById('$key').disabled = true;\n </script>\";\n }\n echo \"</div>\";\n echo \"<script type='text/javascript'>\n document.getElementById('$key').value= $value \n </script>\";\n $i++;\n }\n }", "public static function GetJSFunctionsForFields()\n\t{\n\t\treturn '';\n\t}", "function returnFieldJS() {\r\n\t // field 'price' has type 'text' and will not be touched by this function (but why???). We only return the value\r\n\t\treturn '\r\n\t\t\treturn value;\r\n\t\t';\r\n\t}", "function ConvertToHTML($field){\r\n\t\t\t//input label\r\n\t\t\t$buffer = \"<p class=\\\"FormField\\\"><label><span>{$field['label']}</span></label>\";\r\n\t\t\tswitch($field[\"type\"]){\r\n\t\t\t\tcase \"text\":\r\n\t\t\t\t\t//input details\r\n\t\t\t\t\t$buffer .= \"<input type=\\\"{$field['type']}\\\" value=\\\"{$field['value']}\\\" maxlength=\\\"{$field['maxlength']}\\\" name=\\\"{$field['name']}\\\" class=\\\"{$field['class']}\\\" id=\\\"{$field['id']}\\\"\";\r\n\t\t\t\t\t\t//optional attributes\r\n\t\t\t\t\t\t//disabled\r\n\t\t\t\t\t\tif($field['disabled'] != null){\r\n\t\t\t\t\t\t\t$buffer .= \" disabled=\\\"disabled\\\"\";\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t//close input tag\r\n\t\t\t\t\t$buffer .= \" />\";\t\t\t\t\t\t\r\n\t\t\t\t\t//close <p>\r\n\t\t\t\t\t$buffer .= \"</p>\";\r\n\t\t\t\t\treturn $buffer;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"textarea\":\r\n\t\t\t\t\t//input details\r\n\t\t\t\t\t$buffer .= \"<textarea name=\\\"{$field['name']}\\\" class=\\\"{$field['class']}\\\" id=\\\"{$field['id']}\\\"\";\r\n\t\t\t\t\t\t//optional attributes\r\n\t\t\t\t\t\t\t//rows\r\n\t\t\t\t\t\t\tif($field['rows'] != null){\r\n\t\t\t\t\t\t\t\t$buffer .= \" rows=\\\"{$field['rows']}\\\"\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//cols\r\n\t\t\t\t\t\t\tif($field['cols'] != null){\r\n\t\t\t\t\t\t\t\t$buffer .= \" cols=\\\"{$field['cols']} \\\"\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//disabled\r\n\t\t\t\t\t\t\tif($field['disabled'] != null){\r\n\t\t\t\t\t\t\t\t$buffer .= \" disabled=\\\"disabled\\\"\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t//close textarea\r\n\t\t\t\t\t$buffer .= \" >\";\r\n\t\t\t\t\t//input value [optional]\r\n\t\t\t\t\tif($field['value'] != null){\r\n\t\t\t\t\t\t$buffer .= $field['value'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//close\r\n\t\t\t\t\t$buffer .= \"</textarea>\";\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn $buffer;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"radio\":\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"select\":\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"submit\":\r\n\t\t\t\t\r\n\t\t\t\t\tif($field['label'] != null){\r\n\t\t\t\t\t\t$buffer = \"<p class=\\\"FormField_Submit\\\"><label><span>{$field['label']}</span></label>\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$buffer = \"<p class=\\\"FormField_Submit\\\"><label><span></span></label>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//input details\r\n\t\t\t\t\t$buffer .= \"<input type=\\\"{$field['type']}\\\" value=\\\"{$field['value']}\\\" name=\\\"{$field['name']}\\\" class=\\\"{$field['class']}\\\" id=\\\"{$field['id']}\\\"\";\r\n\t\t\t\t\t\t//optional attributes\r\n\t\t\t\t\t\t//disabled\r\n\t\t\t\t\t\tif($field['disabled'] != null){\r\n\t\t\t\t\t\t\t$buffer .= \" disabled=\\\"disabled\\\"\";\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t//close input tag\r\n\t\t\t\t\t$buffer .= \" />\";\t\t\t\t\t\t\r\n\t\t\t\t\t//close <p>\r\n\t\t\t\t\t$buffer .= \"</p>\";\r\n\t\t\t\t\treturn $buffer;\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\t\t\t\t \r\n\t\t\t}\r\n\t\t}", "function printTextInput($isPro,$options, $label, $id, $description, $type = 'text', $url='', $showSave = false) {\r\n if (empty($options[$id])) {\r\n $options[$id] = '';\r\n }\r\n \r\n $offset = '';\r\n if (ai_startsWith($label, 'i-')) {\r\n $offset = 'class=\"'.substr($label,0, 5).'\" ';\r\n $label = substr($label, 5);\r\n }\r\n if (!isset($options['demo']) || $options['demo'] == 'false') {\r\n $isPro = false;\r\n }\r\n $pro_class = $isPro ? ' class=\"ai-pro\"':'';\r\n\r\n if ($isPro) {\r\n $label = '<span alt=\"Pro feature\" title=\"Pro feature\">'.$label.'</span>';\r\n }\r\n\r\n echo '\r\n <tr'.$pro_class.'>\r\n <th scope=\"row\" '.$offset.'>' . $label . renderExampleIcon($url) . renderExternalWorkaroundIcon($showSave). '</th>\r\n <td><span class=\"hide-print\">\r\n <input name=\"' . $id . '\" type=\"' . $type . '\" id=\"' . $id . '\" value=\"' . esc_attr($options[$id]) . '\" /><br></span>\r\n <p class=\"description\">' . $description . '</p></td>\r\n </tr>\r\n ';\r\n}", "function hundope_select_field_render() { \n\t\n}", "public function htmlValue() \n\t{ \n $stri_html = $this->toJson() . $this->jQueryValue() . $this->obj_tr->htmlValue();\n \n \n return $stri_html;\n\t}", "public function getElementHtml()\n {\n \t$form = $this->getForm();\n \t$parent = $form->getParent();\n \t$layout = $parent->getLayout();\n \t$arrayBlock = $layout->createBlock('aydus_scheduledemails/adminhtml_system_config_form_field_array', $this->getName(), $this->getData());\n \t\n \t$arrayBlock->setElement($this);\n \t\n \t$html = $arrayBlock->toHtml();\n \t$html.= $this->getAfterElementHtml();\n \t\n \t$htmlId = $arrayBlock->getHtmlId();\n \t$rows = $arrayBlock->getArrayRows();\n \t$columns = $this->getColumns();\n \t$selectedValues = $this->getValue();\n \t\n \tif (is_array($rows) && count($rows)>0 && is_array($columns) && count($columns)>0){\n \t\t\n \t\t$html.= '<script type=\"application/javascript\">\n \t\t\t';\n \t\tforeach ($rows as $i=>$row){\n \t\t\tforeach ($columns as $columnName=>$column){\n \t\t\t\t$html.= '$$(\"select[name=\\\"'.$htmlId.'['.$i.']['.$columnName.']\\\"]\").each(function(select, selectIndex){\n\t \t\t\t$(select).select(\"option\").each(function(option, optionIndex){\n\t \t\t\t\tif (\"'.$selectedValues[$i][$columnName].'\" == option.value){\n\t \t\t\t\t\toption.selected = true;\n\t \t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t \t\t';\n \t\t\t}\n \t\t}\n \t\t\n \t\t$html.= '</script>\n \t\t';\n \t}\n \t \n \treturn $html;\n }", "function select($name = \"txt\", $alttext = \"\", $selecttype = \"array\", $lookup = \"\", $value = \"\", $event = \"\", $cssid = \"\", $readonly = false, $nochoose = true) {\n\n if (isset($_REQUEST[$name])) {\n if ($value == \"\") {\n $value = $_REQUEST[$name];\n }\n }\n $lookuplist = [];\n if ($selecttype == \"array\" || $selecttype == \"multiarray\") {\n\n if (is_array($lookup)) {\n $lookuplist = $lookup;\n } else {\n $lookuplist = explode(\"|\", $lookup);\n }\n } else if ($selecttype == \"sql\" || $selecttype == \"multisql\") {\n $lookuprow = $this->DEB->getRows($lookup, DEB_ARRAY); //format [0] = NAME\n\n\n foreach ($lookuprow as $irow => $row) {\n $lookuplist[$irow] = $row[0] . \",\" . $row[1]; //make it in the form of array\n }\n }\n //make options for the type of select etc .....\n if ($selecttype == \"multiarray\" || $selecttype == \"multisql\") {\n $options = \"multiple=\\\"multiple\\\"\";\n } else {\n $options = \"\";\n }\n if ($readonly == true) {\n $disabled = \"disabled=\\\"disabled\\\"\";\n } else {\n $disabled = \"\";\n }\n //default text\n if ($alttext == \"\") {\n $alttext = \"Choose\";\n }\n if ($cssid != \"\") {\n $cssid = \"id=\\\"{$cssid}\\\"\";\n } else {\n $cssid = \"\";\n }\n $html = \"<select class=\\\"form-control\\\" $cssid name=\\\"{$name}\\\" $options {$event} $disabled >\";\n\n if (!$nochoose) {\n $html .= \"<option value=\\\"\\\">{$alttext}</option>\";\n }\n\n foreach ($lookuplist as $lid => $option) {\n\n $toption = explode(\",\", $option);\n if (count($toption) != 2) {\n $toption[0] = $lid;\n $toption[1] = $option;\n }\n\n $option = $toption;\n\n if (trim($value) == trim($option[0])) {\n $html .= \"<option selected=\\\"selected\\\" value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n } else {\n $html .= \"<option value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n }\n }\n $html .= \"</select>\";\n return $html;\n }", "protected function getInput()\n\t{\n\t\t// Initialize variables.\n\t\t$html = array();\n \n\t\t$this->ngos=DwDonationFormHelper::fn_get_ngos_data();//var_dump($this);\n\t\t\n\t\tif(isset($this->ngos)){\n\t\t\t$html[]='<select id=\"'.$this->id.'\" name=\"'.$this->name.'\">';\n\t\t\t$html[]='<option value=\"0\">'.JText::_('None').'</option>';\n\t\t\t$selected_ngo=$this->value;\n\t\t\tforeach($this->ngos as $ngo){\n\t\t\t\t$selected=($selected_ngo===$ngo['ngo_id'])?'selected=\"selected\"':'';\n\t\t\t\t$html[]='<option value=\"'.$ngo['ngo_id'].'\" '.$selected.'>'.$ngo['ngo_name'].'</option>';\n\t\t\t}\n\t\t\t$html[]='</select>';\n\t\t\t\n\t\t\t$html[]='<script>';\n\t\t\t$html[]='jQuery(function($){\n\t\t\t\tlink=\"index.php?option=com_dw_donations&view=dwdonationform\";\n\t\t\t\t$(\"#'.$this->id.'\").change(function(){\n\t\t\t\t\tif($(this).val()!==\"0\"){\n\t\t\t\t\t\t$(\"#jform_link\").val(link+\"&beneficiary_id=\"+$(this).val());\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$(\"#jform_link\").val(link);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});';\n\t\t\t$html[]='</script>';\n\t\t}\n \n\t\treturn implode($html);\n\t}", "function printSelect($id_project = NULL){\n if(!$id_project){\n \n $html = '\n \n <table border=\"0\">\n <tr>\n <td>\n Enter Material:\n <div>\n '.Basic::prinstAutocompleteInputText('matadded','getPartNosFromDB.php','btnadd').'\n <script type=\\'text/javascript\\'>document.getElementById(\\'vieadded\\');</script>\n <div>\n \n </div>\n </div>\n </td>\n <td>\n <div>\n <input type=\"button\" id=\"btnadd\" name=\"btnadd\" onClick=\\'xajax_addMat(document.getElementById(\"matadded\").value);return false; \\' value=\"Add\" />\n <input type=\"button\" id=\"btndel\" name=\"btndel\" disabled onClick=\\'xajax_deleteMat(document.getElementById(\"leftValues\").value);return false; \\' value=\"Del\" />\n </div>\n </td>\n <td>\n Associated\n <div>\n <select id=\"leftValues\" name=\"leftValues[]\" size=\"10\" multiple></select>\n </div>\n </td>\n </tr>\n </table>';\n \n }\n return $html;\n }", "function toHtml(){\n global $PAGE;\n\n // Enhance the select with javascript.\n $this->_generateId();\n $id = $this->getAttribute('id');\n\n if (!$this->isFrozen()) {\n $PAGE->requires->js_call_amd('core/form-autocomplete', 'enhance', $params = array('#' . $id, $this->tags, $this->ajax,\n $this->placeholder, $this->casesensitive, $this->showsuggestions, $this->noselectionstring));\n }\n\n $html = parent::toHTML();\n\n // Hacky bodge to add in the HTML code to the option tag. There is a nicer\n // version of this code in the new template version (see export_for_template).\n if ($this->valuehtmlcallback) {\n $html = preg_replace_callback('~value=\"([^\"]+)\"~', function($matches) {\n $value = html_entity_decode($matches[1]);\n $htmlvalue = call_user_func($this->valuehtmlcallback, $value);\n if ($htmlvalue !== false) {\n return $matches[0] . ' data-html=\"' . s($htmlvalue) . '\"';\n } else {\n return $matches[0];\n }\n }, $html);\n }\n\n return $html;\n }", "function bootStrapForm($sql = \"\", $hideColumns = \"\", $custombuttons = null, $customFields = null, $submitAction = \"\", $formId = \"formId\", $prefix=\"txt\", $noForm = false) {\n $fieldinfo = $this->getFieldInfo($sql);\n $originalPrefix = $prefix;\n\n $hideColumns = explode(\",\", strtoupper($hideColumns));\n\n $record = @$this->DEB->getRow($sql, 0, DEB_ARRAY);\n $html = \"\";\n\n $validation = [];\n $messages = [];\n\n foreach ($fieldinfo as $fid => $field) {\n $prefix = $originalPrefix;\n\n if (!isset($record[$fid])) {\n $record[$fid] = null;\n } else {\n $record[$fid] .= \"\";\n }\n\n if (!in_array(strtoupper($field[\"name\"]), $hideColumns)) {\n $input = \"\";\n\n\n if (is_object($customFields)) {\n $customFields = (array) $customFields;\n }\n\n\n if (array_key_exists( strtoupper($field[\"name\"]), $customFields) || array_key_exists(strtoupper($field[\"alias\"]), $customFields)) {\n //first try the alias\n $customField = \"\";\n if (array_key_exists(strtoupper($field[\"alias\"]), $customFields)) {\n $customField = $customFields[strtoupper($field[\"alias\"])];\n } else\n //then try the field\n if (empty($customField)) {\n $customField = $customFields[strtoupper($field[\"name\"])];\n }\n\n\n if (is_array($customField)) {\n $customField = (object) $customField;\n }\n\n if (!empty($customField->defaultValue) && empty($record[$fid])) {\n $record[$fid] = $customField->defaultValue;\n }\n\n if (!empty($customField->constantValue)) {\n $record[$fid] = $customField->constantValue;\n }\n\n if (!empty($customField->list)) {\n if (is_object($customField->list)) {\n $customField->list = get_object_vars($customField->list);\n }\n\n }\n\n if (!isset($customField->event))\n $customField->event = \"\";\n if (!isset($customField->style))\n $customField->style = \"\";\n\n if (isset($customField->prefix))\n $prefix = $customField->prefix;\n\n if (!empty($customField->validation)) {\n $message = explode(\",\", $customField->validation);\n $mfound = false;\n foreach ($message as $mid => $mvalue) {\n $mvalue = explode(\":\", $mvalue);\n\n if ($mvalue[0] == \"message\") {\n $messages[] = $prefix . strtoupper($field[\"name\"]) . \": { required: '\" . $mvalue[1] . \"', remote: '\" . $mvalue[1] . \"'}\";\n $mfound = true;\n unset($message[$mid]);\n }\n }\n\n if ($mfound)\n $customField->validation = join(\",\", $message);\n\n $validation[] = $prefix . strtoupper($field[\"name\"]) . \": {\" . $customField->validation . \"}\";\n } else {\n $validation[] = $prefix . strtoupper($field[\"name\"]) . \":{required: true}\";\n }\n\n if (empty($customField->type)) {\n $customField->type = \"text\";\n }\n\n switch ($customField->type) {\n case \"custom\":\n $call = explode(\"->\", $customField->call);\n if (count($call) > 1) {\n $call[0] = str_replace (\"(\", \"\", $call[0]);\n $call[0] = str_replace (\")\", \"\", $call[0]);\n $call[0] = str_replace (\"new\", \"\", $call[0]);\n $call[0] = trim($call[0]);\n $callClass = \"\";\n eval ('$callClass = new '.$call[0].'();');\n $call[0] = $callClass;\n } else {\n $call = $customField->call;\n }\n\n $input = div(call_user_func($call, $record[$fid], strtoupper($field[\"name\"])));\n break;\n case \"password\":\n $input = input([\"class\" => \"form-control\", \"type\" => \"password\", \"placeholder\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"])], \"\");\n break;\n case \"hidden\":\n $input = input([\"class\" => \"form-control hidden\", \"type\" => \"hidden\", \"placeholder\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"])], $record[$fid]);\n break;\n case \"readonly\":\n $input = input([\"class\" => \"form-control readonly\", \"type\" => \"text\", \"readonly\", \"placeholder\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"])], $record[$fid]);\n break;\n case \"date\":\n $input = input([\"class\" => \"form-control\", \"type\" => \"text\", \"placeholder\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"])], $record[$fid]);\n $input .= script(\"$('#\" . $field[\"name\"] . \"').datepicker({format: '\" . strtolower($this->DEB->outputdateformat) . \"'}).on('changeDate', function(ev) { \" . $customField[\"event\"] . \" } );\");\n break;\n case \"toggle\":\n $checked = null;\n $input = input([\"class\" => \"form-control\", \"type\" => \"checkbox\", \"data-toggle\" => \"toggle\", \"data-on\" => \"Yes\", \"data-off\" => \"No\", \"placeholder\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"])], $record[$fid]);\n if ($record[$fid] == 1) {\n $input->addAttribute(\"checked\", \"checked\");\n }\n break;\n\n case \"checkbox\":\n if ($record[$fid] == 1) {\n $checked = \"checked\";\n } else {\n $checked = \"\";\n }\n\n $input = br() . label([\"class\" => \"checkbox-inline\"], input([\"type\" => \"checkbox\", \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"]), \"value\" => \"1\", $checked]), $customField->checkCaption );\n break;\n case \"image\":\n $input = img([\"class\" => \"thumbnail\", \"style\" => \"height: 160px; width: 160px\", \"src\" => $this->DEB->encodeImage($record[$fid], \"/imagestore\", \"160x160\"), \"alt\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"])))]);\n $input .= input([\"type\" => \"hidden\", \"name\" => \"MAX_FILE_SIZE\"], \"4194304\");\n $input .= input([\"class\" => \"btn btn-primary\", \"type\" => \"file\", \"accept\" => \"image/*\", \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"]), \"onclick\" => $customField->event], ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))));\n break;\n case \"file\":\n $input = input([\"type\" => \"hidden\", \"name\" => \"MAX_FILE_SIZE\"], \"4194304\");\n $input .= input([\"class\" => \"btn btn-primary\", \"type\" => \"file\", \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"]), \"onclick\" => $customField->event], ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))));\n break;\n case \"video\":\n $input = input([\"type\" => \"hidden\", \"name\" => \"MAX_FILE_SIZE\"], \"4194304\");\n $filename = \"video\".md5($record[$fid]).\".mp4\";\n //check first if the file exists\n if(!file_exists($filename)) {\n if (!file_exists($_SERVER[\"DOCUMENT_ROOT\"].\"/videostore\")) {\n mkdir ($_SERVER[\"DOCUMENT_ROOT\"].\"/videostore\");\n }\n file_put_contents(Ruth::getDOCUMENT_ROOT().\"/videostore/\".$filename, $record[$fid]);\n }\n //make the vidoe player view\n $input .= video( [ \"class\" => \"thumbnail\", \"width\"=>\"250\", \"height\"=>\"160\", \"controls\"=>\"true\" ],\n source( [\"src\" => \"/videostore/{$filename}\"]),\n source( [\"src\" =>\"/videostore/novideo.mp4\"])\n );\n $input .= input([\"class\" => \"btn btn-primary\", \"type\" => \"file\", \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"]), \"onclick\" => $customField->event], ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))));\n break;\n\n case \"text\":\n $input = input([\"class\" => \"form-control\", \"type\" => \"text\", \"placeholder\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"])], $record[$fid]);\n break;\n case \"readonly\":\n $input = input([\"class\" => \"form-control\", \"type\" => \"text\", \"readonly\" => \"readonly\", \"placeholder\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"])], $record[$fid]);\n break;\n case \"textarea\":\n\n $input = textarea([\"class\" => \"form-control\", \"style\" => $customField->style, \"rows\" => \"5\", \"placeholder\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"])], $record[$fid]);\n break;\n case \"lookup\":\n if (!isset($customField->event))\n $customField->event = \"\";\n if (!isset($customField->readonly))\n $customField->readonly = false;\n $input = $this->select($prefix . strtoupper($field[\"name\"]), ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"array\", $customField->list, $record[$fid], $customField->event, $prefix . strtoupper($field[\"name\"]), $customField->readonly);\n break;\n default:\n $input = div($record[$fid]);\n break;\n }\n\n if (!empty($customField->description)) {\n $input .= i([\"class\" => \"field-optional alert-success\"], ($customField->description));\n }\n } else { //generic form\n $validation[] = $prefix . $field[\"name\"] . \":{required: false}\";\n $input = input([\"class\" => \"form-control\", \"type\" => \"text\", \"placeholder\" => ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"]))), \"name\" => $prefix . strtoupper($field[\"name\"]), \"id\" => $prefix . strtoupper($field[\"name\"])], $record[$fid]);\n $input .= i([\"class\" => \"field-optional alert-warning\"], \"*Optional\");\n }\n\n if (isset($customFields[strtoupper($field[\"name\"])])) {\n $customField = $customFields[strtoupper($field[\"name\"])];\n if (is_array($customField)) {\n $customField = (object) $customField;\n }\n\n switch ($customField->type) {\n case \"hidden\":\n $html .= $input;\n break;\n default:\n $colWidth = \"col-md-6\";\n\n if (!empty($customField->colWidth)) {\n $colWidth = $customField->colWidth;\n }\n\n if ( (strtoupper($customField->type) === \"IMAGE\" && empty($customField->colWidth) ) || strtoupper($customField->type) === \"TEXTAREA\" ) {\n $colWidth = \"col-md-12\";\n\n }\n\n if (!empty($customField->help)) {\n $html .= div([\"class\" => \"form-group\", \"id\" => \"form-group\" . $field[\"name\"]], label([\"id\" => \"label\" . $field[\"name\"], \"for\" => $prefix . strtoupper($field[\"name\"])], ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"])))), span([\"id\" => \"help\" . $field[\"name\"], \"class\" => \"icon-x-info info-icon\", \"data-toggle\" => \"tooltip\", \"data-placement\" => \"right\", \"title\" => $customField[\"help\"]]), $input);\n $html .= script(\"$('#help{$field[\"name\"]}').tooltip({ trigger: 'hover' });\");\n } else {\n $html .= div([\"class\" => \"form-group {$colWidth}\", \"id\" => \"form-group\" . $field[\"name\"]], label([\"id\" => \"label\" . $field[\"name\"], \"for\" => $prefix . strtoupper($field[\"name\"])], ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"])))), $input);\n }\n break;\n }\n } else {\n $colWidth = \"col-md-6\";\n $html .= div([\"class\" => \"form-group {$colWidth}\", \"id\" => \"form-group\" . $field[\"name\"]], label([\"id\" => \"label\" . $field[\"name\"], \"for\" => $field[\"name\"]], ucwords(str_replace(\"_\", \" \", strtolower($field[\"alias\"])))), $input);\n }\n } else {\n $html .= input([\"class\" => \"form-control hidden\", \"type\" => \"hidden\", \"name\" => strtoupper($field[\"name\"]), \"id\" => strtoupper($field[\"name\"])], $record[$fid]);\n }\n }\n\n if ($noForm) {\n $html = shape( $html, $custombuttons, $this->validateForm(join($validation, \",\"), join($messages, \",\")));\n } else {\n $html = form([\"method\" => \"post\", \"action\" => $submitAction, \"onsubmit\" => \"return false\", \"enctype\" => \"multipart/form-data\", \"id\" => $formId], $html, $custombuttons, $this->validateForm(join($validation, \",\"), join($messages, \",\"), $formId));\n }\n\n return $html;\n }", "function val_input($data){\n $data = trim($data);\n $data = str_replace(\"'\", \"\", $data);\n $data = str_replace(\"select\", \"\", $data);\n $data = str_replace(\"SELECT\", \"\", $data);\n $data = str_replace(\"Select\", \"\", $data);\n $data = str_replace(\"drop\", \"\", $data);\n $data = str_replace(\"Drop\", \"\", $data);\n $data = str_replace(\"DROP\", \"\", $data);\n $data = str_replace(\"delete\", \"\", $data);\n $data = str_replace(\"DELETE\", \"\", $data);\n $data = str_replace(\"Delete\", \"\", $data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public function getInputField($field) {\n\t\t$return = '';\n\t\tswitch($field['htmltype']) {\n\t\t\tcase 'input': $return = \"<input type='text' name='{$field['name']}' value='\".\"{$this->get($field['name'])}' size='75'/>\";\n\t\t\t\tbreak; \n\t\t\tcase 'textarea': $return = \"<textarea name='{$field['name']}' cols='75' rows='5'>{$this->get($field['name'])}</textarea>\";\n\t\t\t\tbreak;\n\t\t\tcase 'select':\n\t\t\t\t$return = \"<select name='{$field['name']}'>\\n\";\n\t\t\t\tif (is_array($field['join'])) {\n\t\t\t\t\tforeach($field['join'] as $key=>$value) {\n\t\t\t\t\t\t$SELECTED = '';\n\t\t\t\t\t\tif ($this->get($field['name']) == $value)\n\t\t\t\t\t\t\t$SELECTED = 'SELECTED=\"SELECTED\"';\t\n\t\t\t\t\t\t$return .= '<option '.$SELECTED.' value=\"'.$value.'\">'.$key.'</option>'.\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$obj = new $field['join']();\n\t\t\t\t\t$cannull = !(isset($field['notnull']) && ($field['notnull'] === true));\n\t\t\t\t\t$return .= $obj->getOptionList($this->get($field['name']), $cannull);\n\t\t\t\t}\n\t\t\t\t$return .= \"</select>\\n\";\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $return;\n\t}", "public function show_tablefields()\n {\n $table_name = JFactory::getApplication()->input->get('table_name');\n\n if( ! $table_name)\n {\n return;\n }\n\n $db = JFactory::getDBO();\n\n $table_name = $db->getPrefix().$table_name;\n $fields = $db->getTableColumns($table_name);\n\n if( ! count($fields) || ! count($fields[$table_name]))\n {\n JFactory::getApplication()->enqueueMessage(jgettext('No table fields found'), 'error');\n }\n\n ?>\n<table>\n <tr>\n <th colspan=\"2\"><?php echo jgettext('Include')?></th>\n <th><?php echo jgettext('Editable'); ?></th>\n <th><?php echo jgettext('Type'); ?></th>\n </tr>\n <?php\n foreach($fields[$table_name] as $key => $value)\n {\n switch($value)\n {\n case 'int':\n case 'tinyint':\n $def = '0';\n break;\n\n default:\n $def = 'NULL';\n break;\n }\n\n $javascript1 = \"$('tblfield_edit_\".$key.\"').disabled=(this.checked)?false:true;\";\n $javascript2 = \"$('tblfield_type_\".$key.\"').disabled=(this.checked && $('tblfield_edit_\"\n .$key.\"').checked)?false:true;\";\n\n $javascript = $javascript1.$javascript2;\n ?>\n <tr>\n <td><input type=\"checkbox\" onchange=\"<?php echo $javascript; ?>\"\n name=\"table_fields[]\" checked=\"checked\"\n id=\"tblfield_<?php echo $key; ?>\"\n value=\"<?php echo $key; ?>\">\n </td>\n <td><label for=\"tblfield_<?php echo $key; ?>\">\n <?php echo $key.'<br />('.$value.')'; ?>\n </label></td>\n <td><input type=\"checkbox\" onchange=\"<?php echo $javascript2; ?>\"\n name=\"table_fields_edits[]\" checked=\"checked\"\n id=\"tblfield_edit_<?php echo $key; ?>\"\n value=\"<?php echo $key; ?>\"></td>\n <td><select name=\"table_fields_types[<?php echo $key; ?>]\"\n id=\"tblfield_type_<?php echo $key; ?>\">\n <option>text</option>\n <option>text area</option>\n <option>radio bool</option>\n <option>html</option>\n </select></td>\n </tr>\n <?php\n }\n ?>\n</table>\n <?php\n }", "function render_field( $field ) { ?>\n <input type=\"text\" value=\"<?php echo esc_attr( $field[ 'value' ] ); ?>\" id=\"<?php echo esc_attr( $field[ 'id' ] ); ?>\" name=\"<?php echo esc_attr( $field[ 'name' ] ); ?>\" class=\"rhicomoon-select-field <?php echo esc_attr( $field[ 'class' ] ); ?>\" data-json-url=\"<?php echo esc_attr( $field[ 'json_url' ] ); ?>\"/>\n <?php }", "function getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields, $generatedtype, $module_name, $mode = '', $typeofdata = null, $cbMapFI = array()) {\n\tglobal $log,$app_strings, $adb,$default_charset, $current_user;\n\t$log->debug('> getOutputHtml', [$uitype, $fieldname, $fieldlabel, $maxlength, $col_fields, $generatedtype, $module_name]);\n\n\t$userprivs = $current_user->getPrivileges();\n\n\t$fieldvalue = array();\n\t$final_arr = array();\n\t$value = $col_fields[$fieldname];\n\t$ui_type[]= $uitype;\n\t$editview_fldname[] = $fieldname;\n\n\t// vtlib customization: Related type field\n\tif ($uitype == '10') {\n\t\t$fldmod_result = $adb->pquery(\n\t\t\t'SELECT relmodule, status\n\t\t\tFROM vtiger_fieldmodulerel\n\t\t\tWHERE fieldid=\n\t\t\t\t(SELECT fieldid FROM vtiger_field, vtiger_tab\n\t\t\t\tWHERE vtiger_field.tabid=vtiger_tab.tabid AND fieldname=? AND name=? and vtiger_field.presence in (0,2) and vtiger_tab.presence=0)\n\t\t\t\tAND vtiger_fieldmodulerel.relmodule IN\n\t\t\t\t(select vtiger_tab.name FROM vtiger_tab WHERE vtiger_tab.presence=0 UNION select \"com_vtiger_workflow\")\n\t\t\torder by sequence',\n\t\t\tarray($fieldname, $module_name)\n\t\t);\n\t\t$entityTypes = array();\n\t\t$parent_id = $value;\n\t\tfor ($index = 0; $index < $adb->num_rows($fldmod_result); ++$index) {\n\t\t\t$entityTypes[] = $adb->query_result($fldmod_result, $index, 'relmodule');\n\t\t}\n\n\t\tif (!empty($value)) {\n\t\t\tif (strpos($value, 'x')) {\n\t\t\t\tlist($wsid, $value) = explode('x', $value);\n\t\t\t}\n\t\t\tif ($adb->num_rows($fldmod_result)==1) {\n\t\t\t\t$valueType = $adb->query_result($fldmod_result, 0, 0);\n\t\t\t} else {\n\t\t\t\t$valueType = getSalesEntityType($value);\n\t\t\t}\n\t\t\t$displayValueArray = getEntityName($valueType, $value);\n\t\t\tif (!empty($displayValueArray)) {\n\t\t\t\tforeach ($displayValueArray as $value) {\n\t\t\t\t\t$displayValue = $value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$displayValue='';\n\t\t\t\t$valueType='';\n\t\t\t\t$value='';\n\t\t\t\t$parent_id = '';\n\t\t\t}\n\t\t} else {\n\t\t\t$displayValue='';\n\t\t\t$valueType='';\n\t\t\t$value='';\n\t\t\t$parent_id = '';\n\t\t}\n\n\t\t$editview_label[] = array('options'=>$entityTypes, 'selected'=>$valueType, 'displaylabel'=>getTranslatedString($fieldlabel, $module_name));\n\t\t$fieldvalue[] = array('displayvalue'=>$displayValue,'entityid'=>$parent_id);\n\t} elseif ($uitype == 5 || $uitype == 6 || $uitype ==23) {\n\t\t$curr_time = '';\n\t\tif ($value == '') {\n\t\t\tif ($fieldname != 'birthday' && $generatedtype != 2 && getTabid($module_name) != 14) {\n\t\t\t\t$disp_value = getNewDisplayDate();\n\t\t\t}\n\n\t\t\t//Added to display the Contact - Support End Date as one year future instead of today's date\n\t\t\tif ($fieldname == 'support_end_date' && $_REQUEST['module'] == 'Contacts') {\n\t\t\t\t$addyear = strtotime('+1 year');\n\t\t\t\t$disp_value = DateTimeField::convertToUserFormat(date('Y-m-d', $addyear));\n\t\t\t} elseif ($fieldname == 'validtill' && $_REQUEST['module'] == 'Quotes') {\n\t\t\t\t$disp_value = '';\n\t\t\t}\n\t\t} else {\n\t\t\tif ($uitype == 6) {\n\t\t\t\t$curr_time = date('H:i', strtotime('+5 minutes'));\n\t\t\t}\n\t\t\t$date = new DateTimeField($value);\n\t\t\t$isodate = $date->convertToDBFormat($value);\n\t\t\t$date = new DateTimeField($isodate);\n\t\t\t$disp_value = $date->getDisplayDate();\n\t\t}\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']);\n\n\t\tif (empty($disp_value)) {\n\t\t\t$disp_value = '';\n\t\t}\n\t\t$fieldvalue[] = array($disp_value => $curr_time);\n\t\tif ($uitype == 5 || $uitype == 23) {\n\t\t\t$fieldvalue[] = array($date_format=>$current_user->date_format);\n\t\t} else {\n\t\t\t$fieldvalue[] = array($date_format=>$current_user->date_format.' '.$app_strings['YEAR_MONTH_DATE']);\n\t\t}\n\t} elseif ($uitype == 50) {\n\t\t$user_format = ($current_user->hour_format=='24' ? '24' : '12');\n\t\tif (empty($value)) {\n\t\t\tif ($generatedtype != 2) {\n\t\t\t\t$date = new DateTimeField();\n\t\t\t\t$disp_value = substr($date->getDisplayDateTimeValue(), 0, 16);\n\t\t\t\t$curr_time = DateTimeField::formatUserTimeString($disp_value, $user_format);\n\t\t\t\tif (strlen($curr_time)>5) {\n\t\t\t\t\t$time_format = substr($curr_time, -2);\n\t\t\t\t\t$curr_time = substr($curr_time, 0, 5);\n\t\t\t\t} else {\n\t\t\t\t\t$time_format = '24';\n\t\t\t\t}\n\t\t\t\tlist($dt,$tm) = explode(' ', $disp_value);\n\t\t\t\t$disp_value12 = $dt . ' ' . $curr_time;\n\t\t\t} else {\n\t\t\t\t$disp_value = $disp_value12 = $curr_time = $time_format = '';\n\t\t\t}\n\t\t} else {\n\t\t\t$date = new DateTimeField($value);\n\t\t\t$disp_value = substr($date->getDisplayDateTimeValue(), 0, 16);\n\t\t\t$curr_time = DateTimeField::formatUserTimeString($disp_value, $user_format);\n\t\t\tif (strlen($curr_time)>5) {\n\t\t\t\t$time_format = substr($curr_time, -2);\n\t\t\t\t$curr_time = substr($curr_time, 0, 5);\n\t\t\t} else {\n\t\t\t\t$time_format = '24';\n\t\t\t}\n\t\t\tlist($dt,$tm) = explode(' ', $disp_value);\n\t\t\t$disp_value12 = $dt . ' ' . $curr_time;\n\t\t}\n\t\t$value = $disp_value;\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']).' '.($current_user->hour_format=='24' ? '%H' : '%I').':%M';\n\t\t$fieldvalue[] = array($disp_value => $disp_value12);\n\t\t$fieldvalue[] = array($date_format=>$current_user->date_format.' '.($current_user->hour_format=='24' ? '24' : 'am/pm'));\n\t\t$fieldvalue[] = array($user_format => $time_format);\n\t} elseif ($uitype == 16) {\n\t\trequire_once 'modules/PickList/PickListUtils.php';\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\n\t\t$fieldname = $adb->sql_escape_string($fieldname);\n\t\t$pick_query=\"select $fieldname from vtiger_$fieldname order by sortorderid\";\n\t\t$params = array();\n\t\t$pickListResult = $adb->pquery($pick_query, $params);\n\t\t$noofpickrows = $adb->num_rows($pickListResult);\n\n\t\t$options = array();\n\t\t$pickcount=0;\n\t\tfor ($j = 0; $j < $noofpickrows; $j++) {\n\t\t\t$value = decode_html($value);\n\t\t\t$pickListValue=decode_html($adb->query_result($pickListResult, $j, strtolower($fieldname)));\n\t\t\tif ($value == trim($pickListValue)) {\n\t\t\t\t$chk_val = 'selected';\n\t\t\t\t$pickcount++;\n\t\t\t} else {\n\t\t\t\t$chk_val = '';\n\t\t\t}\n\t\t\t$pickListValue = to_html($pickListValue);\n\t\t\tif (isset($_REQUEST['file']) && $_REQUEST['file'] == 'QuickCreate') {\n\t\t\t\t$options[] = array(htmlentities(getTranslatedString($pickListValue), ENT_QUOTES, $default_charset),$pickListValue,$chk_val );\n\t\t\t} else {\n\t\t\t\t$options[] = array(getTranslatedString($pickListValue),$pickListValue,$chk_val );\n\t\t\t}\n\t\t}\n\t\t$fieldvalue [] = $options;\n\t} elseif ($uitype == 1613 || $uitype == 1614 || $uitype == 1615 || $uitype == 1616 || $uitype == 3313 || $uitype == 3314 || $uitype == 1024) {\n\t\trequire_once 'modules/PickList/PickListUtils.php';\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$fieldvalue[] = getPicklistValuesSpecialUitypes($uitype, $fieldname, $value);\n\t} elseif ($uitype == 15 || $uitype == 33) {\n\t\trequire_once 'modules/PickList/PickListUtils.php';\n\t\t$roleid=$current_user->roleid;\n\t\t$picklistValues = getAssignedPicklistValues($fieldname, $roleid, $adb);\n\t\tif (!empty($value)) {\n\t\t\t$valueArr = explode('|##|', $value);\n\t\t} else {\n\t\t\t$valueArr = array();\n\t\t}\n\t\tforeach ($valueArr as $key => $value) {\n\t\t\t$valueArr[$key] = trim(vt_suppressHTMLTags(vtlib_purify(html_entity_decode($value, ENT_QUOTES, $default_charset))));\n\t\t}\n\t\tif ($uitype == 15) {\n\t\t\tif (!empty($valueArr)) {\n\t\t\t\t$valueArr = array_combine($valueArr, $valueArr);\n\t\t\t}\n\t\t\t$picklistValues = array_merge($picklistValues, $valueArr);\n\t\t}\n\t\t$options = array();\n\t\tif (!empty($picklistValues)) {\n\t\t\tforeach ($picklistValues as $pickListValue) {\n\t\t\t\t$plvalenc = vt_suppressHTMLTags(trim($pickListValue));\n\t\t\t\tif (in_array($plvalenc, $valueArr)) {\n\t\t\t\t\t$chk_val = 'selected';\n\t\t\t\t} else {\n\t\t\t\t\t$chk_val = '';\n\t\t\t\t}\n\t\t\t\tif (isset($_REQUEST['file']) && $_REQUEST['file'] == 'QuickCreate') {\n\t\t\t\t\t$options[] = array(htmlentities(getTranslatedString($pickListValue), ENT_QUOTES, $default_charset), $plvalenc, $chk_val);\n\t\t\t\t} else {\n\t\t\t\t\t$options[] = array(getTranslatedString($pickListValue), $plvalenc, $chk_val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$fieldvalue[] = $options;\n\t} elseif ($uitype == 1025) {\n\t\t$entityTypes = array();\n\t\t$parent_id = $value;\n\t\t$values = explode(Field_Metadata::MULTIPICKLIST_SEPARATOR, $value);\n\t\tforeach ($cbMapFI['searchfields'] as $k => $value) {\n\t\t\t$entityTypes[] = $k;\n\t\t}\n\n\t\tif (!empty($value) && !empty($values[0])) {\n\t\t\t$valueType= getSalesEntityType($values[0]);\n\n\t\t\t$response=array();\n\t\t\t$shown_val='';\n\t\t\tforeach ($values as $val) {\n\t\t\t\t$displayValueArray = getEntityName($valueType, $val);\n\t\t\t\tif (!empty($displayValueArray)) {\n\t\t\t\t\tforeach ($displayValueArray as $value2) {\n\t\t\t\t\t\t$shown_val = $value2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$response[]=html_entity_decode($shown_val, ENT_QUOTES, $default_charset);\n\t\t\t}\n\t\t\t$displayValue=implode(',', $response).',';\n\t\t} else {\n\t\t\t$displayValue='';\n\t\t\t$valueType='';\n\t\t\t$value='';\n\t\t}\n\t\t$editview_label[] = array('options'=>$entityTypes, 'selected'=>$valueType, 'displaylabel'=>getTranslatedString($fieldlabel, $module_name));\n\t\t$fieldvalue[] = array('displayvalue'=>$displayValue,'entityid'=>$parent_id);\n\t} elseif ($uitype == 17 || $uitype == 85 || $uitype == 14 || $uitype == 21 || $uitype == 56) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$fieldvalue [] = $value;\n\t} elseif ($uitype == 19) {\n\t\tif (isset($_REQUEST['body'])) {\n\t\t\t$value = ($_REQUEST['body']);\n\t\t}\n\n\t\tif ($fieldname == 'terms_conditions') {//for default Terms & Conditions\n\t\t//Assign the value from focus->column_fields (if we create Invoice from SO the SO's terms and conditions will be loaded to Invoice's terms and conditions, etc.,)\n\t\t\t$value = $col_fields['terms_conditions'];\n\n\t\t\t//if the value is empty then we should get the default Terms and Conditions\n\t\t\tif ($value == '' && $mode != 'edit') {\n\t\t\t\t$value=getTermsandConditions($module_name);\n\t\t\t}\n\t\t}\n\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$fieldvalue [] = $value;\n\t} elseif ($uitype == 52 || $uitype == 77) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\tglobal $current_user;\n\t\tif ($value != '') {\n\t\t\t$assigned_user_id = $value;\n\t\t} else {\n\t\t\t$assigned_user_id = $current_user->id;\n\t\t}\n\t\tif (!$userprivs->hasGlobalWritePermission() && !$userprivs->hasModuleWriteSharing(getTabid($module_name))) {\n\t\t\t$ua = get_user_array(false, 'Active', $assigned_user_id, 'private');\n\t\t} else {\n\t\t\t$ua = get_user_array(false, 'Active', $assigned_user_id);\n\t\t}\n\t\t$users_combo = get_select_options_array($ua, $assigned_user_id);\n\t\t$fieldvalue [] = $users_combo;\n\t} elseif ($uitype == 53) {\n\t\tglobal $noof_group_rows;\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$assigned_user_id = empty($value) ? $current_user->id : $value;\n\t\t$groups_combo = '';\n\t\tif ($fieldname == 'assigned_user_id' && !$userprivs->hasGlobalWritePermission() && !$userprivs->hasModuleWriteSharing(getTabid($module_name))) {\n\t\t\tget_current_user_access_groups($module_name); // calculate global variable $noof_group_rows\n\t\t\tif ($noof_group_rows!=0) {\n\t\t\t\t$ga = get_group_array(false, 'Active', $assigned_user_id, 'private');\n\t\t\t}\n\t\t\t$ua = get_user_array(false, 'Active', $assigned_user_id, 'private');\n\t\t} else {\n\t\t\tget_group_options();// calculate global variable $noof_group_rows\n\t\t\tif ($noof_group_rows!=0) {\n\t\t\t\t$ga = get_group_array(false, 'Active', $assigned_user_id);\n\t\t\t}\n\t\t\t$ua = get_user_array(false, 'Active', $assigned_user_id);\n\t\t}\n\t\t$users_combo = get_select_options_array($ua, $assigned_user_id);\n\t\tif ($noof_group_rows!=0) {\n\t\t\t$groups_combo = get_select_options_array($ga, $assigned_user_id);\n\t\t}\n\t\tif (GlobalVariable::getVariable('Application_Group_Selection_Permitted', 1)!=1) {\n\t\t\t$groups_combo = '';\n\t\t}\n\t\t$fieldvalue[]=$users_combo;\n\t\t$fieldvalue[] = $groups_combo;\n\t} elseif ($uitype == 54) {\n\t\t$options = array();\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$pickListResult = $adb->pquery('select name from vtiger_groups', array());\n\t\t$noofpickrows = $adb->num_rows($pickListResult);\n\t\tfor ($j = 0; $j < $noofpickrows; $j++) {\n\t\t\t$pickListValue=$adb->query_result($pickListResult, $j, 'name');\n\n\t\t\tif ($value == $pickListValue) {\n\t\t\t\t$chk_val = 'selected';\n\t\t\t} else {\n\t\t\t\t$chk_val = '';\n\t\t\t}\n\t\t\t$options[] = array($pickListValue => $chk_val );\n\t\t}\n\t\t$fieldvalue[] = $options;\n\t} elseif ($uitype == 63) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\tif ($value=='') {\n\t\t\t$value=1;\n\t\t}\n\t\t$options = array();\n\t\t$pickListResult = $adb->pquery('select duration_minutes from vtiger_duration_minutes order by sortorderid', array());\n\t\t$noofpickrows = $adb->num_rows($pickListResult);\n\t\t$salt_value = $col_fields['duration_minutes'];\n\t\tfor ($j = 0; $j < $noofpickrows; $j++) {\n\t\t\t$pickListValue=$adb->query_result($pickListResult, $j, 'duration_minutes');\n\n\t\t\tif ($salt_value == $pickListValue) {\n\t\t\t\t$chk_val = 'selected';\n\t\t\t} else {\n\t\t\t\t$chk_val = '';\n\t\t\t}\n\t\t\t$options[$pickListValue] = $chk_val;\n\t\t}\n\t\t$fieldvalue[]=$value;\n\t\t$fieldvalue[]=$options;\n\t} elseif ($uitype == 64) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']);\n\t\t$fieldvalue[] = $value;\n\t} elseif ($uitype == 156) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$fieldvalue[] = $value;\n\t\t$fieldvalue[] = is_admin($current_user);\n\t} elseif ($uitype == 61) {\n\t\tif ($value != '') {\n\t\t\t$assigned_user_id = $value;\n\t\t} else {\n\t\t\t$assigned_user_id = $current_user->id;\n\t\t}\n\t\tif ($module_name == 'Emails' && !empty($col_fields['record_id'])) {\n\t\t\t$attach_result = $adb->pquery('select * from vtiger_seattachmentsrel where crmid = ?', array($col_fields['record_id']));\n\t\t\t//to fix the issue in mail attachment on forwarding mails\n\t\t\tif (isset($_REQUEST['forward']) && $_REQUEST['forward'] != '') {\n\t\t\t\tglobal $att_id_list;\n\t\t\t}\n\t\t\t$attachquery = 'select * from vtiger_attachments where attachmentsid=?';\n\t\t\tfor ($ii=0; $ii < $adb->num_rows($attach_result); $ii++) {\n\t\t\t\t$attachmentid = $adb->query_result($attach_result, $ii, 'attachmentsid');\n\t\t\t\tif ($attachmentid != '') {\n\t\t\t\t\t$rsatt = $adb->pquery($attachquery, array($attachmentid));\n\t\t\t\t\t$attachmentsname = $adb->query_result($rsatt, 0, 'name');\n\t\t\t\t\tif ($attachmentsname != '') {\n\t\t\t\t\t\t$fieldvalue[$attachmentid] = '[ '.$attachmentsname.' ]';\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($_REQUEST['forward']) && $_REQUEST['forward'] != '') {\n\t\t\t\t\t\t$att_id_list .= $attachmentid.';';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!empty($col_fields['record_id'])) {\n\t\t\t\t$rsatt = $adb->pquery('select * from vtiger_seattachmentsrel where crmid = ?', array($col_fields['record_id']));\n\t\t\t\t$attachmentid=$adb->query_result($rsatt, 0, 'attachmentsid');\n\t\t\t\tif ($col_fields[$fieldname] == '' && $attachmentid != '') {\n\t\t\t\t\t$attachquery = 'select name from vtiger_attachments where attachmentsid=?';\n\t\t\t\t\t$rsattn = $adb->pquery($attachquery, array($attachmentid));\n\t\t\t\t\t$value = $adb->query_result($rsattn, 0, 'name');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($value!='') {\n\t\t\t\t$filename=' [ '.$value. ' ]';\n\t\t\t}\n\t\t\tif (!empty($filename)) {\n\t\t\t\t$fieldvalue[] = $filename;\n\t\t\t}\n\t\t\tif ($value != '') {\n\t\t\t\t$fieldvalue[] = $value;\n\t\t\t}\n\t\t}\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t} elseif ($uitype == 28) {\n\t\tif (!(empty($col_fields['record_id']))) {\n\t\t\t$attrs = $adb->pquery('select attachmentsid from vtiger_seattachmentsrel where crmid = ?', array($col_fields['record_id']));\n\t\t\t$attachmentid=$adb->query_result($attrs, 0, 'attachmentsid');\n\t\t\tif ($col_fields[$fieldname] == '' && $attachmentid != '') {\n\t\t\t\t$attachquery = \"select name from vtiger_attachments where attachmentsid=?\";\n\t\t\t\t$attqrs = $adb->pquery($attachquery, array($attachmentid));\n\t\t\t\t$value = $adb->query_result($attqrs, 0, 'name');\n\t\t\t}\n\t\t}\n\t\tif ($value!='' && $module_name != 'Documents') {\n\t\t\t$filename=' [ '.$value. ' ]';\n\t\t} elseif ($value != '' && $module_name == 'Documents') {\n\t\t\t$filename= $value;\n\t\t}\n\t\tif (!empty($filename)) {\n\t\t\t$fieldvalue[] = $filename;\n\t\t}\n\t\tif ($value != '') {\n\t\t\t$fieldvalue[] = $value;\n\t\t}\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t} elseif ($uitype == 69 || $uitype == '69m') {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\tif (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {\n\t\t\tif ($uitype == '69') {\n\t\t\t\t$fieldvalue[] = array('name'=>$col_fields[$fieldname],'path'=>'','orgname'=>$col_fields[$fieldname]);\n\t\t\t} else {\n\t\t\t\t$fieldvalue[] = '';\n\t\t\t}\n\t\t} elseif (!empty($col_fields['record_id'])) {\n\t\t\tif ($uitype == '69m') { // module_name == 'Products'\n\t\t\t\t$query = 'select vtiger_attachments.path, vtiger_attachments.attachmentsid, vtiger_attachments.name ,vtiger_crmentity.setype\n\t\t\t\t\tfrom vtiger_products\n\t\t\t\t\tleft join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_products.productid\n\t\t\t\t\tinner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid\n\t\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_attachments.attachmentsid\n\t\t\t\t\twhere vtiger_crmentity.setype=\"Products Image\" and productid=?';\n\t\t\t\t$params = array($col_fields['record_id']);\n\t\t\t} else {\n\t\t\t\tif ($module_name == 'Contacts' && $fieldname=='imagename') {\n\t\t\t\t\t$imageattachment = 'Image';\n\t\t\t\t} else {\n\t\t\t\t\t$imageattachment = 'Attachment';\n\t\t\t\t}\n\t\t\t\t$query=\"select vtiger_attachments.*,vtiger_crmentity.setype\n\t\t\t\t\tfrom vtiger_attachments\n\t\t\t\t\tinner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid\n\t\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_attachments.attachmentsid\n\t\t\t\t\twhere (vtiger_crmentity.setype='$module_name $imageattachment' OR vtiger_crmentity.setype LIKE '% $imageattachment')\n\t\t\t\t\t\tand vtiger_attachments.name = ?\n\t\t\t\t\t\tand vtiger_seattachmentsrel.crmid=?\";\n\t\t\t\tglobal $upload_badext;\n\t\t\t\t$params = array(sanitizeUploadFileName(decode_html($col_fields[$fieldname]), $upload_badext), $col_fields['record_id']);\n\t\t\t}\n\t\t\t$result_image = $adb->pquery($query, $params);\n\t\t\t$image_array = array();\n\t\t\tfor ($image_iter=0, $img_itrMax = $adb->num_rows($result_image); $image_iter < $img_itrMax; $image_iter++) {\n\t\t\t\t$image_id_array[] = $adb->query_result($result_image, $image_iter, 'attachmentsid');\n\n\t\t\t\t//decode_html - added to handle UTF-8 characters in file names\n\t\t\t\t//urlencode - added to handle special characters like #, %, etc.,\n\t\t\t\t$image_array[] = urlencode(decode_html($adb->query_result($result_image, $image_iter, 'name')));\n\t\t\t\t$image_orgname_array[] = decode_html($adb->query_result($result_image, $image_iter, 'name'));\n\n\t\t\t\t$image_path_array[] = $adb->query_result($result_image, $image_iter, 'path');\n\t\t\t}\n\t\t\tif (!empty($image_array)) {\n\t\t\t\tfor ($img_itr=0, $img_itrMax = count($image_array); $img_itr< $img_itrMax; $img_itr++) {\n\t\t\t\t\t$fieldvalue[] = array(\n\t\t\t\t\t\t'name' => $image_array[$img_itr],\n\t\t\t\t\t\t'path' => $image_path_array[$img_itr].$image_id_array[$img_itr].'_',\n\t\t\t\t\t\t'orgname' => $image_orgname_array[$img_itr]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$fieldvalue[] = '';\n\t\t\t}\n\t\t} else {\n\t\t\t$fieldvalue[] = '';\n\t\t}\n\t} elseif ($uitype == 357) { // added for better email support\n\t\t$pmodule = isset($_REQUEST['pmodule']) ? $_REQUEST['pmodule'] : (isset($_REQUEST['par_module']) ? $_REQUEST['par_module'] : null);\n\t\tif (isset($_REQUEST['emailids']) && $_REQUEST['emailids'] != '') {\n\t\t\t$parent_id = $_REQUEST['emailids'];\n\t\t\t$parent_name='';\n\n\t\t\t$myids=explode('|', $parent_id);\n\t\t\tfor ($i=0; $i<(count($myids)-1); $i++) {\n\t\t\t\t$realid=explode('@', $myids[$i]);\n\t\t\t\t$entityid=$realid[0];\n\t\t\t\t$nemail=count($realid);\n\n\t\t\t\tif ($pmodule=='Accounts') {\n\t\t\t\t\trequire_once 'modules/Accounts/Accounts.php';\n\t\t\t\t\t$myfocus = new Accounts();\n\t\t\t\t\t$myfocus->retrieve_entity_info($entityid, 'Accounts');\n\t\t\t\t\t$fullname=br2nl($myfocus->column_fields['accountname']);\n\t\t\t\t} elseif ($pmodule=='Contacts') {\n\t\t\t\t\trequire_once 'modules/Contacts/Contacts.php';\n\t\t\t\t\t$myfocus = new Contacts();\n\t\t\t\t\t$myfocus->retrieve_entity_info($entityid, 'Contacts');\n\t\t\t\t\t$fname=br2nl($myfocus->column_fields['firstname']);\n\t\t\t\t\t$lname=br2nl($myfocus->column_fields['lastname']);\n\t\t\t\t\t$fullname=$lname.' '.$fname;\n\t\t\t\t} elseif ($pmodule=='Leads') {\n\t\t\t\t\trequire_once 'modules/Leads/Leads.php';\n\t\t\t\t\t$myfocus = new Leads();\n\t\t\t\t\t$myfocus->retrieve_entity_info($entityid, 'Leads');\n\t\t\t\t\t$fname=br2nl($myfocus->column_fields['firstname']);\n\t\t\t\t\t$lname=br2nl($myfocus->column_fields['lastname']);\n\t\t\t\t\t$fullname=$lname.' '.$fname;\n\t\t\t\t} elseif ($pmodule=='Project') {\n\t\t\t\t\trequire_once 'modules/Project/Project.php';\n\t\t\t\t\t$myfocus = new Project();\n\t\t\t\t\t$myfocus->retrieve_entity_info($entityid, 'Project');\n\t\t\t\t\t$fname=br2nl($myfocus->column_fields['projectname']);\n\t\t\t\t\t$fullname=$fname;\n\t\t\t\t} elseif ($pmodule=='ProjectTask') {\n\t\t\t\t\trequire_once 'modules/ProjectTask/ProjectTask.php';\n\t\t\t\t\t$myfocus = new ProjectTask();\n\t\t\t\t\t$myfocus->retrieve_entity_info($entityid, 'ProjectTask');\n\t\t\t\t\t$fname=br2nl($myfocus->column_fields['projecttaskname']);\n\t\t\t\t\t$fullname=$fname;\n\t\t\t\t} elseif ($pmodule=='Potentials') {\n\t\t\t\t\trequire_once 'modules/Potentials/Potentials.php';\n\t\t\t\t\t$myfocus = new Potentials();\n\t\t\t\t\t$myfocus->retrieve_entity_info($entityid, 'Potentials');\n\t\t\t\t\t$fname=br2nl($myfocus->column_fields['potentialname']);\n\t\t\t\t\t$fullname=$fname;\n\t\t\t\t} elseif ($pmodule=='HelpDesk') {\n\t\t\t\t\trequire_once 'modules/HelpDesk/HelpDesk.php';\n\t\t\t\t\t$myfocus = new HelpDesk();\n\t\t\t\t\t$myfocus->retrieve_entity_info($entityid, 'HelpDesk');\n\t\t\t\t\t$fname=br2nl($myfocus->column_fields['title']);\n\t\t\t\t\t$fullname=$fname;\n\t\t\t\t} else {\n\t\t\t\t\t$ename = getEntityName($pmodule, array($entityid));\n\t\t\t\t\t$fullname = br2nl($ename[$entityid]);\n\t\t\t\t}\n\t\t\t\tfor ($j=1; $j<$nemail; $j++) {\n\t\t\t\t\t$querystr='select columnname from vtiger_field where fieldid=? and vtiger_field.presence in (0,2)';\n\t\t\t\t\t$result=$adb->pquery($querystr, array($realid[$j]));\n\t\t\t\t\t$temp=$adb->query_result($result, 0, 'columnname');\n\t\t\t\t\t$temp1=br2nl($myfocus->column_fields[$temp]);\n\n\t\t\t\t\t//Modified to display the entities in red which don't have email id\n\t\t\t\t\tif (!empty($temp_parent_name) && strlen($temp_parent_name) > 150) {\n\t\t\t\t\t\t$parent_name .= '<br>';\n\t\t\t\t\t\t$temp_parent_name = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($temp1 != '') {\n\t\t\t\t\t\t$parent_name .= $fullname.'&lt;'.$temp1.'&gt;; ';\n\t\t\t\t\t\t$temp_parent_name .= $fullname.'&lt;'.$temp1.'&gt;; ';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$parent_name .= \"<strong style='color:red'>\".$fullname.'&lt;'.$temp1.'&gt;; </strong>';\n\t\t\t\t\t\t$temp_parent_name .= \"<strong style='color:red'>\".$fullname.'&lt;'.$temp1.'&gt;; </strong>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$parent_name='';\n\t\t\t$parent_id='';\n\t\t\tif (!empty($_REQUEST['record'])) {\n\t\t\t\t$myemailid= vtlib_purify($_REQUEST['record']);\n\t\t\t\t$mysql = 'select crmid from vtiger_seactivityrel where activityid=?';\n\t\t\t\t$myresult = $adb->pquery($mysql, array($myemailid));\n\t\t\t\t$mycount=$adb->num_rows($myresult);\n\t\t\t\tif ($mycount >0) {\n\t\t\t\t\tfor ($i=0; $i<$mycount; $i++) {\n\t\t\t\t\t\t$mycrmid=$adb->query_result($myresult, $i, 'crmid');\n\t\t\t\t\t\t$parent_module = getSalesEntityType($mycrmid);\n\t\t\t\t\t\tif ($parent_module == 'Leads') {\n\t\t\t\t\t\t\t$sql = 'select firstname,lastname,email from vtiger_leaddetails where leadid=?';\n\t\t\t\t\t\t\t$result = $adb->pquery($sql, array($mycrmid));\n\t\t\t\t\t\t\t$full_name = getFullNameFromQResult($result, 0, 'Leads');\n\t\t\t\t\t\t\t$myemail=$adb->query_result($result, 0, 'email');\n\t\t\t\t\t\t\t$parent_id .=$mycrmid.'@0|';\n\t\t\t\t\t\t\t$parent_name .= $full_name.'<'.$myemail.'>; ';\n\t\t\t\t\t\t} elseif ($parent_module == 'Contacts') {\n\t\t\t\t\t\t\t$sql = 'select * from vtiger_contactdetails where contactid=?';\n\t\t\t\t\t\t\t$result = $adb->pquery($sql, array($mycrmid));\n\t\t\t\t\t\t\t$full_name = getFullNameFromQResult($result, 0, 'Contacts');\n\t\t\t\t\t\t\t$myemail=$adb->query_result($result, 0, 'email');\n\t\t\t\t\t\t\t$parent_id .=$mycrmid.'@0|';\n\t\t\t\t\t\t\t$parent_name .= $full_name.'<'.$myemail.'>; ';\n\t\t\t\t\t\t} elseif ($parent_module == 'Accounts') {\n\t\t\t\t\t\t\t$sql = 'select accountname, email1 from vtiger_account where accountid=?';\n\t\t\t\t\t\t\t$result = $adb->pquery($sql, array($mycrmid));\n\t\t\t\t\t\t\t$account_name = $adb->query_result($result, 0, 'accountname');\n\t\t\t\t\t\t\t$myemail=$adb->query_result($result, 0, 'email1');\n\t\t\t\t\t\t\t$parent_id .=$mycrmid.'@0|';\n\t\t\t\t\t\t\t$parent_name .= $account_name.'<'.$myemail.'>; ';\n\t\t\t\t\t\t} elseif ($parent_module == 'Users') {\n\t\t\t\t\t\t\t$sql = 'select user_name,email1 from vtiger_users where id=?';\n\t\t\t\t\t\t\t$result = $adb->pquery($sql, array($mycrmid));\n\t\t\t\t\t\t\t$account_name = $adb->query_result($result, 0, 'user_name');\n\t\t\t\t\t\t\t$myemail=$adb->query_result($result, 0, 'email1');\n\t\t\t\t\t\t\t$parent_id .=$mycrmid.'@0|';\n\t\t\t\t\t\t\t$parent_name .= $account_name.'<'.$myemail.'>; ';\n\t\t\t\t\t\t} elseif ($parent_module == 'Vendors') {\n\t\t\t\t\t\t\t$sql = 'select vendorname, email from vtiger_vendor where vendorid=?';\n\t\t\t\t\t\t\t$result = $adb->pquery($sql, array($mycrmid));\n\t\t\t\t\t\t\t$vendor_name = $adb->query_result($result, 0, 'vendorname');\n\t\t\t\t\t\t\t$myemail=$adb->query_result($result, 0, 'email');\n\t\t\t\t\t\t\t$parent_id .=$mycrmid.'@0|';\n\t\t\t\t\t\t\t$parent_name .= $vendor_name.'<'.$myemail.'>; ';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$emailfield = getFirstEmailField($parent_module);\n\t\t\t\t\t\t\tif ($emailfield != '') {\n\t\t\t\t\t\t\t\t$qg = new QueryGenerator($parent_module, $current_user);\n\t\t\t\t\t\t\t\t$qg->setFields(array($emailfield));\n\t\t\t\t\t\t\t\t$qg->addCondition('id', $mycrmid, 'e');\n\t\t\t\t\t\t\t\t$query = $qg->getQuery();\n\t\t\t\t\t\t\t\t$result = $adb->query($query);\n\t\t\t\t\t\t\t\t$myemail = $adb->query_result($result, 0, $emailfield);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$myemail = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$parent_id .=$mycrmid.'@0|';\n\t\t\t\t\t\t\t$minfo = getEntityName($parent_module, array($mycrmid));\n\t\t\t\t\t\t\t$parent_name .= $minfo[$mycrmid] . '<'.$myemail.'>; ';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$emailmodules = modulesWithEmailField();\n\t\t\t$evlbl = array();\n\t\t\tforeach ($emailmodules as $mod) {\n\t\t\t\t$evlbl[$mod] = ($pmodule == $mod ? 'selected' : '');\n\t\t\t}\n\t\t\t$editview_label[] = $evlbl;\n\t\t\t$fieldvalue[] = $parent_name;\n\t\t\t$fieldvalue[] = $parent_id;\n\t\t}\n\t} elseif ($uitype == 9 || $uitype == 7) {\n\t\t$editview_label[] = getTranslatedString($fieldlabel, $module_name);\n\t\t$fldrs = $adb->pquery('select typeofdata from vtiger_field where vtiger_field.fieldname=? and vtiger_field.tabid=?', array($fieldname, getTabid($module_name)));\n\t\t$typeofdata = $adb->query_result($fldrs, 0, 0);\n\t\t$typeinfo = explode('~', $typeofdata);\n\t\tif ($typeinfo[0]=='I') {\n\t\t\t$fieldvalue[] = $value;\n\t\t} else {\n\t\t\t$currencyField = new CurrencyField($value);\n\t\t\t$decimals = CurrencyField::getDecimalsFromTypeOfData($typeofdata);\n\t\t\t$currencyField->initialize($current_user);\n\t\t\t$currencyField->setNumberofDecimals(min($decimals, $currencyField->getCurrencyDecimalPlaces()));\n\t\t\t$fieldvalue[] = $currencyField->getDisplayValue(null, true, true);\n\t\t}\n\t} elseif ($uitype == 71 || $uitype == 72) {\n\t\t$currencyField = new CurrencyField($value);\n\t\t// Some of the currency fields like Unit Price, Total, Sub-total etc of Inventory modules, do not need currency conversion\n\t\tif (!empty($col_fields['record_id']) && $uitype == 72) {\n\t\t\tif ($fieldname == 'unit_price') {\n\t\t\t\t$rate_symbol = getCurrencySymbolandCRate(getProductBaseCurrency($col_fields['record_id'], $module_name));\n\t\t\t\t$currencySymbol = $rate_symbol['symbol'];\n\t\t\t} else {\n\t\t\t\t$currency_info = getInventoryCurrencyInfo($module_name, $col_fields['record_id']);\n\t\t\t\t$currencySymbol = $currency_info['currency_symbol'];\n\t\t\t}\n\t\t\t$fieldvalue[] = $currencyField->getDisplayValue(null, true);\n\t\t} else {\n\t\t\t$decimals = CurrencyField::getDecimalsFromTypeOfData($typeofdata);\n\t\t\t$currencyField->initialize($current_user);\n\t\t\t$currencyField->setNumberofDecimals(min($decimals, $currencyField->getCurrencyDecimalPlaces()));\n\t\t\t$fieldvalue[] = $currencyField->getDisplayValue(null, false, true);\n\t\t\t$currencySymbol = $currencyField->getCurrencySymbol();\n\t\t}\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name).': ('.$currencySymbol.')';\n\t} elseif ($uitype == 79) {\n\t\tif ($value != '') {\n\t\t\t$purchaseorder_name = getPoName($value);\n\t\t} elseif (isset($_REQUEST['purchaseorder_id']) && $_REQUEST['purchaseorder_id'] != '') {\n\t\t\t$value = $_REQUEST['purchaseorder_id'];\n\t\t\t$purchaseorder_name = getPoName($value);\n\t\t} else {\n\t\t\t$purchaseorder_name = '';\n\t\t}\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$fieldvalue[] = $purchaseorder_name;\n\t\t$fieldvalue[] = $value;\n\t} elseif ($uitype == 30) {\n\t\tif (empty($value)) {\n\t\t\t$SET_REM = '';\n\t\t} else {\n\t\t\t$SET_REM = 'CHECKED';\n\t\t}\n\t\tif (empty($col_fields[$fieldname])) {\n\t\t\t$col_fields[$fieldname] = 0;\n\t\t}\n\t\t$rem_days = floor($col_fields[$fieldname]/(24*60));\n\t\t$rem_hrs = floor(($col_fields[$fieldname]-$rem_days*24*60)/60);\n\t\t$rem_min = ($col_fields[$fieldname]-$rem_days*24*60)%60;\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$day_options = getReminderSelectOption(0, 31, 'remdays', $rem_days);\n\t\t$hr_options = getReminderSelectOption(0, 23, 'remhrs', $rem_hrs);\n\t\t$min_options = getReminderSelectOption(10, 59, 'remmin', $rem_min);\n\t\t$fieldvalue[] = array(\n\t\t\tarray(0, 32, 'remdays', getTranslatedString('LBL_DAYS', 'cbCalendar'), $rem_days),\n\t\t\tarray(0, 24, 'remhrs', getTranslatedString('LBL_HOURS', 'cbCalendar'), $rem_hrs),\n\t\t\tarray(10, 60, 'remmin', getTranslatedString('LBL_MINUTES', 'cbCalendar').'&nbsp;&nbsp;'.getTranslatedString('LBL_BEFORE_EVENT', 'cbCalendar'), $rem_min)\n\t\t);\n\t\t$fieldvalue[] = array($SET_REM,getTranslatedString('LBL_YES'),getTranslatedString('LBL_NO'));\n\t\t$SET_REM = '';\n\t} elseif ($uitype == 115) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$options = array();\n\t\tforeach (['Active', 'Inactive'] as $pickListValue) {\n\t\t\tif ($value == $pickListValue) {\n\t\t\t\t$chk_val = 'selected';\n\t\t\t} else {\n\t\t\t\t$chk_val = '';\n\t\t\t}\n\t\t\t$options[] = array(getTranslatedString($pickListValue), $pickListValue, $chk_val );\n\t\t}\n\t\t$fieldvalue [] = $options;\n\t\t$fieldvalue [] = is_admin($current_user);\n\t} elseif ($uitype == 117) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$pick_query=\"select * from vtiger_currency_info where currency_status = 'Active' and deleted=0\";\n\t\t$pickListResult = $adb->pquery($pick_query, array());\n\t\t$noofpickrows = $adb->num_rows($pickListResult);\n\n\t\t$options = array();\n\t\tfor ($j = 0; $j < $noofpickrows; $j++) {\n\t\t\t$pickListValue=$adb->query_result($pickListResult, $j, 'currency_name');\n\t\t\t$currency_id=$adb->query_result($pickListResult, $j, 'id');\n\t\t\tif ($value == $currency_id) {\n\t\t\t\t$chk_val = 'selected';\n\t\t\t} else {\n\t\t\t\t$chk_val = '';\n\t\t\t}\n\t\t\t$options[$currency_id] = array($pickListValue=>$chk_val );\n\t\t}\n\t\t$fieldvalue [] = $options;\n\t\t$fieldvalue [] = is_admin($current_user);\n\t} elseif ($uitype ==98) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$fieldvalue[]=$value;\n\t\t$fieldvalue[]=getRoleName($value);\n\t\t$fieldvalue[]=is_admin($current_user);\n\t} elseif ($uitype == 101) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$fieldvalue[] = getOwnerName($value);\n\t\t$fieldvalue[] = $value;\n\t} elseif ($uitype == 26) {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$folderid=$col_fields['folderid'];\n\t\t$res = $adb->pquery('select foldername from vtiger_attachmentsfolder where folderid=?', array($folderid));\n\t\t$foldername = $adb->query_result($res, 0, 'foldername');\n\t\tif ($foldername != '' && $folderid != '') {\n\t\t\t$fldr_name[$folderid]=$foldername;\n\t\t}\n\t\t$res=$adb->pquery('select foldername,folderid from vtiger_attachmentsfolder order by foldername', array());\n\t\tfor ($i=0; $i<$adb->num_rows($res); $i++) {\n\t\t\t$fid=$adb->query_result($res, $i, 'folderid');\n\t\t\t$fldr_name[$fid]=$adb->query_result($res, $i, 'foldername');\n\t\t}\n\t\t$fieldvalue[] = $fldr_name;\n\t} elseif ($uitype == 27) {\n\t\tif ($value == 'E') {\n\t\t\t$external_selected = 'selected';\n\t\t\t$internal_selected = '';\n\t\t\t$filename = $col_fields['filename'];\n\t\t} else {\n\t\t\t$external_selected = '';\n\t\t\t$internal_selected = 'selected';\n\t\t\t$filename = $col_fields['filename'];\n\t\t}\n\t\t$editview_label[] = array(getTranslatedString('Internal'), getTranslatedString('External'));\n\t\t$editview_label[] = array($internal_selected, $external_selected);\n\t\t$editview_label[] = array('I','E');\n\t\t$editview_label[] = getTranslatedString($fieldlabel, $module_name);\n\t\t$fieldvalue[] = $value;\n\t\t$fieldvalue[] = $filename;\n\t} elseif ($uitype == '31') {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$options = array();\n\t\t$themeList = get_themes();\n\t\tforeach ($themeList as $theme) {\n\t\t\tif ($value == $theme) {\n\t\t\t\t$selected = 'selected';\n\t\t\t} else {\n\t\t\t\t$selected = '';\n\t\t\t}\n\t\t\t$options[] = array(getTranslatedString($theme), $theme, $selected);\n\t\t}\n\t\t$fieldvalue [] = $options;\n\t} elseif ($uitype == '32') {\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\t$options = array();\n\t\t$languageList = Vtiger_Language::getAll();\n\t\tforeach ($languageList as $prefix => $label) {\n\t\t\tif ($value == $prefix) {\n\t\t\t\t$selected = 'selected';\n\t\t\t} else {\n\t\t\t\t$selected = '';\n\t\t\t}\n\t\t\t$options[] = array(getTranslatedString($label), $prefix, $selected);\n\t\t}\n\t\t$fieldvalue [] = $options;\n\t} else {\n\t\t//Added condition to set the subject if click Reply All from web mail\n\t\tif ($_REQUEST['module'] == 'Emails' && !empty($_REQUEST['mg_subject'])) {\n\t\t\t$value = $_REQUEST['mg_subject'];\n\t\t}\n\t\t$editview_label[]=getTranslatedString($fieldlabel, $module_name);\n\t\tif ($fieldname == 'fileversion') {\n\t\t\tif (empty($value)) {\n\t\t\t\t$value = '';\n\t\t\t} else {\n\t\t\t\t$fieldvalue[] = $value;\n\t\t\t}\n\t\t} else {\n\t\t\t$fieldvalue[] = $value;\n\t\t}\n\t}\n\t$final_arr[]=$ui_type;\n\t$final_arr[]=$editview_label;\n\t$final_arr[]=$editview_fldname;\n\t$final_arr[]=$fieldvalue;\n\tif (!empty($typeofdata)) {\n\t\t$type_of_data = explode('~', $typeofdata);\n\t\t$final_arr[] = $type_of_data[1];\n\t} else {\n\t\t$final_arr[] = 'O';\n\t}\n\t$log->debug('< getOutputHtml');\n\treturn $final_arr;\n}", "function get_field_html( $setting_name, $field_type = 'text', $atts = [] ) {\n ob_start();\n\n if ( 'license_key' == $setting_name ) : ?>\n\n <input type=\"text\" class=\"facetwp-license\" style=\"width:300px\" value=\"<?php echo FWP()->helper->get_license_key(); ?>\"<?php echo defined( 'FACETWP_LICENSE_KEY' ) ? ' disabled' : ''; ?> />\n <div @click=\"activate\" class=\"btn-normal btn-gray btn-small\"><?php _e( 'Activate', 'fwp' ); ?></div>\n <div class=\"facetwp-activation-status field-notes\"><?php echo $this->get_activation_status(); ?></div>\n\n<?php elseif ( 'gmaps_api_key' == $setting_name ) : ?>\n\n <input type=\"text\" v-model=\"app.settings.gmaps_api_key\" style=\"width:300px\" />\n <a href=\"https://developers.google.com/maps/documentation/javascript/get-api-key\" target=\"_blank\"><?php _e( 'Get an API key', 'fwp' ); ?></a>\n\n<?php elseif ( 'separators' == $setting_name ) : ?>\n\n 34\n <input type=\"text\" v-model=\"app.settings.thousands_separator\" style=\"width:20px\" />\n 567\n <input type=\"text\" v-model=\"app.settings.decimal_separator\" style=\"width:20px\" />\n 89\n\n<?php elseif ( 'export' == $setting_name ) : ?>\n\n <select class=\"export-items\" multiple=\"multiple\" style=\"width:250px; height:100px\">\n <?php foreach ( $this->get_export_choices() as $val => $label ) : ?>\n <option value=\"<?php echo $val; ?>\"><?php echo $label; ?></option>\n <?php endforeach; ?>\n </select>\n <div class=\"btn-normal btn-gray export-submit\">\n <?php _e( 'Export', 'fwp' ); ?>\n </div>\n\n<?php elseif ( 'import' == $setting_name ) : ?>\n\n <div><textarea class=\"import-code\" placeholder=\"<?php _e( 'Paste the import code here', 'fwp' ); ?>\"></textarea></div>\n <div><input type=\"checkbox\" class=\"import-overwrite\" /> <?php _e( 'Overwrite existing items?', 'fwp' ); ?></div>\n <div style=\"margin-top:5px\">\n <div class=\"btn-normal btn-gray import-submit\"><?php _e( 'Import', 'fwp' ); ?></div>\n </div>\n\n<?php elseif ( 'dropdown' == $field_type ) : ?>\n\n <select class=\"facetwp-setting slim\" v-model=\"app.settings.<?php echo $setting_name; ?>\">\n <?php foreach ( $atts['choices'] as $val => $label ) : ?>\n <option value=\"<?php echo $val; ?>\"><?php echo $label; ?></option>\n <?php endforeach; ?>\n </select>\n\n<?php elseif ( 'toggle' == $field_type ) : ?>\n<?php\n\n$true_value = isset( $atts['true_value'] ) ? $atts['true_value'] : 'yes';\n$false_value = isset( $atts['false_value'] ) ? $atts['false_value'] : 'no';\n\n?>\n <label class=\"facetwp-switch\">\n <input\n type=\"checkbox\"\n v-model=\"app.settings.<?php echo $setting_name; ?>\"\n true-value=\"<?php echo $true_value; ?>\"\n false-value=\"<?php echo $false_value; ?>\"\n />\n <span class=\"facetwp-slider\"></span>\n </label>\n\n<?php endif;\n\n return ob_get_clean();\n }", "function inputField($type, $name, $value=\"\", $attrs=NULL, $data=NULL, $help_text=NULL) {\n global $loc;\n $s = \"\";\n if (isset($_SESSION['postVars'])) {\n $postVars = $_SESSION['postVars'];\n } else {\n $postVars = array();\n }\n if (isset($postVars[$name])) {\n $value = $postVars[$name];\n }\n if (isset($_SESSION['pageErrors'])) {\n $pageErrors = $_SESSION['pageErrors'];\n } else {\n $pageErrors = array();\n }\n if (isset($pageErrors[$name])) {\n $s .= '<div id=\"myModal\" class=\"modal fade\" role=\"dialog\">\n <div class=\"modal-dialog\">\n\n <!-- Modal content-->\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <!--<button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>-->\n <h4 class=\"modal-title\">Error</h4>\n </div>\n <div class=\"modal-body\">\n <h5 style=\"margin: 0px\">'.H($pageErrors[$name]).'</h5>\n </div>\n <div class=\"modal-footer\">\n <button id=\"close\" type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cerrar</button>\n </div>\n </div>\n\n </div>\n </div>';\n }\n if (!$attrs) {\n $attrs = array();\n }\n if (!isset($attrs['onChange'])) {\n $attrs['onChange'] = 'modified=true';\n }\n switch ($type) {\n // TODO: radio\n case 'select':\n $s .= '<select class=\"form-control\" id=\"'.H($name).'\" name=\"'.H($name).'\" ';\n foreach ($attrs as $k => $v) {\n $s .= H($k).'=\"'.H($v).'\" ';\n }\n $s .= \">\\n\";\n foreach ($data as $val => $desc) {\n $s .= '<option value=\"'.H($val).'\" ';\n if (strtolower($value) == strtolower($val)) {\n $s .= \" selected\";\n }\n $s .= \">\".H($desc).\"</option>\\n\";\n }\n $s .= \"</select>\\n\";\n break;\n\n case 'textarea':\n $s .= '<textarea class=\"form-control\" name=\"'.H($name).'\" ';\n foreach ($attrs as $k => $v) {\n $s .= H($k).'=\"'.H($v).'\" ';\n }\n $s .= \">\".H($value).\"</textarea>\";\n break;\n\n case 'checkbox':\n $s .= '<input type=\"checkbox\" ';\n $s .= 'name=\"'.H($name).'\" ';\n $s .= 'value=\"'.H($data).'\" ';\n if ($value == $data) {\n $s .= \"checked \";\n }\n foreach ($attrs as $k => $v) {\n $s .= H($k).'=\"'.H($v).'\" ';\n }\n $s .= \"/>\";\n break;\n\n case 'date':\n $thisDate = explode(' ', date('d m Y'));\n $dateInputName = H($name);\n $s .= '<select class=\"form-control\" id=\"' . str_replace(array('[',']'),array(''), $dateInputName).'_day\" name=\"'.$dateInputName.'_day\">' . \"\\n\";\n for ($i = 1; $i <= 31; $i++) {\n $day = str_pad($i, 2, '0', STR_PAD_LEFT); \n $s .= ' <option value=\"' . $i . '\" ' . ($i == 0 + $thisDate[0] ? ' selected=\"selected\"':'') . '>' . $i . \"</option>\\n\";\n }\n $s .= \"</select><br>\\n\";\n $s .= '<select class=\"form-control\" id=\"' . str_replace(array('[',']'),array(''), $dateInputName).'_month\" name=\"'.$dateInputName.'_month\">' . \"\\n\";\n for ($i = 1; $i <= 12; $i++) {\n $mon = str_pad($i, 2, '0', STR_PAD_LEFT); \n $s .= ' <option value=\"' . $mon . '\"' . ($mon == $thisDate[1] ? ' selected=\"selected\"':'') . '>' . $loc->getText('reportDateMonth' . $mon) . \"</option>\\n\";\n }\n $s .= \"</select><br>\\n\";\n \n $s .= '<select class=\"form-control\" id=\"' . str_replace(array('[',']'),array(''), $dateInputName).'_year\" name=\"'.$dateInputName.'_year\">' . \"\\n\";\n \n for ($i = -20; $i <= 20; $i++) {\n $y = $thisDate[2] + $i;\n $s .= ' <option value=\"' . $y . '\" '. ($i == 0 ? 'selected=\"select\"' : '') . '>' . $y . \"</option>\\n\";\n }\n $s .= \"</select>\\n\";\n \n // Javascript code for collecting date\n $s .= '<input type=\"hidden\" id=\"' . $dateInputName . '\" name=\"' . $dateInputName . '\">\n <script>\n var updateDateInput_' . $dateInputName . ' = function() {\n document.getElementById(\"' . $dateInputName . '\").value = \n document.getElementById(\"' . $dateInputName . '_year\").value + \"-\" +\n document.getElementById(\"' . $dateInputName . '_month\").value + \"-\" +\n document.getElementById(\"' . $dateInputName . '_day\").value;\n \n console.log(day.value);\n };\n \n document.getElementById(\"' . $dateInputName . '_day\").onchange = updateDateInput_' . $dateInputName . ';\n document.getElementById(\"' . $dateInputName . '_month\").onchange = updateDateInput_' . $dateInputName . ';\n document.getElementById(\"' . $dateInputName . '_year\").onchange = updateDateInput_' . $dateInputName . ';\n </script>\n ';\n \n break;\n\n default:\n $s .= '<input class=\"form-control\" type=\"'.H($type).'\" ';\n $s .= 'id=\"' . str_replace(array('[',']'),array(''), H($name)).'\" name=\"'.H($name).'\" ';\n if ($value != \"\") {\n $s .= 'value=\"'.H($value).'\" ';\n }\n foreach ($attrs as $k => $v) {\n $s .= H($k).'=\"'.H($v).'\" ';\n }\n $s .= \"/>\";\n\n // Display a help text under the widget.\n // TODO: add this into another widgets.\n if (isset($help_text)) {\n $s .= \"<div>\". $help_text .\"</div>\";\n }\n\n break;\n\n }\n return $s;\n}", "public function renderEditModalHTML()\n {\n $input_form = \"<div class=\\\"form-group\\\">\n <label for=\\\"{{label}}\\\">{{label}}</label>\n <input type=\\\"{{type}}\\\" class=\\\"form-control\\\" id=\\\"edit_input_{{label}}\\\" {{otherAttr}}>\n </div>\";\n $break_line = \"\\n\";\n\n $form_result = \"\";\n $columns = $this->getShowColumn();\n foreach ($columns as $name => $type) {\n $input_type = 'text';\n $other_attr = '';\n\n if ( in_array($name,self::DISABLED_COLUMNS)){\n $other_attr = $other_attr.' disabled';\n }\n\n if ($type == \"bigint\" OR $type == \"integer\"){\n $input_type = 'number';\n }elseif ($type == \"string\"){\n $input_type = 'text';\n }elseif ($type == \"datetime\"){\n $input_type = 'datetime-local';\n }\n\n $one_form = str_replace(\n [\n '{{label}}',\n '{{type}}',\n '{{otherAttr}}',\n ],\n [\n $name,\n $input_type,\n $other_attr,\n ],\n $input_form\n );\n $form_result = $form_result.$one_form.$break_line;\n }\n\n return $form_result;\n }", "public function getPage()\n\t{\n //@return : $stri_html => l'affichage html du textbox\n \t \n $obj_table=new table();\n $obj_table_tr=new tr();\n $obj_table_tr->addTd($this->obj_form->getStartBalise());\n $obj_table_tr->addTd($this->obj_lb_page->htmlValue());\n $obj_table_tr->addTd($this->obj_tb_page->htmlValue());\n $obj_table_tr->addTd($this->obj_bt_page->htmlValue());\n $obj_table_tr->addTd($this->obj_form->getEndBalise());\n $obj_table->insertTr($obj_table_tr);\n $obj_table->setBorder(0);\n \n \n $stri_html=$this->javascripter();\n $stri_html.=$obj_table->htmlValue();\n return $stri_html;\n\t}", "function wppb_rf_epf_disable_select_field_options() {\r\n echo \"<script type=\\\"text/javascript\\\">wppb_disable_select_field_options();</script>\";\r\n}", "protected function setDbalInputFieldsToRender() {}", "protected function getInput()\n\t{\n $doc = JFactory::getDocument();\n $doc->addScript(Juri::base(true) . '/components/com_easysdi_map/models/fields/dynamictable.js?v=' . sdiFactory::getSdiFullVersion());\n\t\t// Initialize variables.\n\t\t$html = array();\n $html[] = '<table class=\"table table-striped table-hover\" id=\"tab-dyn\">';\n $html[] = '<thead>';\n $html[] = '<tr>';\n $html[] = '<th class=\"text-center hasTip\" title=\"'.JText::_('COM_EASYSDI_MAP_FORM_DESC_MAP_DEFAULTLEVEL').'\">';\n $html[] = JText::_('COM_EASYSDI_MAP_FORM_LBL_MAP_DEFAULTLEVEL');\n $html[] = '</th>';\n $html[] = '<th class=\"text-center hasTip\" title=\"'.JText::_('COM_EASYSDI_MAP_FORM_DESC_MAP_LEVELLABEL').'\" >';\n $html[] = JText::_('COM_EASYSDI_MAP_FORM_LBL_MAP_LEVELLABEL');\n $html[] = '</th>';\n $html[] = '<th class=\"text-center hasTip\" title=\"'.JText::_('COM_EASYSDI_MAP_FORM_DESC_MAP_LEVELCODE').'\">';\n $html[] = JText::_('COM_EASYSDI_MAP_FORM_LBL_MAP_LEVELCODE');\n $html[] = '</th>'; \n $html[] = '<th class=\"text-center\">';\n $html[] = '</tr>';\n $html[] = '</thead>';\n $html[] = '<tbody>';\n $html[] = '<tr id=\"level1\"></tr>';\n $html[] = '</tbody>';\n $html[] = '</table>';\n\n $html[] = '<a id=\"add_row\" class=\"btn btn-success pull-right\">Add Row</a>';\n\t\treturn implode($html);\n\t}", "function grantsCreateFieldHtml( $field_name = FALSE, $field_value = FALSE, $options = array() )\n{\n global $db, $grants_fields, $grants_primary_key;\n if ($field_name === FALSE or $field_value === FALSE) return FALSE; \n\n // print_r($grants_fields);\n // echo $field_name;\n\n if ( !in_array($field_name, array_keys($grants_fields)) ){\n trigger_error($field_name . ' is not a recognized field in the grants table.');\n return FALSE;\n }\n\n $field_value = encode($field_value);\n\n $return_html = '';\n\n // set up opening divs and spans\n $return_html .= '<div class=\"field\">';\n $return_html .= '<div class=\"form-group\">';\n\n // set up the label\n $return_html .= '<label class=\"control-label col-xs-4\" for=\"'. $field_name . '\">'. convertFieldName($field_name) .'</label>';\n\n // handle special fields, e.g. drop down lookups\n $special_fields = array('status');\n if ( in_array($field_name, $special_fields) ){\n switch ($field_name) {\n case 'status':\n\n $lookups = getLookups('grants', 'status');\n\n // set up the select element\n $return_html .= '<div class=\"col-xs-8\">';\n $return_html .= '<select class=\"form-control \" id=\"' . $field_name . '\" name=\"'. $field_name .'\">';\n\n // deal with the possibility that the db has a value that is not on the lookup list\n if ( !empty($field_value) && array_search($field_value, array_column($lookups, 'lookup_value')) === FALSE ){\n $return_html .= '<option class=\"drop-down-option-default\" value=\"\" selected disabled>'. $field_value .' [invalid option]</option>';\n } else {\n $return_html .= '<option class=\"drop-down-option-default\" value=\"\"></option>';\n }\n foreach ($lookups as $key => $lookup) {\n $return_html .= '<option class=\"drop-down-option\" value=\"'. $lookup['lookup_value'] .'\" ';\n if ( $lookup['lookup_value'] === $field_value ) {\n $return_html .= 'selected';\n }\n $return_html .= '>'. $lookup['label'] . '</option>';\n }\n $return_html .= '</select>';\n $return_html .= '</div>';\n break;\n }\n } else {\n // do stuff for normal fields\n\n // figure out if i have integer, string, text, date, etc.\n // based on the DBAL Types\n $field_type = $grants_fields[$field_name]->getType();\n\n // echo \"my field type: \";\n // echo $field_type;\n switch ($field_type) {\n case 'Integer':\n case 'Decimal':\n case 'String':\n case 'Date':\n // add a normal input field for all four types\n $return_html .= '<div class=\"col-xs-8\">';\n $return_html .= '<input class=\"form-control\" type=\"text\" id=\"' . $field_name . '\" name=\"'. $field_name .'\" value=\"'. $field_value .'\"';\n if ($field_name === $grants_primary_key) {\n $return_html .= ' readonly';\n }\n $return_html .= ' />';\n $return_html .= '</div>';\n break;\n // TODO make date fields a date picker input\n case 'Text':\n $return_html .= '<div class=\"col-xs-8\">';\n $return_html .= '<textarea class=\"form-control\" rows=\"2\" id=\"'. $field_name . '\" name=\"'. $field_name . '\">' . $field_value . '</textarea>';\n $return_html .= '</div>';\n break;\n default:\n // TODO add a default\n break;\n } // end switch\n } // end if field name is in special fields\n\n // apply options\n\n // close the divs and spans\n $return_html .= '</div>'; // close form-group; \n $return_html .= '</div>'; // close field;\n\n return $return_html;\n\n}", "public function displayAsHTML() {\n // The page parameter of the form action must be assigned a value that corresponds to the switch statement string in index.php\n\n $customerDDHtml = $this->customerDropDown(\"customerId\", $this->customerId);\n\n $outputHtml = <<<EOT\n <form action=\"index.php?page=properties\" method=\"post\">\n <input type=\"hidden\" name=\"action\" value=\"save\" />\n <input type=\"hidden\" name=\"propertyId\" value=\"$this->propertyId\" />\n <table width=\"90%\"><tr><td><div class=\"instructions\" id=\"instructionText\"></div></td></tr></table>\n <div class=\"dataentry\">\n <table width=\"90%\">\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">Property Owner:</p></td>\n <td colspan=\"3\">$customerDDHtml</td>\n </tr>\n <tr><td colspan=\"4\"><p class=\"pageedit\"><strong>Tenant Information</strong></p></td></tr>\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">First Name:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"40\" size=\"40\" name=\"firstName\" id=\"firstName\" value=\"$this->firstName\" onfocus=\"prHelpText(event, true);\" onblur=\"prHelpText(event, false);\" /></td>\n <td width=\"15%\"><p class=\"pageedit\">Last Name:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"40\" size=\"40\" name=\"lastName\" id=\"lastName\" value=\"$this->lastName\" onfocus=\"prHelpText(event, true);\" onblur=\"prHelpText(event, false);\" /></td>\n </tr>\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">Phone:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"10\" size=\"11\" name=\"phone\" id=\"phone\" value=\"$this->phone\" onfocus=\"prHelpText(event, true);\" onblur=\"prHelpText(event, false);\" /></td>\n <td width=\"15%\"><p class=\"pageedit\">E-mail:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"40\" size=\"40\" name=\"email\" id=\"email\" value=\"$this->email\" onfocus=\"prHelpText(event, true);\" onblur=\"prHelpText(event, false);\" /></td>\n </tr>\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">Address:</p></td>\n <td colspan=\"3\"><input type=\"text\" maxlength=\"255\" size=\"80\" name=\"address\" id=\"address\" value=\"$this->address\" /></td>\n </tr>\nEOT;\n\n $outputHtml .= $this->errorRow(\"address\");\n $defaultState = $this->state;\n if (!$defaultState) {\n $defaultState = \"TX\";\n }\n $stateDDHtml = stateDropDown(\"state\", $defaultState);\n $outputHtml .= <<<EOT\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">City:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"40\" size=\"40\" name=\"city\" id=\"city\" value=\"$this->city\" /></td>\n <td width=\"15%\"><p class=\"pageedit\">State/Zip:</p></td>\n <td width=\"35%\">\n <table>\n <tr>\n <td width=\"50%\">\n $stateDDHtml\n </td>\n <td width=\"50%\">\n <input type=\"text\" maxlength=\"5\" size=\"6\" name=\"zip\" id=\"zip\" value=\"$this->zip\" />\n </td>\n </tr>\n </table>\n </td>\n </tr>\nEOT;\n\n\n $outputHtml .= $this->errorRow(\"city\", \"state\", \"zip\");\n $outputHtml .= <<<EOT\n <tr>\n <td><p class=\"pageedit\">Notes:</p></td>\n <td colspan=\"3\"><textarea name=\"notes\" id=\"notes\" cols=\"80\" rows=\"2\">$this->notes</textarea></td>\n </tr>\n\n <tr>\n <td colspan=\"4\"><input type=\"submit\" value=\"Save\" /><a href=\"index.php?page=properties\"><input type=\"button\" value=\"New\" /></a></td>\n </tr>\n <tr>\n <td colspan=\"4\"><p class=\"instructions\">$this->statusMessage</p></td>\n </tr>\n </table>\n </div>\n </form>\n <br><br>\nEOT;\n\n\n $outputHtml .= <<<EOT\n <table class=\"searchresults\">\n <tr>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Customer Name</p></td>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Customer Contact</p></td>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Tenant Name</p></td>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Tenant Contact</p></td>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Address</p></td>\n </tr>\nEOT;\n\n foreach ($this->propertyList as $key => $tableRow) {\n $outputHtml .= '<tr>' . $tableRow . '</tr>';\n }\n\n $customerDDHtml = $this->customerDropDown(\"searchCustomerId\", '', true);\n $outputHtml .= <<<EOT\n </table>\n <br><br>\n <form action=\"index.php?page=properties\" method=\"post\">\n <input type=\"hidden\" name=\"listby\" value=\"name\" />\n <p class=\"pageedit\"><strong>Find property by customer, tenant name, or address</strong></p>\n <p class=\"pageedit\">Customer: $customerDDHtml</p>\n <p class=\"pageedit\">First name: <input type=\"text\" maxlength=\"40\" size=\"40\" name=\"searchFName\" id=\"searchFName\" /></p>\n <p class=\"pageedit\">Last name: <input type=\"text\" maxlength=\"40\" size=\"40\" name=\"searchLName\" id=\"searchLName\" /></p>\n <p class=\"pageedit\">Address: <input type=\"text\" maxlength=\"255\" size=\"80\" name=\"searchAddress\" id=\"searchAddress\" /></p>\n <input type=\"submit\" value=\"Search\">\n </form>\nEOT;\n\n return $outputHtml;\n }", "protected function html()\r\n\t{\r\n\r\n\t\t$data = $this->form;\r\n\t\t$f = $data['form'];\r\n\r\n\t\tif($f == 'select'){\r\n\t\t\t$this->selectLink();\r\n\t\t}\r\n\r\n\t\tif($f == 'file'){\r\n\t\t\t$this->fileLink();\r\n\t\t}\r\n\r\n\t\tif($f == 'textarea'){\r\n\t\t\t$this->success = $this->textarea();\r\n\t\t}\r\n\r\n\t\tif($f == 'radio' || $f=='checkbox'){\r\n\t\t\t$this->chooseLink();\r\n\t\t}\r\n\t\tif($f == 'hidden'|| $f =='password'|| $f =='text'|| $f =='number'|| $f =='date'){\r\n\t\t\t$this->oneLink();\r\n\t\t}\r\n\t\tif($f == 'editor'){\r\n\t\t\t$this->oneLink();\r\n\t\t}\r\n\t\tif(strpos($f,'extend')!==false){\r\n\t\t\t$this->oneLink();\r\n\t\t}\r\n\t\tif($this->continue){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->replace();\r\n\t}", "protected function fetchAdminFormElement() {\n $html = '';\n return $html;\n }", "public function returnFieldJS()\n {\n return \"\n console.log(this);\n console.log(jQuery('[name$=\\\"[copyright]\\\"'));\n \";\n }", "function showInputFields(){\n \t$HTML = '';\n\n \t//name field\n\t\t\tif ($this->shownamefield) {\n\t\t\t\t$text = '<input id=\"wz_11\" type=\"text\" size=\"'. $this->fieldsize.'\" value=\"'. addslashes(_JNEWS_NAME).'\" class=\"inputbox\" name=\"name\" onblur=\"if(this.value==\\'\\') this.value=\\''. addslashes(_JNEWS_NAME).'\\';\" onfocus=\"if(this.value==\\''. addslashes(_JNEWS_NAME).'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t$HTML .= jnews::printLine($this->linear, $text);\n\t\t\t} else {\n\t\t\t\t$text = '<input id=\"wz_11\" type=\"hidden\" value=\"\" name=\"name\" />';\n\t\t\t}\n\n\t\t //email field\n\t\t $text = '<input id=\"wz_12\" type=\"email\" size=\"' .$this->fieldsize .'\" value=\"\" class=\"inputbox\" name=\"email\" placeholder=\"'.addslashes(_JNEWS_YOUR_EMAIL_ADDRESS).'\"/>';\n\t\t //onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes(_JNEWS_EMAIL) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes(_JNEWS_EMAIL) .'\\') this.value=\\'\\' ; \" \n\t\t $HTML .= jnews::printLine($this->linear, $text);\n\n\t\t\t//for field columns\n\t\t\tif($GLOBALS[JNEWS.'level'] > 2){//check if the version of jnews is pro\n\n\t\t\t\tif ($this->column1){//show column1 in the subscribers module\n\t\t\t\t\t$text = '<input id=\"wz_13\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column1_name']) .'\" class=\"inputbox\" name=\"column1\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column1_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column1_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t\t$HTML .= jnews::printLine($this->linear, $text);\n\t\t\t\t}\n\n\t\t\t if ($this->column2){//show column2 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_14\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column2_name']) .'\" class=\"inputbox\" name=\"column2\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column2_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column2_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\n\t\t\t if ($this->column3){//show column3 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_15\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column3_name']) .'\" class=\"inputbox\" name=\"column3\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column3_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column3_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\n\t\t\t if ($this->column4){//show column4 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_16\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column4_name']) .'\" class=\"inputbox\" name=\"column4\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column4_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column4_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\t\t\t if ($this->column5){//show column5 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_17\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column5_name']) .'\" class=\"inputbox\" name=\"column5\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column5_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column5_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\t\t\t}\n\n\t\t\treturn $HTML;\n }", "private function viewBuilder() {\n $html = '';\n $file = false;\n // Create fields\n foreach ($this->formDatas as $field) {\n $type = $field['type'];\n switch ($type) {\n case 'text' :\n case 'password' :\n case 'hidden' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n // Addon - 2013-07-31\n case 'date' :\n case 'datetime' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"text\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n\n\n if ($type == 'datetime') {\n $plugin = $this->addPlugin('widget', false);\n $plugin = $this->addPlugin('date');\n }\n $plugin = $this->addPlugin($type);\n if (!isset($this->js['script'])) {\n $this->js['script'] = '';\n }\n if ($type == 'datetime') {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datetimepicker({ dateFormat: \"yy-mm-dd\", timeFormat : \"HH:mm\"});});</script>';\n } else {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datepicker({ dateFormat: \"yy-mm-dd\"});});</script>';\n }\n break;\n // End Addon\n case 'select' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <select name=\"' . $field['name'] . '\">';\n // Add options\n foreach ($field['options'] as $option) {\n $html .= '\n <option value=\"' . $option . '\" <?php echo set_select(\"' . $field['name'] . '\", \"' . $option . '\"); ?>>' . $option . '</option>';\n }\n $html .= '\n </select>';\n break;\n case 'checkbox' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['checkbox'] as $option) {\n $html .= '\n <input type=\"checkbox\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'radio' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['radio'] as $option) {\n $html .= '\n <input type=\"radio\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'reset' :\n case 'submit' :\n $html .= '\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n case 'textarea' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <textarea name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\"><?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?></textarea>';\n break;\n case 'file' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"file\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" />';\n $file = true;\n break;\n }\n }\n\n $view = '\n <html>\n <head>\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo base_url() ?>assets/css/generator/' . $this->cssName . '.css\">\n '; // Addon - 2013-07-31\n foreach ($this->css as $css) {\n $view .= $css . '\n ';\n }\n foreach ($this->js as $js) {\n $view .= $js . '\n ';\n }\n // End Addon\n $view .= '\n </head>\n <body>\n <?php\n // Show errors\n if(isset($error)) {\n switch($error) {\n case \"validation\" :\n echo validation_errors();\n break;\n case \"save\" :\n echo \"<p class=\\'error\\'>Save error !</p>\";\n break;\n }\n }\n if(isset($errorfile)) {\n foreach($errorfile as $name => $value) {\n echo \"<p class=\\'error\\'>File \\\"\".$name.\"\\\" upload error : \".$value.\"</p>\";\n }\n }\n ?>\n <form action=\"<?php echo base_url() ?>' . $this->formName . '\" method=\"post\" ' . ($file == true ? 'enctype=\"multipart/form-data\"' : '') . '>\n ' . $html . '\n </form>\n </body>\n </html>';\n return array(str_replace('<', '&lt;', $view), $view);\n }", "function input_readonly_text($element_name, $values) {\r\n print '<input type=\"text\" name=\"'.$element_name.'\"id=\"'.$element_name.'\" value=\"';\r\n print html_entity_decode($values[$element_name], ENT_NOQUOTES) . '\" readonly>';\r\n}", "public function htmlForm(htmlPrps $htmlprps,$fields){\n\n }", "function crea_form_input2($arcampi,$arcampi2,$arcampi3,$script,$bottone_submit =\"salva\",$intestazione=\"Inserimento nuovo record\",$arcampi4=\"\")\n{\n?>\n <head>\n<?\n include(\"config.php\");\n echo \"<link rel=stylesheet type=text/css href=\\\"$fogliostile\\\">\";\n?>\n <script language=javascript>\n function cambia_sfondo(el,focus_o_blur)\n {\n if (focus_o_blur == 1)\n {\n el.style.fontfamily = \"Arial\";\n el.style.background=\"#99ccff\";\n \n }\n else\n {\n el.style.fontfamily = \"Arial\";\n el.style.background=\"#f0f0f0\";\n \n }\n }\n </script>\n </head>\n <?\n echo \"<h3 align=center>$intestazione</h3>\";\n form_crea(\"datainput\",1,$script);\n echo \"<table id=dataentry bgcolor=#daab59 align=center>\";\n $primavoceselect = true;\n while(list($key,$value) = each($arcampi))\n {\n if ($arcampi2[$key] == \"select\")\n {\n \t echo \"<tr><td><b>\" . (($arcampi4 == \"\") ? \"$key:\" : $arcampi4[$key]) . \"</b></td><td><select name=$key onfocus=\\\"cambia_sfondo(this,1)\\\" onblur=\\\"cambia_sfondo(this,2)\\\">\";\n\t for($i = 0;$i < count($arcampi[$key]);$i++)\n\t if ($primavoceselect == true)\n\t {\n\t echo \"<option selected>\" . $arcampi[$key][$i] . \"</option>\";\n\t\t $primavoceselect = false;\n\t\t}\n\t else echo \"<option>\" . $arcampi[$key][$i] . \"</option>\";\n\t echo \"</select></td></tr>\";\n }\n if ($arcampi2[$key] == \"textarea\")\n {\n\t\techo \"<tr><td><b>\" . (($arcampi4 == \"\") ? \"$key:\" : $arcampi4[$key]) . \"</b></td><td><textarea name=$key rows=4 cols=65 onfocus=\\\"cambia_sfondo(this,1)\\\" onblur=\\\"cambia_sfondo(this,2)\\\">$arcampi[$key]\";\n\t\techo \"</textarea></td></tr>\";\n\t}\n\tif (($arcampi2[$key] == \"hidden\"))\n\t echo \"<tr><td><b>&nbsp;</b></td><td><input type=$arcampi2[$key] name=$key size=$arcampi3[$key] maxlength=$arcampi3[$key] onfocus=\\\"cambia_sfondo(this,1)\\\" onblur=\\\"cambia_sfondo(this,2)\\\" value=\\\"$arcampi[$key]\\\"></td></tr>\";\n\tif (($arcampi2[$key] != \"textarea\") & ($arcampi2[$key] != \"select\") & ($arcampi2[$key] !=\"hidden\"))\n\t echo \"<tr><td><b>\" . (($arcampi4 == \"\") ? \"$key:\" : $arcampi4[$key]) . \"</b></td><td><input type=$arcampi2[$key] name=$key size=$arcampi3[$key] maxlength=$arcampi3[$key] onfocus=\\\"cambia_sfondo(this,1)\\\" onblur=\\\"cambia_sfondo(this,2)\\\" value=\\\"$arcampi[$key]\\\"></td></tr>\";\n\n }\n echo \"<tr><td colspan=2 align=center>\";\n form_invia($bottone_submit,$bottone_submit);\n echo \"</td></tr>\";\n echo \"</table>\";\n form_chiudi();\t\n}", "function ShowTable($db,$tablename){\r\n\t//get table column titles\r\n\t$sql = \"SELECT * FROM describe_table WHERE table_name='$tablename' ORDER BY id\";\r\n\t$result = mysqli_query($db,$sql);\r\n\tif (!$result) {\r\n\t\techo 'Show Table Failed.';\r\n\t\treturn;\r\n\t}\r\n\t$fields = mysqli_fetch_all($result,MYSQLI_ASSOC);\r\n\tmysqli_free_result($result);\r\n\t//get table content\r\n\t$fieldnames = \"\";\r\n\t$fieldstr = \"\";\r\n\t$editablestr = \"\";\r\n\tforeach($fields as $prop){\r\n\t\tif($prop[\"auth_view\"]>=$_SESSION['level']){\r\n\t\t\tif($fieldnames){\r\n\t\t\t\t$fieldnames.=\",\";\r\n\t\t\t\t$fieldstr.=\",\";\r\n\t\t\t\t$editablestr .= \",\";\r\n\t\t\t}\r\n\t\t\t$fieldnames.=\"'\".$prop[\"col_name\"].\"'\";\r\n\t\t\t$fieldstr.=$prop[\"col_name\"];\r\n\t\t\t$editablestr .= ($prop[\"auth_edit\"]>=$_SESSION['level']?1:0);\r\n\t\t}\r\n\t}\r\n\tif(!$fieldstr)return;\r\n\t$sql = \"SELECT $fieldstr FROM $tablename\";\r\n\t$result = mysqli_query($db,$sql);\r\n\tif (!$result) {\r\n\t\techo 'Show Table Failed.';\r\n\t\treturn;\r\n\t}\r\n\t$allrows = mysqli_fetch_all($result,MYSQLI_ASSOC);\r\n\tmysqli_free_result($result);\r\n?>\r\n<script>\r\neditables = [<?php echo $editablestr; ?>];\r\nfieldnames = [<?php echo $fieldnames; ?>];\r\nvar tblEdtor_<?php echo $tablename; ?> = new TableEditor(\"<?php echo $tablename; ?>\");\r\n</script>\r\n<form action=\"\" method=\"post\" id=\"tbl_form\" enctype=\"multipart/form-data\">\r\n <div class=\"container-fluid\">\r\n <div class=\"mb-2\">\r\n <button type=\"submit\" name=\"newrow\" class=\"btn btn-light btn-outline-dark text-green edttbl-add\">\r\n <i class=\"fa fa-plus-circle mr-1\"></i>Add New</button>\r\n <input type=\"hidden\" name=\"tblname\" value=\"<?php echo $tablename; ?>\">\r\n </div>\r\n <table id=\"<?php echo $tablename; ?>\" class=\"table table-bordered table-hover text-center\">\r\n <thead>\r\n <tr>\r\n <?php foreach ($fields as $row) { ?>\r\n <th><?php echo $row[\"col_title\"]; ?></th>\r\n <?php }\r\n if(function_exists(\"AppendTitle\"))AppendTitle($tablename);\r\n ?>\r\n <th width=\"200px\">Action</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <?php $rowidx = 1;\t\r\n foreach ($allrows as $row) { ?>\r\n <tr>\r\n <?php foreach($row as $col) { ?>\r\n <td><?php echo $col; ?></td>\r\n <?php }\r\n if(function_exists(\"AppendCol\"))AppendCol($db,$tablename,$row,$rowidx);\r\n ?>\r\n <td>\r\n <button type=\"button\" onclick=\"tblEdtor_<?php echo $tablename; ?>.onEdit(<?php echo $rowidx; ?>,this);\"\r\n class=\"btn btn-outline-info edttbl-act-btn\"><i class=\"fa fa-pencil\"></i></button>\r\n <button type=\"submit\" name=\"update\" value=\"<?php echo $row[\"id\"]; ?>\" class=\"btn btn-outline-info edttbl-act-btn\" >\r\n <i class=\"fa fa-cloud-upload\"></i>\r\n </button>\r\n <button type=\"submit\" name=\"del\" value=\"<?php echo $row[\"id\"]; ?>\" class=\"btn btn-outline-info edttbl-act-btn\" onclick=\"return onDel()\">\r\n <i class=\"fa fa-trash\"></i>\r\n </button>\r\n </td>\r\n </tr>\r\n <?php $rowidx++;} ?>\r\n </tbody>\r\n </table>\r\n </div>\r\n</form>\r\n<?php\r\n}", "public static function jsForm() {\r\n\t\t\r\n\t\t\t\treturn \r\n\t\t\t\t\t'\r\n\t\t\t\t\tfunction debugSubmit() {\r\n\t\t\t\t\t\t$(\"#debug_form_mode\").val($(\"#maquette_active\").val());\r\n\t\t\t\t\t\t$(\"#debug_form\").submit();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction debugActif() {\r\n\t\t\t\t\t\treturn ($(\"#maquette_active\").val()==1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction activerDebug() {\t\t\t\r\n\t\t\t\t\t\tif (debugActif()) {\r\n\t\t\t\t\t\t\tinitDebug();\r\n\t\t\t\t\t\t\t$(\"#debug_others\").show();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tclearDebug(true);\r\n\t\t\t\t\t\t\t$(\"#debug_others\").hide();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction setDebug() {\r\n\t\t\t\t\t\tif (debugActif()) {\r\n\t\t\t\t\t\t\t$(\"#debug_maquette\").fadeTo(0,$(\\'#maquette_opacity\\').val());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction setDebugOpacity(val) {\r\n\t\t\t\t\t\tif (debugActif()) {\r\n\t\t\t\t\t\t\t$(\\'#maquette_opacity\\').val(val);\r\n\t\t\t\t\t\t\tsetDebug();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction debugHide() {\r\n\t\t\t\t\t\t$(\"#debug_maquette\").hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction debugShow() {\r\n\t\t\t\t\t\t$(\"#debug_maquette\").show();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction initDebug() {\r\n\t\t\t\t\t\tif (debugActif()) {\r\n\t\t\t\t\t\t\tsetDebug();\r\n\t\t\t\t\t\t\tdebugShow()\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t';\r\n\t}", "function InputGen($sFieldName)\n\t\t{\n\t\t\t$sInputname = isset($this->arrFieldsMap[$sFieldName]) ? $this->arrFieldsMap[$sFieldName] : $sFieldName;\n\t\t\t$sInputType = isset($this->arrInput[$sFieldName]) ? $this->arrInput[$sFieldName] : 'text';\n\t\t\t$sDis = isset($this->arrDisabled[$sFieldName])?$this->arrDisabled[$sFieldName]:'';\n\t\t\t$sReturn = '';\n\t\t\t// kiem tra neu can thi them doan PREHTML vao\n\t\t\tif(isset($this->arrPreHTML[$sFieldName]))\n\t\t\t{\n\n\t\t\t\t$sReturn = $sReturn.$this->arrPreHTML[$sFieldName];\n\t\t\t}\n\n\t\t\tswitch($sInputType)\n\t\t\t{\n\t\t\t\tcase 'textarea':\n\t\t\t\t$sReturn = '<textarea name=\"'.$sInputname.'\" id=\"'.$sInputname.'\" cols=\"60\" rows=\"5\" style=\"overflow:auto\" class=\"input\"'.(isset($this->arrReadOnly[$sFieldName]) ? ' readonly' : '').'></textarea>';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'combobox':\n\t\t\t\t$sReturn = '<select name=\"'.$sInputname.'\" id=\"'.$sInputname.'\" style=\"width:230px\"'.(isset($this->arrReadOnly[$sFieldName]) ? ' readonly' : '').'>'.\"\\n\";\n\t\t\t\t\tif(!isset($this->arrFieldData[$sFieldName]) || !is_array($this->arrFieldData[$sFieldName]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->arrFieldData[$sFieldName] = array();\n\t\t\t\t\t}\n\t\t\t\t\tforeach($this->arrFieldData[$sFieldName] as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sReturn = $sReturn.'<option value=\"'.$key.'\">'.$value.'</option>'.\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t$sReturn = $sReturn.'</select>';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'checkbox':\n\t\t\t\t$sReturn = '<input type=\"'.$sInputType.'\" name=\"'.$sInputname.'\" id=\"'.$sInputname.'\" class=\"input\"'.(isset($this->arrReadOnly[$sFieldName]) ? ' readonly' : '').'>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'password':\n\t\t\t\t$sReturn = '<input type=\"'.$sInputType.'\" name=\"'.$sInputname.'\" id=\"'.$sInputname.'\" style=\"width:230px\" class=\"input\"'.(isset($this->arrReadOnly[$sFieldName]) ? ' readonly' : '').'>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'date' :\n\t\t\t\t\t $sReturn= '<input type=\"text\" name=\"'.$sInputname.'\" id=\"'.$sInputname.'\" '.$sDis.' size=\"30\" class=\"input\"> \n\t\t\t\t\t <a href=\"javascript:cal'.$sInputname.'.popup();\">\n\t\t\t\t\t\t<img src=\"images/cal/cal.gif\" width=\"16\" height=\"16\" id=\"img\"'.$sInputname.' border=\"0\" alt=\"Click Here to Pick up the date\">\n\t\t\t\t\t </a>\n\t\t\t\t\t <script type=\"text/javascript\">var cal'.$sInputname.' = CreateCalObject(\"'.$sInputname.'\", \"img'.$sInputname.'\");</script>\n\t\t\t\t\t ';\n\t\t\t\t\tbreak; \n\t\t\t\tcase 'datetime' :\n\t\t\t\t\t $sReturn= '<input type=\"text\" name=\"'.$sInputname.'\" id=\"'.$sInputname.'\" '.$sDis.' size=\"30\" class=\"input\"> \n\t\t\t\t\t <a href=\"javascript:cal'.$sInputname.'.popup();\">\n\t\t\t\t\t\t<img src=\"images/cal/cal.gif\" width=\"16\" height=\"16\" id=\"img\"'.$sInputname.' border=\"0\" alt=\"Click Here to Pick up the date\">\n\t\t\t\t\t </a>\n\t\t\t\t\t <script type=\"text/javascript\">\n\t\t\t\t\t\tvar cal'.$sInputname.' = CreateCalObject(\"'.$sInputname.'\", \"img'.$sInputname.'\");\n\t\t\t\t\t\tcal'.$sInputname.'.time_comp = true;\n\t\t\t\t\t </script>\n\t\t\t\t\t ';\n\t\t\t\t\tbreak; \n //<script>var cal1 = CreateCalObject('.$sInputname.', 'imgcal1');</script>'; \n //<script language=\"javascript\" src=\"scripts/calendar2.js\"> var cal1 = CreateCalObject('.$sInputname.', 'imgcal1');</script>';\t\n\t\t\t\tcase 'none':\n\t\t\t\t\t// Truong hop khong muon tu dong sinh thi lay doan ma HTML o addHTML\n\t\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$sReturn = '<input type=\"text\" name=\"'.$sInputname.'\" id=\"'.$sInputname.'\" style=\"width:230px\" class=\"input\"'.(isset($this->arrReadOnly[$sFieldName]) ? ' readonly' : '').'>';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(isset($this->arrAddHTML[$sFieldName]))\n\t\t\t{\n\t\t\t\t$sReturn = $sReturn.$this->arrAddHTML[$sFieldName];\n\t\t\t}\n\t\t\treturn($sReturn);\n\t\t}", "public function renderInput(){\n $row = '';\n $row .= \"<input type=\\\"$this->type\\\" id=\\\"$this->id\\\" name=\\\"$this->name\\\" $this->required \";\n\n return $row;\n }", "function dumpFormItems()\r\n {\r\n if($this->_onclick != null)\r\n {\r\n $hiddenwrapperfield = $this->readJSWrapperHiddenFieldName();\r\n echo \"<input type=\\\"hidden\\\" id=\\\"$hiddenwrapperfield\\\" name=\\\"$hiddenwrapperfield\\\" value=\\\"\\\" />\";\r\n }\r\n }", "function dumpFormItems()\r\n {\r\n if($this->_onclick != null)\r\n {\r\n $hiddenwrapperfield = $this->readJSWrapperHiddenFieldName();\r\n echo \"<input type=\\\"hidden\\\" id=\\\"$hiddenwrapperfield\\\" name=\\\"$hiddenwrapperfield\\\" value=\\\"\\\" />\";\r\n }\r\n }", "function input_text($element_name, $values) {\r\n print '<input type=\"text\" name=\"'.$element_name.'\"id=\"'.$element_name.'\" value=\"';\r\n print html_entity_decode($values, ENT_NOQUOTES) . '\" style=\"width:600px\">';\r\n}", "protected function onBeforeInputHtml()\n {\n }", "public function getHTML() {\t\n\t\t$html = '';\n\t\tif ($this->type != 'title') $html.= '<p>'.\"\\n\";\n\t\tif ($this->type != 'info' && $this->type != 'system' && $this->type != 'title') \n\t\t\t{\t\t\t\n\t\t\t$html.= '<label id=\"label_for_'. $this->name . '\" name=\"label_for_'. $this->name . '\" for=\"'. $this->name . '\">';\n\t\t\t// special check for files item\n\t\t\tif ($this->type == 'file')\n\t\t\t\t{\n\t\t\t\tif (file_exists($_SERVER['DOCUMENT_ROOT'].'/uploads/' . $this->name))\n\t\t\t\t\t{\n\t\t\t\t\t$html.= '<a href = \"/uploads/'. $this->name .'\">'.$this->label.'</a> \n\t\t\t\t\t\t(<a href=\"javascript:void Messi.ask(\\''.DELETE.' ' .$this->name.' ?\\', \n\t\t\t\t\t\tfunction(val) { if(val==\\'Y\\') formSubmit(\\'delete\\',\\'' . $this->name . '\\');});\">'.DELETE.'</a>)';\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t$html.= $this->label.' ('.NONE.')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t$html.= $this->label;\n\t\t\t\t}\n\t\t\t$html.= '</label>'.\"\\n\";\n\t\t\t}\n\t\t// add dependence of the item for js managing in user interface\n\t\tif ($this->depend != 'none' or $this->depend != '') {\n\t\t\t$html.= '<input type=\"hidden\" id=\"dependance_for_'. $this->name . '\" value=\"'. $this->depend . '\" />'.\"\\n\";\n\t\t}\t\n\t\t$html.= '<input type=\"hidden\" id=\"title_for_'. $this->name . '\" value=\"'. $this->title . '\" />'.\"\\n\";\n\t\tswitch ($this->type)\n\t\t\t{\n\t\t\tcase 'text' : \n\t\t\t\t$html.= '<input id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" \n\t\t\t\t\tonchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'password' : \n\t\t\t\t$html.= '<input type=\"password\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" \n\t\t\t\t\tonchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'checkbox' : \n\t\t\t\t$html.= '<input type=\"checkbox\" id=\"'. $this->name . '\" name=\"'. $this->name . '\"' . ( ($this->value == 'on') ? \" \n\t\t\t\t\tchecked \" : \"\") . ' onchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'file' : \n\t\t\t\t$html.= '<input type=\"file\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'select' :\n\t\t\t\t$html.= '<select id=\"'. $this->name . '\" name=\"'. $this->name . '\" onchange=\"display_dependance();\" >'.\"\\n\";\n\t\t\t\t$valuesPossible = explode(',',$this->values);\n\t\t\t\tforeach ($valuesPossible as $valuePossible){\n\t\t\t\t\t$html.= '<option value=\"'. $valuePossible . '\" ' . (($valuePossible == $this->value) ? \" selected \" : \"\") . '>'.\n\t\t\t\t\t(($valuePossible == \"none\") ? NONE : $valuePossible) . '</option>'.\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t$html.= '</select><div style=\"clear:both\"></div>'.\"\\n\";\n\t\t\t\tbreak; \n\n\t\t\tcase 'title' : \n\t\t\t\t$html.= \"\\n\". '<h2>'.$this->label.'</h2><hr />'.\"\\n\\n\";\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t// system action items\n\t\t\tcase 'system' : \n\t\t\t\t// a system item will render a button that submit the form with the configured action name in the config-map.php\n\t\t\t\t$html.= '<label></label><input class=\"button\" type=\"button\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'.$this->label.'\" \n\t\t\t\tonclick=\"new Messi(\\''.addslashes($this->help).'\\', {\n\t\t\t\t\ttitle: \\''.addslashes($this->label).'?\\', \n\t\t\t\t\tmodal: true, buttons: [{id: 0, label: \\''.YES.'\\', val: \\'Y\\'}, {id: 1, label: \\''.NO.'\\', val: \\'N\\'}], \n\t\t\t\t\tcallback: function(val) { if(val==\\'Y\\') {openTerminal();formSubmit(\\''.$this->values.'\\');}}});\" />';\n\t\t\t\tbreak;\n\n\t\t\tcase 'html' : \n\t\t\t\t// this is only arbitrary html code to display\n\t\t\t\t$html.= $this->value;\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * HERE YOU CAN ADD THE TYPE RENDERER YOU NEED\n\t\t\t *\n\t\t\t * case 'YOUR_TYPE' : \n\t\t\t *\t$html.= 'ANY_HTML_CODE_TO_RENDER';\n\t\t\t *\tbreak;\n\t\t\t */\n\n\t\t\tdefault : \n\t\t\t\t$html.= '<b>'.NO_METHOD_TO_RENDER_THIS_ITEM .'</b><br />Item : '.$this->name. '<br />Type : '.$this->type. '<br />'.\"\\n\"; \n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\tif ($this->type != 'title') $html.= '</p>'.\"\\n\"; \t\t\n\t\treturn $html;\n\t}", "function get_finput($iname, $itype, $idvalue =\"\", $idata = \"\")\n\t{\n\t\tif($itype == \"text\")\n\t\t{\n\t\t\treturn \"<input class=\\\"cell_floating\\\" type=\\\"text\\\" name=\\\"student[CUSTOM_$iname]\\\" size=\\\"30\\\" />\";\t\n\t\t}\n\t\tif($itype == \"select\")\n\t\t{\n\t\t\t$options = split(\"\\n\",$idata);\n\t\t\t$retvalue = \"\\n<select class=\\\"cell_floating\\\" name=\\\"student[CUSTOM_$iname]\\\" >\";\n\t\t\t$retvalue .= \"\\n\\t<option value=\\\"\\\">Any Value . . .</option>\";\n\t\t\tfor($o = 0; $o < count($options); $o++){\n\t\t\t\t$retvalue .= \"\\n\\t<option value=\\\"$options[$o]\\\">$options[$o]</option>\";\n\t\t\t}\n\t\t\t$retvalue .= \"\\n</selct>\";\n\t\t\treturn $retvalue;\n\t\t}\n\t}", "function render_field_select($field)\n {\n }", "public function print_value_input(){\n return false;\n ?>\n <input\n class=\"<?php echo RB_Field_Factory::get_input_class_link(); ?>\"\n rb-control-final-value\n name=\"<?php echo $this->id; ?>\"\n value=\"<?php echo $this->value; ?>\"\n type=\"hidden\"></input>\n <?php\n }", "function render_html_field($field, $settings) {\n\t// $field = (object) $field;\n\n\t// debug($field);\n\t$type = $settings[\"type\"];\n\t$name = $settings[\"name\"];\n\t$label = $settings['label'];\n\t$choices = $settings['choices'];\n\t$instructions = $settings['instructions'];\n\t$layout = isset($settings[\"layout\"]) ? $settings[\"layout\"] : \"os\";\n\t$value = is_string($field) ? $field : $field[$settings[\"name\"]];\n\t$unset = array(\"class\", \"default\", \"placeholder\", \"layout\", \"type\", \"choices\", \"instructions\");\n\n\t// set up defaults in the attrs array\n\t$attrs = array();\n\t$attrs['id'] = $settings['name'];\n\t$attrs['value'] = $value == \"\" && isset($settings['default']) ? $settings['default'] : $value;\n\t$value = $attrs['value'];\n\t$attrs['class'] = isset($settings['class']) ? $settings['class'] : \"\";\n\t$attrs['placeholder'] = isset($settings[\"placeholder\"]) ? $settings[\"placeholder\"] : $settings[\"label\"];\n\n\t// unset things we don't want showing up on the input class\n\tforeach ($unset as $k => $v) {unset($settings[$v]); }\n\n\tif ($type == \"wysiwyg\") {\n\t\t$attrs['class'] .= \" wysiwyg\";\n\t\tunset($attrs['value']);\n\t} elseif ($type == \"checkbox\") {\n\t\t$attrs['checked'] = isset($attrs['value']) && $attrs['value'] == 1 ? true : false;\n\t\t$attrs['value'] = \"1\";\n\t}\n\n\t// debug($attrs);\n\t// debug($settings);\n\n\t// now build input attribute string\n\t$attrs_array = array_merge($attrs, $settings);\n\t$attrs = array_map(function($key, $value) {\n\t\tif (gettype($value) == \"boolean\" && $value === true) {\n\t\t\treturn $key;\n\t\t} elseif (gettype($value) == \"string\") {\n\t\t\treturn $key.'=\"'.$value.'\"';\n\t\t}\n\t}, array_keys($attrs_array), array_values($attrs_array));\n\n\t$attrs = implode(' ', $attrs);\n\n\t// if (! $settings['disable_fieldset']) {\n\t// \t$layout .= \" fieldset\";\n\t// }\n\n\t?>\n\n\t<div class=\"field <?= $layout; ?>\">\n\t\t<div class=\"field_label\">\n\t\t\t<? if ($label) { ?>\n\t\t\t\t<label for=\"<?= $name; ?>\"><?= $label; ?></label>\n\t\t\t<? } ?>\n\t\t\t<? if ($instructions) { ?>\n\t\t\t\t<div class=\"field_instructions muted em\"><?= $instructions; ?></div>\n\t\t\t<? } ?>\n\t\t</div>\n\t\t<div class=\"field_value\">\n\t\t\t<? if ($type == \"select\") { \n\t\t\t\tif (gettype($value) != \"array\") {\n\t\t\t\t\t$value = array($value);\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\t<select <?= $attrs; ?>>\n\t\t\t\t\t<option value=\"\" disabled selected>--Select</option>\n\t\t\t\t\t<?\n\t\t\t\t\tforeach ($choices as $key => $option) {\n\t\t\t\t\t\tif (is_array($option)) { ?>\n\t\t\t\t\t\t\t<optgroup label=\"<?= $key; ?>\">\n\t\t\t\t\t\t\t\t<? foreach ($option as $skey => $label) { ?>\n\t\t\t\t\t\t\t\t\t<option value=\"<?= $skey; ?>\" <? if (in_array($skey, $value) == true) {echo \"selected\"; } ?>><?= $label; ?></option>\n\t\t\t\t\t\t\t\t<? } ?>\n\t\t\t\t\t\t\t</optgroup>\n\t\t\t\t\t\t<? } else { ?>\n\t\t\t\t\t\t\t<option value=\"<?= $key; ?>\" <? if (in_array($key, $value) == true) {echo \"selected\"; } ?>><?= $option; ?></option>\n\t\t\t\t\t\t<? } ?>\n\t\t\t\t\t<? } ?>\n\t\t\t\t</select>\n\n\t\t\t<? } elseif ($type == \"textarea\") { ?>\n\t\t\t\t<textarea type=\"text\" rows=\"5\" <?= $attrs; ?>><?= $attrs_array['value']; ?></textarea>\n\t\t\t<? } elseif ($type == \"wysiwyg\") {\n\t\t\t\t?>\n\t\t\t\t<textarea name=\"<?= $name; ?>\" class=\"wysiwyg_input\" style=\"display: none\"><?= $value; ?></textarea>\n\t\t\t\t<div <?= $attrs; ?>><?= htmlspecialchars_decode($value); ?></div>\n\t\t\t<? } else { ?>\n\t\t\t\t<input type=\"<?= $type; ?>\" <?= $attrs; ?>>\n\t\t\t<? } ?>\n\t\t</div>\n\t</div>\n\n\n\t<?\n}", "function HTML_input( $label=false, $id, $value=null, $add_returns=true, $type='text', $size=null, $maxlength=null, $onchange=null, $width=0, $disabled=false, $autocomplete=false, $checked=false ) {\n\t\t\n\t\t$str = '';\n\t\tif ( isset( $label ) && $label !== false ) {\n\t\t\t$str .= '<label for=\"'.$id.'\">'.$label.'</label>';\n\t\t\tif ( $add_returns ) {\n\t\t\t\t$str .= '<br />';\n\t\t\t}\n\t\t\t$str .= \"\\n\";\n\t\t}\n\t\t\n\t\t// <input name=\"name\" id=\"id\" type=\"text\" value=\"value\" size=\"2\" maxlength=\"2\" onchange=\"\" disabled>\n\t\t$str .= '<input name=\"'.$id.'\" id=\"'.$id.'\" type=\"'.$type.'\"';\n\t\tif ( isset( $value ) ) {\n\t\t\t$str .= ' value=\"'. addslashes( encode_input_value( $value ) ) .'\"';\n\t\t}\n\t\tif ( $size > 0 ) {\n\t\t\t$str .= ' size=\"'.$size.'\"';\n\t\t}\n\t\tif ( $maxlength > 0 ) {\n\t\t\t$str .= ' maxlength=\"'.$maxlength.'\"';\n\t\t}\n\t\tif ( isset( $onchange ) ) {\n\t\t\t$str .= ' onchange=\"'.$onchange.'\"';\n\t\t}\n\t\tif ( $width > 0) {\n\t\t\t$str .= ' style=\"width: '.$width.'px;\"';\n\t\t}\n\t\tif ( !$autocomplete ) {\n\t\t\t$str .= ' autocomplete=\"OFF\"';\n\t\t}\n\t\tif ( $disabled ) {\n\t\t\t$str .= ' disabled';\n\t\t}\n\t\tif ( $checked ) {\n\t\t\t$str .= ' checked';\n\t\t}\n\t\t$str .= '>' . \"\\n\";\n\t\t\n\t\tif ( $add_returns ) {\n\t\t\t$str .= '<p />';\n\t\t}\n\t\t$str .= \"\\n\";\n\t\t\n\t\treturn $str;\n\t}", "public function get_html()\n\t{\n\t\tif ( empty($this->html) && $this->name ){\n\t\t\t\n\t\t\t$this->html .= '<'.$this->tag.' name=\"'.$this->name.'\"';\n\t\t\t\n\t\t\tif ( isset($this->id) ){\n\t\t\t\t$this->html .= ' id=\"'.$this->id.'\"';\n\t\t\t}\n\t\t\t\n\t\t\tif ( $this->tag === 'input' && isset($this->options['type']) ){\n\t\t\t\t$this->html .= ' type=\"'.$this->options['type'].'\"';\n\t\t\t\t\n\t\t\t\tif ( $this->options['type'] === 'text' || $this->options['type'] === 'number' || $this->options['type'] === 'password' || $this->options['type'] === 'email' ){\n\t\t\t\t\tif ( isset($this->options['maxlength']) && ( $this->options['maxlength'] > 0 ) && $this->options['maxlength'] <= 1000 ){\n\t\t\t\t\t\t$this->html .= ' maxlength=\"'.$this->options['maxlength'].'\"';\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset($this->options['minlength']) && ( $this->options['minlength'] > 0 ) && $this->options['minlength'] <= 1000 && ( \n\t\t\t\t\t( isset($this->options['maxlength']) && $this->options['maxlength'] > $this->options['minlength'] ) || !isset($this->options['maxlength']) ) ){\n\t\t\t\t\t\t$this->html .= ' minlength=\"'.$this->options['minlength'].'\"';\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset($this->options['size']) && ( $this->options['size'] > 0 ) && $this->options['size'] <= 100 ){\n\t\t\t\t\t\t$this->html .= ' size=\"'.$this->options['size'].'\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( $this->options['type'] === 'checkbox' ){\n\t\t\t\t\tif ( !isset($this->options['value']) ){\n\t\t\t\t\t\t$this->options['value'] = 1;\n\t\t\t\t\t}\n\t\t\t\t\t$this->html .= ' value=\"'.htmlentities($this->options['value']).'\"';\n\t\t\t\t\tif ( $this->value == $this->options['value'] ){\n\t\t\t\t\t\t$this->html .= ' checked=\"checked\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ( $this->options['type'] === 'radio' ){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->html .= ' value=\"'.htmlentities($this->value).'\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( isset($this->options['title']) ){\n\t\t\t\t$this->html .= ' title=\"'.$this->options['title'].'\"';\n\t\t\t}\n\t\t\t\n\t\t\t$class = '';\n\t\t\t\n\t\t\tif ( isset($this->options['cssclass']) ){\n\t\t\t\t$class .= $this->options['cssclass'].' ';\n\t\t\t}\n\n\t\t\tif ( $this->required ){\n\t\t\t\t$class .= 'required ';\n\t\t\t}\n\t\t\tif ( isset($this->options['email']) ){\n\t\t\t\t$class .= 'email ';\n\t\t\t}\n\t\t\tif ( isset($this->options['url']) ){\n\t\t\t\t$class .= 'url ';\n\t\t\t}\n\t\t\tif ( isset($this->options['number']) ){\n\t\t\t\t$class .= 'number ';\n\t\t\t}\n\t\t\tif ( isset($this->options['digits']) ){\n\t\t\t\t$class .= 'digits ';\n\t\t\t}\n\t\t\tif ( isset($this->options['creditcard']) ){\n\t\t\t\t$class .= 'creditcard ';\n\t\t\t}\n\t\t\t\n\t\t\tif ( !empty($class) ){\n\t\t\t\t$this->html .= ' class=\"'.trim($class).'\"';\n\t\t\t}\n\t\t\t\n\t\t\t$this->html .= '>';\n\t\t\t\n\t\t\tif ( $this->tag === 'select' || $this->tag === 'textarea' ){\n\t\t\t\t$this->html .= '</'.$this->tag.'>';\n\t\t\t}\n\t\t\t\n\t\t\tif ( isset($this->options['placeholder']) && strpos($this->options['placeholder'],'%s') !== false ){\n\t\t\t\t$this->html = sprintf($this->options['placeholder'], $this->html);\n\t\t\t}\n\t\t}\n\t\treturn $this->html;\n\t}", "protected abstract function printFormElements();", "public function get_table_field_selector()\n {\n $input = JFactory::getApplication()->input;\n\n $response = array();\n $table = $input->get('table');\n $fieldName = $input->get('field_name');\n\n if( ! $table)\n {\n $response['text'] = '';\n }\n else\n {\n $db = JFactory::getDBO();\n $dbTables = $db->getTableList();\n $dbPrefix = $db->getPrefix();\n\n if( ! in_array($dbPrefix.$table, $dbTables))\n {\n $response['text'] = 'Invalid table';\n }\n else\n {\n $fields = $db->getTableFields($dbPrefix.$table);\n\n $fields = $fields[$dbPrefix.$table];\n\n $out = '';\n $out .= '<select name=\"'.$fieldName.'\">';\n $out .= '<option value=\"\">'.jgettext('Select...').'</option>';\n\n foreach(array_keys($fields) as $fieldName)\n {\n $out .= '<option>'.$fieldName.'</option>';\n }\n\n $out .= '</select>';\n $response['text'] = $out;\n $response['status'] = 1;\n }\n }\n\n echo json_encode($response);\n\n jexit();\n }", "function getHtmlStep2Form()\r\n\t{\r\n\t\treturn $this->getAdminTableHtml( 2 );\r\n\t}", "public function get_form_editor_inline_script_on_page_render() {\n\n\t\t// set the default field label for the simple type field\n\t\t$script = sprintf( \"function SetDefaultValues_simple(field) {field.label = '%s';}\", $this->get_form_editor_field_title() ) . PHP_EOL;\n\n\t\t// initialize the fields custom settings\n\t\t$script .= \"jQuery(document).bind('gform_load_field_settings', function (event, field, form) {\" .\n\t\t \"var inputClass = field.inputClass == undefined ? '' : field.inputClass;\" .\n\t\t \"jQuery('#input_class_setting').val(inputClass);\" .\n\t\t \"});\" . PHP_EOL;\n\n\t\t// saving the simple setting\n\t\t$script .= \"function SetInputClassSetting(value) {SetFieldProperty('inputClass', value);}\" . PHP_EOL;\n\n\t\treturn $script;\n\t}", "function ajax_render_field_settings()\n {\n }", "protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element\n ) \n {\n $html = parent::_getElementHtml($element);\n\n // Set up additional JavaScript for our validation using jQuery.\n\n $jquery\n = '<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\" ></script>';\n\n if (!Mage::helper('ddg')->isEnterprise()) {\n $html .= $jquery;\n $javaScript\n = \"<script type=\\\"text/javascript\\\">\n\t jQuery.noConflict();\n jQuery(document).ready(function() {\n\t\t\t\tjQuery('#connector_data_mapping_enterprise_data-head').parent().hide();\n\n });\n </script>\";\n $html .= $javaScript;\n }\n\n\n return $html;\n }", "public function html() {\n $table = $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction(['width' => '250px'])\n ->parameters([\n 'dom' => 'Bfrtip',\n 'buttons' => [\n ['extend' => 'create', 'className' => 'btn btn-success', 'text' => 'Create User', 'init' => 'function(api, node, config) {\n $(node).removeClass(\"dt-button buttons-create btn-default\")\n }']\n ],\n 'select' => true,\n 'initComplete' => 'function () {\n var r = $(\"#datatable-buttons tfoot tr\");\n $(\"#datatable-buttons thead\") . append(r);\n this.api().columns([0,1,2,3]).every(function () {\n var column = this; \n var input = document . createElement(\"input\");\n $(input).addClass(\"form-control input-lg col-xs-12\");\n $(input).appendTo($(column.footer()).empty())\n .on(\"change\", function () {\n\n column.search($(this).val(), false, false, true).draw();\n });\n });\n }',\n ]);\n return $table;\n }", "public function renderCreateModalHTML()\n {\n $input_form = \"<div class=\\\"form-group\\\">\n <label for=\\\"{{label}}\\\">{{label}}</label>\n <input type=\\\"{{type}}\\\" class=\\\"form-control\\\" id=\\\"create_input_{{label}}\\\">\n </div>\";\n $break_line = \"\\n\";\n\n $form_result = \"\";\n $columns = $this->getShowColumnCreateModal();\n foreach ($columns as $name => $type) {\n $input_type = 'text';\n\n if ($type == \"bigint\" OR $type == \"integer\"){\n $input_type = 'number';\n }elseif ($type == \"string\"){\n $input_type = 'text';\n }elseif ($type == \"datetime\"){\n $input_type = 'datetime-local';\n }\n\n $one_form = str_replace(\n [\n '{{label}}','{{type}}'\n ],\n [\n $name, $input_type\n ],\n $input_form\n );\n $form_result = $form_result.$one_form.$break_line;\n }\n\n return $form_result;\n }", "public function getDataInputField();", "function getHtmlStep1Form()\r\n\t{\r\n\t\treturn $this->getAdminTableHtml( 1 );\r\n\t}", "function cjpopups_admin_form_raw($options, $search_box = null, $return = null, $chzn_class = 'chzn-select-no-results', $form_submit = null){\n\tglobal $display;\n\t$display = '';\n\trequire(sprintf('%s/admin_form_raw.php', cjpopups_item_path('includes_dir')));\n\tif(is_null($return)){\n\t\techo implode('', $display);\n\t}else{\n\t\treturn implode('', $display);\n\t}\n}", "private function get_inputs_output_html() {\n\t\t$i = 0;\n\t\t$j = 0;\n\n\t\t$addon_title = $this->addon_raw['title'];\n\t\t$fieldsets = array();\n\t\tforeach ($this->options as $key => $option) {\n\t\t\t\t$fieldsets[$key] = $option;\n\t\t}\n\n\t\t$output = '';\n\n\t\tif(count((array) $fieldsets)) {\n\t\t\t$output .= '<div class=\"sp-pagebuilder-fieldset\">';\n\t\t\t$output .= '<ul class=\"sp-pagebuilder-nav sp-pagebuilder-nav-tabs\">';\n\t\t\tforeach ( $fieldsets as $key => $value ) {\n\t\t\t\t$output .= '<li class=\"'. (( $i === 0 )?\"active\":\"\" ) .'\"><a href=\"#sp-pagebuilder-tab-'. $key .'\" aria-controls=\"'. $key .'\" data-toggle=\"tab\">'. ucfirst( $key ) .'</a></li>';\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$output .= '</ul>';\n\t\t\t$output .= '<div class=\"tab-content\">';\n\t\t\tforeach ( $fieldsets as $key => $value ) {\n\t\t\t\t$output .= '<div class=\"tab-pane '. (( $j === 0 )? \"active\":\"\" ) .'\" id=\"sp-pagebuilder-tab-'. $key .'\">';\n\t\t\t\t$output .= $this->get_input_fields( $key, $addon_title );\n\t\t\t\t$output .= '</div>';\n\n\t\t\t\t$j++;\n\t\t\t}\n\t\t\t$output .= '</div>';\n\t\t\t$output .= '</div>';\n\t\t}\n\n\t\treturn $output;\n\t}", "public function render(){\n\t\t$fhp; // form_helper_params\n\t\t$value = $this->_data['value'];\n\t\t$form_helper = 'input';\n\t\t$attributes = Arr::extract($this->_data,['id','required','maxlength','title','pattern','readonly','class','size','placeholder','multiple','accept','options']);\n\t\tif(!in_array($this->_data['type'],['radio'])) unset($attributes['options']);\n\t\tif($attributes['required']!==true) unset($attributes['required']);\n\t\tif($attributes['readonly']!==true) unset($attributes['readonly']);\n\t\tif(!$attributes['maxlength']) unset($attributes['maxlength']);\n\t\tif(!$attributes['size']) unset($attributes['size']);\n\t\t$fhp = [$this->_data['name'],$value,$attributes];\n\t\t//$name = $this->_data['name'];\n\t\t//open,close,input,button,checkbox,file,hidden,image,label,password,radio,select,submit,textarea,\n\t\t//$attr\n\t\tswitch($this->_data['type']){\n\t\t\tcase'form':\n\t\t\t\t$form_helper = $this->_data['data_type']; $fhp=[];\n\t\t\t\tbreak;\n\t\t\tcase'select':\n\t\t\t\t//unset\n\t\t\t\t$form_helper='select'; $fhp=[$this->_data['name'],$this->_data['options'],$value,$attributes];\n\t\t\t\tbreak;\n\t\t\tcase'checkbox':\n\t\t\t\t$fhp = [$this->_data['name'],1,!!($value),$attributes];\n\t\t\t\t$form_helper='checkbox';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//if($this->_data['type'] == 'radio') $fhp[2]['options'] = Arr::get($this->_data,'options');\n\t\t\t\tif(in_array($this->_data['type'],['file','select','checkbox','radio','hidden'])) $this->_data['inputtype'] = $this->_data['type'];\n\t\t\t\t//if()\n\t\t\t\tswitch($this->_data['data_type']){\n\t\t\t\t\tcase'int':\n\t\t\t\t\t\t$fhp[2]['type']='number';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase'text':\n\t\t\t\t\t\t$form_helper='textarea';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\tif($form_helper=='input') $fhp[2]['type']=$this->_data['inputtype'];\n\t\t/*switch($this->_data['data_type']){\n\t\t\tcase'form':\n\t\t\t\t\n\t\t\t\t\n\t\t\t}*/\n\t\treturn call_user_func_array([$this,$form_helper],$fhp);\n\t\t//->($this->_data['name']);\n\t\t//return json_encode($this->_datations);\n\t\t//return \n\t\t}", "private function setDefaults() {\r\n\t\t$this->type=formElement::TYPE_TEXT;\r\n\t\t$this->mulitple=false;\r\n\t\t$this->readOnly=false;\r\n\t\t$this->size=50;\r\n\t\t$this->max=0;\r\n\t\t$this->cols=100;\r\n\t\t$this->rows=10;\r\n\t\t$this->fieldWidth=300;\r\n\r\n\r\n\t\t$this->CSS='\r\n.form_text {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:1px solid #3a5f7b;\r\n\tbackground-color:#FFFFFF;\r\n}\r\n\r\n.form_text_error {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:2px solid #980000;\r\n\tbackground-color:#FFFFFF;\r\n}\r\n\r\n.form_select {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:1px solid #3a5f7b;\r\n}\r\n\r\n.form_select_error {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tfont-weight:bold;\r\n\tborder:2px solid #980000;\r\n\tbackground-color:#980000;\r\n\tcolor:#FFFFFF;\r\n}\r\n\r\n.form_checkbox {\r\n\r\n}\r\n\r\n.form_textarea {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:1px solid #3a5f7b;\r\n}\r\n\r\n.form_textarea_error {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:2px solid #980000;\r\n}';\r\n\r\n\t\t$this->JS='\r\nfunction submitIfEnter(event, frm) {\r\n \tif (event && event.keyCode == 13) {\r\n \t\tfrm.onsubmit();\r\n \t} else {\r\n \t\treturn true;\r\n \t}\r\n}';\r\n\t}", "function crea_form_input3($arcampi,$arcampi2,$arcampi3,$script,$bottone_submit =\"salva\",$intestazione=\"Inserimento nuovo record\",$arcampi4=\"\")\n{\n?>\n <head>\n<?\n include(\"config.php\");\n echo \"<link rel=stylesheet type=text/css href=\\\"$fogliostile\\\">\";\n?>\n <script language=javascript>\n function cambia_sfondo(el,focus_o_blur)\n {\n if (focus_o_blur == 1)\n {\n el.style.fontfamily = \"Arial\";\n el.style.background=\"#99ccff\";\n \n }\n else\n {\n el.style.fontfamily = \"Arial\";\n el.style.background=\"#f0f0f0\";\n \n }\n }\n </script>\n </head>\n <?\n echo \"<h3 align=center>$intestazione</h3>\";\n form_crea_multipart(\"datainput\",1,$script);\n\n echo \"<table id=dataentry bgcolor=#daab59 align=center>\";\n $primavoceselect = true;\n while(list($key,$value) = each($arcampi))\n {\n if ($arcampi2[$key] == \"select\")\n {\n \t echo \"<tr><td><b>\" . (($arcampi4 == \"\") ? \"$key:\" : $arcampi4[$key]) . \"</b></td><td><select name=$key onfocus=\\\"cambia_sfondo(this,1)\\\" onblur=\\\"cambia_sfondo(this,2)\\\">\";\n\t for($i = 0;$i < count($arcampi[$key]);$i++)\n\t if ($primavoceselect == true)\n\t {\n\t echo \"<option selected>\" . $arcampi[$key][$i] . \"</option>\";\n\t\t $primavoceselect = false;\n\t\t}\n\t else echo \"<option>\" . $arcampi[$key][$i] . \"</option>\";\n\t echo \"</select></td></tr>\";\n }\n if ($arcampi2[$key] == \"textarea\")\n {\n\t\techo \"<tr><td><b>\" . (($arcampi4 == \"\") ? \"$key:\" : $arcampi4[$key]) . \"</b></td><td><textarea name=$key rows=4 cols=65 onfocus=\\\"cambia_sfondo(this,1)\\\" onblur=\\\"cambia_sfondo(this,2)\\\">$arcampi[$key]\";\n\t\techo \"</textarea></td></tr>\";\n\t}\n\tif (($arcampi2[$key] == \"hidden\"))\n\t echo \"<tr><td><b>&nbsp;</b></td><td><input type=$arcampi2[$key] name=$key size=$arcampi3[$key] maxlength=$arcampi3[$key] onfocus=\\\"cambia_sfondo(this,1)\\\" onblur=\\\"cambia_sfondo(this,2)\\\" value=\\\"$arcampi[$key]\\\"></td></tr>\";\n\tif (($arcampi2[$key] != \"textarea\") & ($arcampi2[$key] != \"select\") & ($arcampi2[$key] !=\"hidden\"))\n\t echo \"<tr><td><b>\" . (($arcampi4 == \"\") ? \"$key:\" : $arcampi4[$key]) . \"</b></td><td><input type=$arcampi2[$key] name=$key size=$arcampi3[$key] maxlength=$arcampi3[$key] onfocus=\\\"cambia_sfondo(this,1)\\\" onblur=\\\"cambia_sfondo(this,2)\\\" value=\\\"$arcampi[$key]\\\"></td></tr>\";\n\n }\n echo \"<tr><td colspan=2 align=center>\";\n form_invia($bottone_submit,$bottone_submit);\n echo \"</td></tr>\";\n echo \"</table>\";\n form_chiudi();\t\n}", "function toString($showRequiredLabel = false, $showAsMergedField = false) \n\t{\n\t\t// Determine if there's an error or not, allow CSS to show that.\n\t\t$errorcss = false;\n\t\tif ($this->renderWithErrors) {\n\t\t\t$errorcss = \"row-has-errors\";\n\t\t}\n\t\t\n\t\t// Formfield class, on by default\n\t\t$trclass = \" class=\\\"form-field $errorcss\\\"\";\n\t\tif (!$this->isformfield) {\n\t\t\t$trclass = \" class=\\\"$errorcss\\\"\";\n\t\t}\n\t\t\n\t\t// Don't need rows for merged fields\n\t\tif (!$showAsMergedField) {\n\t\t\t$elementString = \"<tr valign=\\\"top\\\"$trclass>\\n\";\n\t\t}\n\t\t\n\t\t// Provide the option of showing the required field.\n\t\t$requiredHTML = false;\n\t\tif ($showRequiredLabel && $this->required) {\n\t\t\t$requiredHTML = '<span class=\"description req\"> (' . $this->getTranslationString('required') .')</span>';\n\t\t}\n\n\t\t// The label - if a normal row, this is just a table heading\n\t\tif (!$showAsMergedField) \n\t\t{\n\t\t\t$elementString .= \"\\t\".'<th scope=\"row\"><label for=\"'.$this->name.'\">'.$this->label.$requiredHTML.'</label></th>'.\"\\n\";\t\t \n\t\t\n\t\t\t// Start the table data for the form element and description \n\t\t\t$elementString .= \"\\t<td>\\n\\t\\t\";\n\t\t}\n\t\telse {\n\t\t\t$elementString .= \"\\t<div class=\\\"subelement-title\\\"><b>$this->label$requiredHTML</b></div>\\n\";\n\t\t}\n\n\t\t// Have we got any details on the maximum string length?\n\t\t$sizeInfo = false;\n\t\tif ($this->type == 'textarea' && \t\t\t\t\t\t// Text Area only\n\t\t\t$this->validationRules && \t\t\t\t\t\t\t// Have validation rules\n\t\t\tisset($this->validationRules['maxlen']) && \t\t\t// Have a maximum length\n\t\t\t$maxLen = ($this->validationRules['maxlen'] + 0)) \t// And it's greater than 0\n\t\t{\n\t\t\t$sizeInfo = 'textarea_counter';\n\n\t\t\t// Hide size counter when not in use.\n\t\t\t$this->afterFormElementHTML = '<span id=\"'. $this->name .'_count\" class=\"character_count_area\" style=\"display: none\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"max_characters\" style=\"display: none\">'.$maxLen.'</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"count_field\"></span> characters remaining\n\t\t\t\t\t\t\t\t\t\t\t</span>' . $this->afterFormElementHTML; \n\t\t}\n\t\t\n\t\t// Build CSS information\n\t\t$elementclass = \"class=\\\"$this->cssclass $sizeInfo\\\"\";\n\t\t$elementID = \"id=\\\"$this->name\\\"\";\n\t\t\n\t\t// The actual form element\n\t\tswitch ($this->type)\n\t\t{\n\t\t\tcase 'select':\n\t\t\t\t$elementString .= \"<select name=\\\"$this->name\\\" $elementclass $elementID>\";\n\t\t\t\tif (!empty($this->seleu_itemlist))\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->seleu_itemlist AS $value => $label)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$htmlselected = \"\";\n\t\t\t\t\t\tif ($value == $this->value) {\n\t\t\t\t\t\t\t$htmlselected = ' selected=\"selected\"';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$elementString .= \"\\n\\t\\t\\t\";\n\t\t\t\t\t\t$elementString .= '<option value=\"'.$value.'\"'.$htmlselected.'>'.$label.'&nbsp;&nbsp;</option>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$elementString .= \"\\n</select>\";\n\t\t\t\tbreak; \n\t\t\t\t\n\t\t\t\t\n\t\t\tcase 'radio':\n\t\t\t\t$elementString .= \"\\n\";\n\t\t\t\tif (!empty($this->seleu_itemlist))\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->seleu_itemlist AS $value => $label)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$htmlselected = \"\";\n\t\t\t\t\t\tif ($value == $this->value) {\n\t\t\t\t\t\t\t$htmlselected = ' checked=\"checked\"';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$elementString .= \"\\n\\t\\t\\t\";\n\t\t\t\t\t\t$elementString .= '<input type=\"radio\" name=\"'.$this->name.'\" '.$elementclass.' value=\"'.$value.'\"'.$htmlselected.' style=\"width: auto;\">&nbsp;&nbsp;'.$label.'<br/>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$elementString .= \"\\n\";\n\t\t\t\tbreak; \n\t\t\t\n\t\t\tcase 'textarea':\t\t\t\t\n\t\t\t\t$elementString .= \"<textarea name=\\\"$this->name\\\" rows=\\\"$this->textarea_rows\\\" cols=\\\"$this->textarea_cols\\\" $elementID $elementclass>$this->value</textarea>\"; \n\t\t\t\tbreak; \n\n\t\t\tcase 'uploadfile':\n\t\t\t\tif ($this->showExistingFile) {\n\t\t\t\t\t$elementString.= '<div class=\"existing_file\">'. apply_filters('formbuilder_existing_file', $this->value) . '</div>';\n\t\t\t\t}\n\t\t\t\t$elementString .= \"<input type=\\\"file\\\" name=\\\"$this->name\\\" $elementclass $elementID/>\"; \n\t\t\t\tbreak; \t\t\t\t\n\t\t\t\t\n\t\t\tcase 'checkbox':\n\t\t\t\t$checked = \"\";\n\t\t\t\tif ($this->value == 1 || $this->value == \"on\")\n\t\t\t\t\t$checked = ' checked=checked';\n\t\t\t\t\n\t\t\t\t$elementString .= \"<input type=\\\"checkbox\\\" name=\\\"$this->name\\\" $checked $elementclass $elementID/> $this->checkbox_label\"; \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'checkboxlist':\n\t\t\t\tif ($this->seleu_itemlist) \n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$totalCols = $this->checkboxListCols;\n\t\t\t\t\t\n\t\t\t\t\t// If we only have a few items, reduce the number of columns.\n\t\t\t\t\tif (count($this->seleu_itemlist) < (2*$this->checkboxListCols)) {\n\t\t\t\t\t\t$totalCols = floor($totalCols/2);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$itemCount = 0; // Current item we're dealing with per col\n\t\t\t\t\t$itemsPerCol = ceil(count($this->seleu_itemlist) / $totalCols); // The number of items per column\t\t\t\t\t\n\t\t\t\t\t$closedOff = false; // Flag indicating if we've closed off the div section.\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Width style to indicate how wide to set the column.\n\t\t\t\t\t$colWidth = floor(100/$totalCols);\n\t\t\t\t\t\n\t\t\t\t\tforeach ($this->seleu_itemlist AS $value => $label)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Start column off\n\t\t\t\t\t\tif ($itemCount == 0) {\n\t\t\t\t\t\t\t$elementString .= sprintf('<div class=\"form-checklist-col\" style=\"float: left; width: %s%%;\">', $colWidth);\n\t\t\t\t\t\t\t$closedOff = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$htmlselected = \"\";\n\t\t\t\t\t\tif (is_array($this->value) && array_key_exists($value, $this->value)) {\n\t\t\t\t\t\t\t$htmlselected = ' checked=\"checked\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$elementString .= \"\\n\\t\\t\\t\";\n\t\t\t\t\t\t$elementString .= sprintf('<input type=\"checkbox\" name=\"%s_%s\" %s style=\"width: auto\"/>&nbsp;%s<br/>', \n\t\t\t\t\t\t\t\t\t\t\t$this->name, \n\t\t\t\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t\t\t\t$htmlselected, \n\t\t\t\t\t\t\t\t\t\t\t$label\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$itemCount++;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Finish column off\n\t\t\t\t\t\tif ($itemCount >= $itemsPerCol) {\n\t\t\t\t\t\t\t$itemCount = 0;\n\t\t\t\t\t\t\t$elementString .= '</div>';\n\t\t\t\t\t\t\t$closedOff = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t} // end foreach\n\t\t\t\t\t\n\t\t\t\t\t// Add closing divs\n\t\t\t\t\tif (!$closedOff) {\n\t\t\t\t\t\t$elementString .= '</div>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$elementString .= \"\\n\";\t\t\n\t\t\t\t}\t\t\t\n\t\t\t\tbreak; \n\t\t\t\t\t\t\t\n\t\t\t/* A static type is just the value field. */\n\t\t\tcase 'static':\n\t\t\t\t$elementString .= $this->value;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t/* Custom elements - just dump the provided HTML */\n\t\t\tcase 'custom':\n\t\t\t\t$elementString .= $this->customHTML;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t/* Merged elements - turn each sub element into HTML, and render. */\n\t\t\tcase 'merged':\n\t\t\t\t\t\n\t\t\t\t\t$elementString .= '<table><tr>';\n\t\t\t\t\t\n\t\t\t\t\t// Wrap inner elements in a table.\n\t\t\t\t\tif (!empty($this->subElementList))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($this->subElementList as $subelem)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$elementString .= '<td>';\n\t\t\t\t\t\t\t$elementString .= $subelem->toString(true, true);\n\t\t\t\t\t\t\t$elementString .= '</td>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$elementString .= '</tr></table>';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t/* The default is just a normal text box. */\n\t\t\tdefault:\n\t\t\t\t// Add a default style\n\t\t\t\tif (!$this->cssclass) {\n\t\t\t\t\t$elementclass = 'class=\"regular-text\"';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Got a max length?\n\t\t\t\t$elementSize = false;\n\t\t\t\tif ($this->text_maxlen > 0) {\n\t\t\t\t\t$elementSize = \" maxlength=\\\"$this->text_maxlen\\\"\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$elementString .= \"<input type=\\\"text\\\" name=\\\"$this->name\\\" value=\\\"$this->value\\\" $elementSize $elementID $elementclass/>\";\n\t\t\t\tbreak; \n\t\t}\n\t\t\n\t\t$elementString .= \"\\n\";\n\t\t\t\t\n\t\t// Add extra HTML after form element if specified\n\t\tif ($this->afterFormElementHTML) {\n\t\t\t$elementString .= $this->afterFormElementHTML . \"\\n\";\n\t\t}\n\t\t\n\t\t// Only add description if one exists.\n\t\tif ($this->description) {\n\t\t\t$elementString .= \"\\t\\t\".'<span class=\"setting-description\"><br>'.$this->description.'</span>'.\"\\n\";\n\t\t}\n\t\t\n\t\t// Close off row tags, except if a merged field\n\t\tif (!$showAsMergedField) \n\t\t{\n\t\t\t$elementString .= \"\\t</td>\\n\"; \t\t\t\t\n\t\t\t$elementString .= '</tr>'.\"\\n\";\n\t\t}\n\t\treturn $elementString;\n\t}", "public function getElementJs()\n {\n OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'multiselect_field.js');\n\n $jsString = \"var formElement1 = new OwFormElement('\" . $this->getId() . \"', '\" . $this->getName() . \"');\n MultiselectField.prototype = formElement1;\n var formElement = new MultiselectField('\" . $this->getId() . \"', '\" . $this->getName() . \"');\n formElement.setValue(\" . json_encode($this->value) . \");\n \";\n\n return $jsString.$this->generateValidatorAndFilterJsCode(\"formElement\");\n }", "function nombre_campo_cie10($nombre_campo){\n\n$respuesta = new xajaxResponse('utf-8');\nif($nombre_campo !=''){\nglobal $obligatorio;\n$nuevo_select .= \"Cie 10:$obligatorio <input type='text' id='cie_10' name='$nombre_campo' value='' size='5' title ='Escriba en diagnóstico clinico para obtener el CIE10' /> \n\nTipo de diagnóstico:$obligatorio <select name='31' id='31' title ='Seleccione un tipo de diagnóstico' >\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='' SELECTED>Tipo de diagnóstico</option>\t\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='1' >Impresión diagnóstica</option>\t\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='2'>Confirmado nuevo</option>\t\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='3'>Confirmado repetido</option>\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t</select><br>\n\";\t\t\t\t\t\t\t\t\t\t}else{$nuevo_select .= \"<font color='red'>Elija un tipo de diagnóstico </font>\";}\n$respuesta->addAssign(\"orden_cie10\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n}", "public function generate()\n\t{\n\t\t$strValues = '';\n\t\t$arrValues = array();\n\n\t\tif (!empty($this->varValue)) // Can be an array\n\t\t{\n\t\t\t$strValues = implode(',', array_map('intval', (array)$this->varValue));\n\t\t\t$objPages = $this->Database->execute(\"SELECT id, title, alias, type, hide, protected, published, start, stop FROM tl_page WHERE id IN($strValues) ORDER BY \" . $this->Database->findInSet('id', $strValues));\n\n\t\t\twhile ($objPages->next())\n\t\t\t{\n\t\t\t\t$arrValues[] = $this->generateImage($this->getPageStatusIcon($objPages)) . ' ' . $objPages->title . ' (' . $objPages->alias . $GLOBALS['TL_CONFIG']['urlSuffix'] . ')';\n\t\t\t}\n\t\t}\n\n\t\treturn '<input type=\"hidden\" name=\"'.$this->strName.'\" id=\"ctrl_'.$this->strId.'\" value=\"'.$strValues.'\">\n <div class=\"selector_container\" id=\"target_'.$this->strId.'\">\n <ul><li>' . implode('</li><li>', $arrValues) . '</li></ul>\n <p><a href=\"contao/page.php?table='.$this->strTable.'&amp;field='.$this->strField.'&amp;id='.\\Input::get('id').'&amp;value='.$strValues.'\" class=\"tl_submit\" onclick=\"Backend.getScrollOffset();Backend.openModalSelector({\\'width\\':765,\\'title\\':\\''.$GLOBALS['TL_LANG']['MOD']['page'][0].'\\',\\'url\\':this.href,\\'id\\':\\''.$this->strId.'\\'});return false\">'.$GLOBALS['TL_LANG']['MSC']['changeSelection'].'</a></p>\n </div>';\n\t}", "function acf_get_select_input($attrs = array())\n{\n}", "public function render()\n {\n $fromList = array();\n $this->getFromList($fromList);\n $value = $this->getValue()!==null?$this->getValue():$this->getDefaultValue();\n $valueArray = explode(',', $value);\n \n $disabledStr = ($this->getEnabled() == \"N\") ? \"DISABLED=\\\"true\\\"\" : \"\";\n $style = $this->getStyle();\n $func = $this->getFunction();\n\n //$sHTML = \"<SELECT NAME=\\\"\" . $this->objectName . \"[]\\\" ID=\\\"\" . $this->objectName .\"\\\" $disabledStr $this->htmlAttr $style $func>\";\n $sHTML = \"<SELECT NAME=\\\"\" . $this->objectName . \"\\\" ID=\\\"\" . $this->objectName .\"\\\" $disabledStr $this->htmlAttr $style $func>\";\n\n if ($this->blankOption) // ADD a blank option\n {\n $entry = explode(\",\",$this->blankOption);\n $text = $entry[0];\n $value = ($entry[1]!= \"\") ? $entry[1] : null;\n $entryList = array(array(\"val\" => $value, \"txt\" => $text ));\n $fromList = array_merge($entryList, $fromList);\n }\n\n $defaultValue = null;\n foreach ($fromList as $option)\n {\n $test = array_search($option['val'], $valueArray);\n if ($test === false)\n {\n $selectedStr = '';\n }\n else\n {\n $selectedStr = \"SELECTED\";\n $defaultValue = $option['val']; \n }\n $sHTML .= \"<OPTION VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr>\" . $option['txt'] . \"</OPTION>\";\n }\n if($defaultValue == null){\n \t$defaultOpt = array_shift($fromList);\n \t$defaultValue = $defaultOpt['val'];\n \tarray_unshift($fromList,$defaultOpt);\n }\n \n \n $this->setValue($defaultValue);\n $sHTML .= \"</SELECT>\";\n return $sHTML;\n }", "public function getFieldInput($field, $options = '')\n {\n $onblur = $onmouseover = $onmouseout = $onkeyup = $onclick = '';\n if (count($field['html']) > 0)\n {\n if (isset($field['html']['onblur'])) $onblur = $field['html']['onblur'] . ' ';\n if (isset($field['html']['onmouseover'])) $onmouseover = $field['html']['onmouseover'] . ' ';\n if (isset($field['html']['onmouseout'])) $onmouseout = $field['html']['onmouseout'] . ' ';\n if (isset($field['html']['onkeyup'])) $onkeyup = $field['html']['onkeyup'] . ' ';\n if (isset($field['html']['onclick'])) $onclick = $field['html']['onclick'] . ' ';\n }\n\n if ($this->_verifyForm)\n {\n switch ($field['type'])\n {\n case WFT_CC_EXPIRATION:\n break;\n default:\n $onblur .= sprintf(' webFormEditField(\\'%s\\', false, %s); ',\n $field['id'], $field['required'] ? 'true' : 'false'\n );\n break;\n }\n }\n\n $onmouseover .= 'webFormShowErrorBox(this); ';\n $onmouseout .= 'webFormHideErrorBox(); ';\n $onkeyup .= 'webFormHideErrorBox(); ';\n\n if (strlen($field['helpBody']) > 0)\n {\n $onmouseover .= sprintf(\"webFormShowHelpBox(this, '%s', '%s', '%s'); \",\n $field['caption'], $field['helpBody'], $field['helpRules']\n );\n $onmouseout .= 'webFormHideHelpBox(this); ';\n $onkeyup .= 'webFormHideHelpBox(this); ';\n }\n\n // Validate the field when leaving focus\n $onblur .= sprintf(\"webFormValidateField('%s', %s); \",\n $field['id'],($field['required'] ? 'true' : 'false')\n );\n\n $extendedJavaScript = '';\n if (strlen($onblur) > 0) $extendedJavaScript .= sprintf(' onblur=\"%s\"', $onblur);\n if (strlen($onmouseover) > 0) $extendedJavaScript .= sprintf(' onmouseover=\"%s\"', $onmouseover);\n if (strlen($onmouseout) > 0) $extendedJavaScript .= sprintf(' onmouseout=\"%s\"', $onmouseout);\n if (strlen($onkeyup) > 0) $extendedJavaScript .= sprintf(' onkeyup=\"%s\"', $onkeyup);\n if (strlen($onclick) > 0) $extendedJavaScript .= sprintf(' onclick=\"%s\"', $onclick);\n\n switch ($field['type'])\n {\n case WFT_TEXT:\n case WFT_DATE:\n case WFT_PHONE:\n case WFT_EMAIL:\n case WFT_CC_NUMBER:\n case WFT_PASSWORD:\n case WFT_CC_CVV2:\n case WFT_CURRENCY:\n if ($field['type'] == WFT_PASSWORD)\n $type = 'password';\n else\n $type = 'text';\n $input = sprintf(\n \"<input class=\\\"webFormElementText\\\" type=\\\"%s\\\" name=\\\"%s\\\" id=\\\"%s\\\" value=\\\"%s\\\" tabindex=\\\"%d\\\" \"\n . \"size=\\\"%d\\\" maxlength=\\\"%d\\\"%s\",\n $type,\n $field['id'], $field['id'],\n (strlen($field['validatedData']) > 0 ? $field['validatedData'] : $field['defaultValue']),\n $field['tabIndex'], $field['size'], $field['length'][1],\n (strlen($options) > 0 ? ' ' . $options : '')\n );\n $input .= sprintf(' %s', $extendedJavaScript);\n $input .= \" />\\n\";\n break;\n\n case WFT_TEXTAREA:\n $input = sprintf(\n \"<textarea class=\\\"webFormElementTextBox\\\" name=\\\"%s\\\" id=\\\"%s\\\" tabindex=\\\"%d\\\" \"\n . \"rows=\\\"3\\\" cols=\\\"%d\\\" maxlength=\\\"%d\\\"%s %s>%s</textarea>\",\n $field['id'], $field['id'],\n $field['tabIndex'], $field['size'], $field['length'][1],\n (strlen($options) > 0 ? ' ' . $options : ''),\n $extendedJavaScript,\n (strlen($field['validatedData']) > 0 ? $field['validatedData'] : $field['defaultValue'])\n );\n break;\n\n case WFT_CC_TYPE:\n case WFT_SELECT:\n case WFT_BOOLEAN:\n $input = sprintf(\n \"<select class=\\\"webFormElementSelect\\\" name=\\\"%s\\\" id=\\\"%s\\\" tabindex=\\\"%d\\\"%s%s>\\n\"\n . \"<option value=\\\"%s\\\">- Select Option -</option>\\n\",\n $field['id'], $field['id'], $field['tabIndex'],\n (strlen($options) > 0 ? ' ' . $options : ''),\n $extendedJavaScript,\n ($field['required'] ? 'nosel' : '')\n );\n\n $selected = '';\n foreach($field['defaultValue'] as $option)\n {\n if (!strcmp($field['validatedData'], $option['id'])) $selected = $option['id'];\n }\n if ($selected == '')\n {\n foreach($field['defaultValue'] as $option)\n {\n if ($option['selected']) $selected = $option['id'];\n }\n }\n\n foreach($field['defaultValue'] as $option)\n {\n $input .= sprintf(\n \"<option value=\\\"%s\\\"%s>%s</option>\\n\",\n $option['id'], (!strcmp($selected, $option['id']) ? ' selected' : ''), $option['caption']\n );\n }\n $input .= \"</select>\\n\";\n break;\n\n case WFT_CC_EXPIRATION:\n $curYear = intval(date('Y'));\n if (strlen($field['validatedData']) > 0)\n {\n $mp = explode('/', $field['validatedData']);\n $selMonth = $mp[0];\n $selYear = $mp[1];\n }\n else\n {\n $selMonth = 0;\n $selYear = 0;\n }\n $monthScript = sprintf(\n \"<script>document.getElementById('%sMonth').value = '%d';</script>\",\n $field['id'], $selMonth\n );\n $input = sprintf(\n \"<select class=\\\"webFormElementSelect\\\" name=\\\"%sMonth\\\" id=\\\"%sMonth\\\" tabindex=\\\"%d\\\" %s %s>\\n\"\n . \"<option value=\\\"%s\\\">- Select Month -</option>\\n\"\n . \"<option value=\\\"1\\\">1 - January</option>\\n\"\n . \"<option value=\\\"2\\\">2 - February</option>\\n\"\n . \"<option value=\\\"3\\\">3 - March</option>\\n\"\n . \"<option value=\\\"4\\\">4 - April</option>\\n\"\n . \"<option value=\\\"5\\\">5 - May</option>\\n\"\n . \"<option value=\\\"6\\\">6 - June</option>\\n\"\n . \"<option value=\\\"7\\\">7 - July</option>\\n\"\n . \"<option value=\\\"8\\\">8 - August</option>\\n\"\n . \"<option value=\\\"9\\\">9 - September</option>\\n\"\n . \"<option value=\\\"10\\\">10 - October</option>\\n\"\n . \"<option value=\\\"11\\\">11 - November</option>\\n\"\n . \"<option value=\\\"12\\\">12 - December</option>\\n\"\n . \"</select> %s\"\n . \"<select class=\\\"webFormElementSelect\\\" name=\\\"%sYear\\\" id=\\\"%sYear\\\" tabindex=\\\"%d\\\" %s %s>\\n\"\n . \"<option value=\\\"%s\\\">- Select Year -</option>\\n\",\n $field['id'], $field['id'], $field['tabIndex'],\n $extendedJavaScript,\n (strlen($options) > 0 ? ' ' . $options : ''),\n ($field['required'] ? 'nosel' : ''),\n $monthScript,\n $field['id'], $field['id'], $field['tabIndex']+1,\n $extendedJavaScript,\n (strlen($options) > 0 ? ' ' . $options : ''),\n ($field['required'] ? 'nosel' : '')\n );\n\n for ($year=$curYear; $year < $curYear + 15; $year++)\n {\n $input .= sprintf(\n \"<option value=\\\"%d\\\"%s>%d</option>\\n\",\n $year,\n ($year == $selYear ? ' selected' : ''),\n $year\n );\n }\n $input .= \"</select>\\n\";\n break;\n\n case WFT_ANTI_SPAM_IMAGE:\n $graphs = new Graphs();\n $verificationImage = $graphs->verificationImage();\n\n // If there's a relative path, convert the image URL\n if ($this->_relPath != '')\n {\n $verificationImage = str_replace('<img src=\"', sprintf('<img src=\"%s', $this->_relPath), $verificationImage);\n }\n\n $input = sprintf(\n \"<div style=\\\"padding: 0px 0px 0px 0px; text-align: left;\\\">\\n\"\n . \"Please type the characters in the image below (case-insensitive)\\n\"\n . \"<p>\\n%s\\n<p>\\n<input type=\\\"text\\\" name=\\\"%s\\\" id=\\\"%s\\\" size=\\\"8\\\" \"\n . \"maxlength=\\\"10\\\" tabindex=\\\"%d\\\" %s %s>\\n\"\n . \"<div id=\\\"%sCaption\\\" class=\\\"webFormCaption\\\"></div>\\n\"\n . \"</div>\\n\",\n $verificationImage, $field['id'], $field['id'], $field['tabIndex'],\n (strlen($options) > 0 ? ' ' . $options : ''),\n $extendedJavaScript, $field['id']\n );\n break;\n }\n return $input;\n }", "public static function printSimpleField($uniqid, $paramNameEsc, $valueEsc, $classString){\n //Possible values\n $items = static::getValues();\n //Print the field\n echo '<div class=\"relation_field_block ' . $uniqid . '\">' .\n '<select name=\"' . $paramNameEsc . '\" class=\"' . $classString . '\" style=\"width: 100%;\">';\n echo '<option value=\"\">' . static::$emptyValue . '</option>';\n\n foreach ($items as $item) {\n $id = (isset($item->ID)) ? $item->ID : $item->term_id;\n $label = (isset($item->post_title)) ? $item->post_title : $item->name;\n $selected = ($id == $valueEsc) ? 'selected' : '';\n if(!empty(trim($label))) {\n echo '<option value=\"' . $id . '\" ' . $selected . '>' . $label . '</option>';\n }\n }\n\n echo '</select>' . \n '</div>';\n\n echo '<script>jQuery(\".' . $uniqid . ' select\").select2();</script>';\n echo '<style>.select2-drop.select2-drop-active { z-index: 100000; }</style>';\n }", "function displayData_Textbox($strInput)\n{\n\t$strInput = convertHTML(stripslashes($strInput));\n\treturn $strInput;\n}", "public function getHTML(){\n $twig = get_instance()->twig->getTwig();\n $template = $twig->load('sistema/theme/default/lib/field.twig');\n \n return $template->render(array(\n 'element_type' => $this->getElementName()\n , 'type' => $this->getFieldType()\n , 'id' => $this->getId()\n , 'name' => $this->getName()\n , 'title' => $this->getAttr('title')\n , 'class' => $this->getClass()\n , 'form_name' => $this->getFormName()\n , 'error_name' => $this->getErrorName()\n , 'attributes' => $this->getTagAttributes()\n , 'disabled' => $this->hasDisabled()\n ));\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->parameters([\n 'dom' => 'Bfrtip',\n 'order' => [1, 'asc'],\n 'select' => [\n 'style' => 'os',\n 'selector' => 'td:first-child',\n ],\n 'buttons' => [\n /*['extend' => 'create', 'editor' => 'editor'],\n ['extend' => 'edit', 'editor' => 'editor'],\n ['extend' => 'remove', 'editor' => 'editor'],*/\n ]\n ]);\n }", "protected function getInput()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('id as value, title as text')\n\t\t ->from('#__fields')\n\t\t ->where('context = '.$db->quote('com_users.user'))\n\t\t ->where('type IN('.$db->quote('text').', '.$db->quote('media').', '.$db->quote('url').')')\n\t\t;\n\t\t$options = $db->setQuery($query)->loadObjectList();\n\n\t\t$fieldOptions = array(JHtml::_('select.option', '', JText::_('JSELECT')));\n\t\t$fieldOptions = array_merge($fieldOptions, $options);\n\n\t\t$query = 'SHOW COLUMNS FROM #__plg_slogin_profile';\n\t\t$profileFields = $db->setQuery($query)->loadObjectList();\n\n\t\t$disabledFields = array('id', 'user_id', 'slogin_id', 'provider', 'current_profile');\n\n\t\t$html = '<table>';\n\t\tforeach ( $profileFields as $profileField )\n\t\t{\n\t\t\tif(in_array($profileField->Field, $disabledFields)){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$value = isset($this->value[$profileField->Field]) ? $this->value[$profileField->Field] : '';\n\n\t\t\t$html .= '\n\t\t\t<tr>\n\t\t\t\t<td>'.JText::_('PLG_SLOGIN_PROFILE_FIELD_'.strtoupper($profileField->Field)).'</td>\n\t\t\t\t<td>'.JHTML::_('select.genericlist', $fieldOptions, $this->name.'['.$profileField->Field.']', ' class=\"inputbox\"', 'value', 'text', $value).'</td>\n\t\t\t</tr>';\n\t\t}\n\t\t$html .= '</table>';\n\n\t\treturn $html;\n\t}", "function acf_select_input($attrs = array())\n{\n}", "public function getInput()\n {\n $result = array();\n\n $table = new Application_Model_DbOptions();\n $options = array();\n\t\t$options['optRegion'] = $table->getRegion();\n\n // elements\n\t\t$result['src_region_code'] = array(\n 'type' => 'select',\n 'name' => 'src_region_code',\n 'value' => '',\n 'options' => $options['optRegion'],\n 'ext' => 'onChange=\\'$(\"#src_ba\").val(\"\");\\'', //src_afd\n\t\t\t'style' => 'width:200px;background-color: #e6ffc8;'\n );\n\t\t\n\t\t$options['optMatStage'] = $table->getMaturityStage();\n\t\t$result['src_matstage_code'] = array(\n 'type' => 'select',\n 'name' => 'src_matstage_code',\n 'value' => '',\n 'options' => $options['optMatStage'],\n 'ext' => '',\n\t\t\t'style' => 'width:200px;'\n );\n\n return $result;\n }", "private function getJsHtml()\n {\n $disabledAttr = $this->getData('disabled') ? 'disabled' : '';\n\n return <<<HTML\n<input type=\"hidden\"\n id=\"{$this->getHtmlId()}\"\n class=\"{$this->getData('class')}\"\n name=\"{$this->getName()}\"\n {$disabledAttr}\n value=\"{$this->getValue()}\"/>\n<script>\n (function() {\n var radios = document.querySelectorAll(\"input[type='radio'][name='{$this->getName()}']\");\n var hidden = document.getElementById(\"{$this->getHtmlId()}\");\n \n for (var i = 0; i < radios.length; i++) {\n if (radios[i].type === \"radio\") {\n radios[i].name += \"[pseudo]\";\n \n radios[i].disabled = hidden.disabled;\n\n // Keep the hidden input value in sync with the radio inputs. We also create a change event for the\n // hidden input because core functionality might listen for it (and the original radio inputs will not\n // report the correct ID).\n //\n // @see module-backend/view/adminhtml/templates/system/shipping/applicable_country.phtml\n radios[i].addEventListener(\"change\", function (event) {\n event.stopPropagation();\n hidden.value = event.target.value;\n hidden.disabled = event.target.disabled;\n\n var newEvent = document.createEvent(\"HTMLEvents\");\n newEvent.initEvent(\"change\", false, true);\n hidden.dispatchEvent(newEvent);\n });\n }\n }\n })();\n</script>\nHTML;\n }", "protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)\n {\n $this->setElement($element);\n\n $html = '<div id=\"shippingconfig_template\" style=\"display:none\">';\n $html .= $this->_getRowTemplateHtml();\n $html .= '</div>';\n\n $html .= '\n <script type=\"text/javascript\">\n /* sorry, i\\'m not a js-wizard :( */\n\n var filter_btn;\n\n function shippingconfig_filter_show(btn) {\n filter_btn = btn;\n $(\\'shippingconfig_filter_name\\').update($(btn).up(1).down(\\'.name\\').value);\n if($(btn).up(1).down(\\'.filter\\').value == \\'\\') {\n $(btn).up(1).down(\\'.filter\\').value = \\'min_qty:;max_qty:;min_subtotal:;max_subtotal:;min_weight:;max_weight:;countries:;payment:;\\';\n }\n\n filter = $(btn).up(1).down(\\'.filter\\').value.split(\\';\\').each(function(e,i) {\n e = e.split(\\':\\');\n if($(\\'shippingconfig_filter_\\' + e[0])) {\n $(\\'shippingconfig_filter_\\' + e[0]).value = e[1];\n }\n } );\n $(\\'shippingconfig_filter\\').show();\n }\n\n function shippingconfig_filter_hide() {\n btn = filter_btn;\n $(\\'shippingconfig_filter\\').hide();\n\n filter = \\'min_qty:\\' + $(\\'shippingconfig_filter_min_qty\\').value + \\';\\';\n filter += \\'max_qty:\\' + $(\\'shippingconfig_filter_max_qty\\').value + \\';\\';\n filter += \\'min_subtotal:\\' + $(\\'shippingconfig_filter_min_subtotal\\').value + \\';\\';\n filter += \\'max_subtotal:\\' + $(\\'shippingconfig_filter_max_subtotal\\').value + \\';\\';\n filter += \\'min_weight:\\' + $(\\'shippingconfig_filter_min_weight\\').value + \\';\\';\n filter += \\'max_weight:\\' + $(\\'shippingconfig_filter_max_weight\\').value + \\';\\';\n filter += \\'countries:\\' + $(\\'shippingconfig_filter_countries\\').value + \\';\\';\n filter += \\'payment:\\' + $(\\'shippingconfig_filter_payment\\').value + \\';\\';\n\n $(btn).up(1).down(\\'.filter\\').value = filter;\n\n }\n </script>\n <div id=\"shippingconfig_filter\" style=\"width:500px;position:absolute;z-index:999;display: none;\">\n <div class=\"entry-edit-head\"><strong>' . $this->__('configure filter') . ' <span id=\"shippingconfig_filter_name\"></span></strong></div>\n <div class=\"box\">\n ' . $this->__('(empty fields will be ignored)') . '<br/>\n <table border=\"0\">\n <tr>\n <td>' . $this->__('min. QTY:') . '</td><td><input class=\"input-text\" style=\"width: 100px;\" id=\"shippingconfig_filter_min_qty\"/></td>\n <td>' . $this->__('max. QTY:') . '</td><td><input class=\"input-text\" style=\"width: 100px;\" id=\"shippingconfig_filter_max_qty\"/></td>\n </tr>\n <tr>\n <td>' . $this->__('min. subtotal:') . '</td><td><input class=\"input-text\" style=\"width: 100px;\" id=\"shippingconfig_filter_min_subtotal\"/></td>\n <td>' . $this->__('max. subtotal:') . '</td><td><input class=\"input-text\" style=\"width: 100px;\" id=\"shippingconfig_filter_max_subtotal\"/></td>\n </tr>\n <tr>\n <td>' . $this->__('min. weight:') . '</td><td><input class=\"input-text\" style=\"width: 100px;\" id=\"shippingconfig_filter_min_weight\"/></td>\n <td>' . $this->__('max. weight:') . '</td><td><input class=\"input-text\" style=\"width: 100px;\" id=\"shippingconfig_filter_max_weight\"/></td>\n </tr>\n <tr>\n <td colspan=\"2\">' . $this->__('limit to countries: (e.g. \"DE\" or \"DE,AT,CH\"). Use ! as first character to exclude from specified countries (e.g. \"!DE,AT\"). You cannot combine include and exclude right now!') . '</td><td colspan=\"2\"><input class=\"input-text\" style=\"width: 100px;\" id=\"shippingconfig_filter_countries\"/></td>\n </tr>\n <tr>\n <td colspan=\"2\">' . $this->__('limit payment methods: (payment method code, comma-separated, e.g. \"checkmo\")') . '</td><td colspan=\"2\"><input class=\"input-text\" style=\"width: 100px;\" id=\"shippingconfig_filter_payment\"/></td>\n </tr>\n </table>\n <div style=\"text-align: right;\">\n <button onclick=\"shippingconfig_filter_hide()\" type=\"button\">' . $this->__('save filter') . '</button>\n </div>\n </div>\n </div>';\n\n $html .= $this->_getAddRowButtonHtml('shippingconfig_container', 'shippingconfig_template', $this->__('Add'));\n\n $html .= '<ul id=\"shippingconfig_container\">';\n $html .= '<li style=\"width: 500px;\">\n <span style=\"border-left: dotted 1px #888; padding: 0 5px;margin: 0 2px;width: 100px;display: inline-block;\">' . $this->__('code') . '</span>\n <span style=\"border-left: dotted 1px #888; padding: 0 5px;margin: 0 2px;width: 30px;display: inline-block;\">' . $this->__('price') . '</span>\n <span style=\"border-left: dotted 1px #888; padding: 0 5px;margin: 0 2px;width: 150px;display: inline-block;\">' . $this->__('description') . '</span>\n <span style=\"border-left: dotted 1px #888; padding: 0 5px;margin: 0 2px;width: 100px;display: inline-block;\">' . $this->__('notification mail (optional)') . '</span>\n <span style=\"border-left: dotted 1px #888; padding: 0 5px;margin: 0 2px;width: 100px;display: none;\">' . $this->__('filter') . '</span>\n </li>';\n\n if ($this->_getValue('code')) {\n foreach ($this->_getValue('code') as $k => $v) {\n if ($k) {\n $html .= $this->_getRowTemplateHtml($k);\n }\n }\n }\n $html .= '</ul>';\n\n return $html;\n }", "public function getValueEncoded($field) {\n return htmlspecialchars($this->getValue($field));\n}", "public function valiteForm();", "protected function getInput()\n\t{\n\t\t// helper getter\n\t\t$this->helper_getter = $this->getAttribute('helper_getter');\n\n\t\t// get the translatable condition\n\t\t$this->translate = $this->getAttribute('translate');\n\n\t\t// get the exclude key values\n\t\t$this->exclude = $this->getAttribute('exclude');\n\n\t\t// get the empty_option value\n\t\t$this->empty_option = $this->getAttribute('empty_option');\n\n\t\t// get the first_param value\n\t\t$this->first_param = $this->getAttribute('first_param');\n\n\t\t$html = array();\n\t\t$attr = '';\n\n\t\t// Initialize some field attributes.\n\t\t$attr .= !empty($this->class) ? ' class=\"' . $this->class . '\"' : '';\n\t\t$attr .= !empty($this->size) ? ' size=\"' . $this->size . '\"' : '';\n\t\t$attr .= $this->multiple ? ' multiple' : '';\n\t\t$attr .= $this->required ? ' required aria-required=\"true\"' : '';\n\t\t$attr .= $this->autofocus ? ' autofocus' : '';\n\n\t\t// To avoid user's confusion, readonly=\"true\" should imply disabled=\"true\".\n\t\tif ((string) $this->readonly == '1' || (string) $this->readonly == 'true' || (string) $this->disabled == '1'|| (string) $this->disabled == 'true')\n\t\t{\n\t\t\t$attr .= ' disabled=\"disabled\"';\n\t\t}\n\n\t\t// Initialize JavaScript field attributes.\n\t\t$attr .= $this->onchange ? ' onchange=\"' . $this->onchange . '\"' : '';\n\n\t\t// Get the field options.\n\t\t$options = (array) $this->getOptions();\n\n\t\t// Create a read-only list (no name) with hidden input(s) to store the value(s).\n\t\tif ((string) $this->readonly == '1' || (string) $this->readonly == 'true')\n\t\t{\n\t\t\t$html[] = JHtml::_('select.genericlist', $options, '', trim($attr), 'value', 'text', $this->value, $this->id);\n\n\t\t\t// E.g. form field type tag sends $this->value as array\n\t\t\tif ($this->multiple && is_array($this->value))\n\t\t\t{\n\t\t\t\tif (!count($this->value))\n\t\t\t\t{\n\t\t\t\t\t$this->value[] = '';\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->value as $value)\n\t\t\t\t{\n\t\t\t\t\t$html[] = '<input type=\"hidden\" name=\"' . $this->name . '\" value=\"' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '\"/>';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html[] = '<input type=\"hidden\" name=\"' . $this->name . '\" value=\"' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '\"/>';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t// Create a regular list passing the arguments in an array.\n\t\t{\n\t\t\t$listoptions = array();\n\t\t\t$listoptions['option.key'] = 'value';\n\t\t\t$listoptions['option.text'] = 'text';\n\t\t\t$listoptions['list.select'] = $this->value;\n\t\t\t$listoptions['id'] = $this->id;\n\t\t\t$listoptions['list.translate'] = false;\n\t\t\t$listoptions['option.attr'] = 'optionattr';\n\t\t\t$listoptions['list.attr'] = trim($attr);\n\n\t\t\t$html[] = JHtml::_('select.genericlist', $options, $this->name, $listoptions);\n\t\t}\n\n\t\treturn implode($html);\n\t}", "function printForm(){\n\n\t\tif( $this->returnOutput ){\n\n\t\t\tob_start();\n\t\t\techo $this->openForm();\n\t\t\tfor ($n=0; $n < $this->columns; $n++) $this->_outputField($n);\n\t\t\techo $this->closeForm();\n\t\t\t$html_block = ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\treturn $html_block;\n\n\t\t} else {\n\n\t\t\t$this->openForm();\n\t\t\tfor ($n=0; $n < $this->columns; $n++) $this->_outputField($n);\n\t\t\t$this->closeForm();\n\n\t\t}\n\n\t}", "public static function val_html($val, $fieldname) { #keep\n do_log(\"top of val_html(val='$val', fieldname='$fieldname')\\n\");\n if (DbUtil::seems_like_pg_array($val)) {\n $vals = DbUtil::pgArray2array($val);\n return self::array_as_html_list($vals);\n }\n elseif (self::is_url($val)) {\n { ob_start();\n $val = htmlentities($val);\n?>\n <a href=\"<?= $val ?>\" target=\"_blank\">\n <?= $val ?>\n </a>\n<?php\n return ob_get_clean();\n }\n }\n elseif (self::isTableNameVal($val, $fieldname)) {\n { # vars\n $tablename = $val;\n $cmp = class_exists('Campaign');\n $hasPhpExt = !$cmp;\n $local_uri = ($hasPhpExt\n ? 'db_viewer.php'\n : 'db_viewer');\n }\n\n { ob_start(); # provide a link\n $val = htmlentities($val);\n?>\n <a href=\"<?= $local_uri ?>?sql=select * from <?= $tablename ?> limit 100\"\n target=\"_blank\"\n >\n <?= $val ?>\n </a>\n<?php\n return ob_get_clean();\n }\n }\n else {\n $val = htmlentities($val);\n $val = nl2br($val); # show newlines as <br>'s\n\n { # get bigger column width for longform text fields\n #todo factor this logic in the 2 places we have it\n # (here and in dash)\n if ($fieldname == 'txt'\n || $fieldname == 'src'\n ) {\n ob_start();\n?>\n <div class=\"wide_col\">\n <?= $val ?>\n </div>\n<?php\n return ob_get_clean();\n }\n }\n\n return $val;\n }\n }", "function Dojo_editform() \n{\n $DojoName = params('dojo');\n $DojoName = str_replace('%20', ' ', $DojoName);\n $xml = Find_Dojo_all();\n $dojo_data = '';\n foreach ( $xml->Dojo as $dojo ) {\n if ($dojo->DojoName == $DojoName ) {\n set('Dojo', $dojo);\n print( $dojo );\n }\n }\n return html('dojo/edit_form.html.php');\n}", "function TableRowOptionBox($label, $value, $defaultvalue, $text, $action, $fieldname, $title=\"\",\n\t$classtdTitle=\"inputParamName\", $classtdValue=\"inputParamValue\")\n{\n $stringUtils = new StringUtils ();\n $result = '';\n\n if (isset($action))\n {\n\t $result = '<tr>';\n\t\t// First field contains the name\n\t\t$result .= '<td class=\"'.$classtdTitle.'\">'.$stringUtils->urlEncodeQuotes($title).':</td>';\n\t\t// Second field contains the value\n\t\t$result .= '<td class=\"'.$classtdValue.'\">';\n\t switch ($action)\n\t {\n\t \tcase 'add':\n\t \tcase 'modify':\n\t if (NULL == $defaultvalue)\n\t {\n\t\t\t\t\t$defaultvalue = $value[0];\n\t\t\t\t}\n\t $result .= '<select name=\"'.$fieldname.'\">';\n\t\t\t\t$result .= OptionBox($label, $value, $defaultvalue, $text);\n\t\t\t\t$result .= '</select>';\n\t \t\tbreak;\n\t\t\tcase 'show':\n\t \t$i = array_search($value, $defaultvalue);\n\t \tif ($i)\n\t \t{\n\t $result .= $text[$i];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t$result .= '</td>';\n\t\t$result .= '</tr>';\n\t}\n\treturn $result;\n}", "function jabHtmlInput($label, $id, $value, $class=\"\", $name=\"\")\n{\n\tif ($name==\"\")\n\t\t$name=$id;\n\tif ($class!=\"\")\n\t\t$class=\" class=\\\"\".$class.\"\\\"\";\n\t$value=htmlspecialchars($value);\n\techo \"<label for=\\\"$name\\\">$label</label><input$class type=\\\"text\\\" id=\\\"$id\\\" name=\\\"$name\\\" value=\\\"$value\\\">\\n\";\n}", "function print_multi_text_field($id, $options = array()) {\n\tif (isset($_GET[\"error_$id\"])) {\n\t\tarray_push($options['class'], 'error');\n\t}\n\t$classes_html = build_class_attribute($options['required'], $options['class']);\n?>\n\t<td <?php echo $classes_html ?>>\n\t<input type=\"text\"\n\t\tname=\"<?php echo htmlentities($id) ?>\"\n\t\tid=\"<?php echo htmlentities($id) ?>\"\n\t\tvalue=\"<?php echo print_html($options['value']) ?>\"\n\t\t<?php echo $classes_html ?>\n\t/>\n\t</td>\n<?php\n}" ]
[ "0.6600523", "0.64153105", "0.64000636", "0.63812774", "0.61868465", "0.61419153", "0.6141889", "0.6115424", "0.6102133", "0.59421104", "0.5936112", "0.59335554", "0.59229463", "0.5908955", "0.5908015", "0.5882021", "0.5858427", "0.58304125", "0.582967", "0.5822831", "0.58196974", "0.58131236", "0.57878286", "0.5781186", "0.57774365", "0.5758593", "0.5753511", "0.57396996", "0.5735812", "0.5724812", "0.5714419", "0.57142574", "0.570528", "0.57031876", "0.5702766", "0.5702408", "0.56940687", "0.56868106", "0.5685526", "0.56664586", "0.56652963", "0.56589323", "0.5658343", "0.56525564", "0.5652254", "0.5626228", "0.5619736", "0.56121063", "0.5610854", "0.5606831", "0.56064177", "0.56064177", "0.56010437", "0.56007314", "0.55998945", "0.5598447", "0.55912447", "0.5590298", "0.55830526", "0.55689216", "0.5567657", "0.55636376", "0.5549807", "0.5544348", "0.55428374", "0.55394804", "0.55330735", "0.553296", "0.5531244", "0.55211425", "0.55128825", "0.55115306", "0.55089253", "0.54991513", "0.5495826", "0.54924095", "0.5490696", "0.5490498", "0.5482815", "0.5480533", "0.5477335", "0.54724336", "0.5471964", "0.5471554", "0.54649985", "0.5463925", "0.5460709", "0.5457859", "0.5453604", "0.54534847", "0.54504085", "0.544957", "0.5445692", "0.5439375", "0.54361093", "0.5435968", "0.543414", "0.54228705", "0.54223007", "0.54182744", "0.5415343" ]
0.0
-1
decide if a field will be an or
function inputOrTextarea($name, $table=null) { $fields_to_make_textarea = Config::$config['fields_to_make_textarea']; $fields_to_make_textarea_by_table = Config::$config['fields_to_make_textarea_by_table']; if (in_array($name, $fields_to_make_textarea)) { return'textarea'; } elseif ($table && isset($fields_to_make_textarea_by_table[$table]) && in_array($name, $fields_to_make_textarea_by_table[$table]) ) { return 'textarea'; } else { return 'input'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isOr();", "public function useOr()\n {\n $this->imploder = ' OR ';\n }", "protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}", "public function orFlag($or = null)\n {\n if(null === $or)\n {\n return $this->property('or');\n }\n return $this->property('or', (bool) $or);\n }", "public static function static_logicalOr($a = null, $b = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function testOrRule()\n {\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true'\n ), 'or');\n $this->assertTrue($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'false'\n ), 'or');\n $this->assertFalse($rule->validate());\n }", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "static function logicalOr()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalOr', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function containsOr()\n\t{\n\t\t$args = (new static(func_get_args()))->flattenIt();\n\n\t\t$found = $args->detect(function($value) {\n\t\t\treturn in_array($value, $this->attributes);\n\t\t});\n\n\t\treturn !is_null($found);\n\t}", "function variant_or($left, $right) {}", "public function orNull();", "function _field_checkarray_or($fval) \n {\n return $this->_field_checkarray($fval, 1);\n }", "public function orWhere($field, $operator, $value);", "function or_like($field, $match = '', $side = 'both')\r\n\t{\r\n\t\treturn $this->_like($field, $match, 'OR ', $side);\r\n\t}", "public function hasOrWhere()\n {\n return $this->_has('_orWhere');\n }", "public function isUnion() : bool\n {\n return $this->kind === '|';\n }", "public function isCombField() {}", "public function has_or_relation()\n {\n }", "function _ting_boost_field_filter($element) {\n return !(empty($element['field_name']) || empty($element['field_value']));\n}", "public function testOrCondition() {\n\t\t$products = $this->productsManager->find(Q::orfilter(Attr::id()->eq(5), Attr::id()->eq(3)));\n\t\t$this->assertCount(2, $products);\n\t}", "function yy_r146(){ $this->_retvalue = new Stmt\\Expr('or', $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "public function isField() : bool\n {\n return null == $this->fields || empty($this->fields);\n }", "function is_field_type($name)\n {\n }", "function acf_is_field_type($name = '')\n{\n}", "function or_not_like($field, $match = '', $side = 'both')\r\n\t{\r\n\t\treturn $this->_like($field, $match, 'OR ', $side, 'NOT');\r\n\t}", "public function or_like($field, $match = '', $side = 'both', $escape = NULL)\n\t{\n\t\treturn $this->_like($field, $match, 'OR ', $side, '', $escape);\n\t}", "function is_field_displayed($field)\n {\n global $ref, $resource, $upload_review_mode;\n\n # Field is an archive only field\n return !(($resource[\"archive\"]==0 && $field[\"resource_type\"]==999)\n # Field has write access denied\n || (checkperm(\"F*\") && !checkperm(\"F-\" . $field[\"ref\"])\n && !($ref < 0 && checkperm(\"P\" . $field[\"ref\"])))\n || checkperm(\"F\" . $field[\"ref\"])\n # Upload only field\n || (($ref < 0 || $upload_review_mode) && $field[\"hide_when_uploading\"] && $field[\"required\"]==0)\n || hook('edithidefield', '', array('field' => $field))\n || hook('edithidefield2', '', array('field' => $field)));\n }", "function isset_or(&$var, $or = null) {\n return isset($var) ? $var : $or;\n}", "public function orWhere($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_where, Predicate::EITHER, $field, $op, $value);\n }", "public static function logicalOr(Matcher $matcher /*...*/)\n {\n return new Matcher\\LogicalOr(func_get_args());\n }", "public function orWhere($table,$column,$data = \"\");", "final public static function or($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' OR ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' OR ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "function acf_is_field($field = \\false, $id = '')\n{\n}", "public function orWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function isAnd();", "private function isField($fld)\n {\n return isset($this->columns->{$fld});\n }", "public function orElse($alternative);", "public function havingOR()\n {\n $this->having .= \" OR \";\n }", "public function orBracketOpen()\n {\n return $this->bracketOpen('', 'OR ');\n }", "public function orWhereComplex()\n {\n return $this->addComplexCondition('or', $this->conditions);\n }", "public function getShouldFieldBeOverlaidData() {}", "public function has($_field);", "abstract public function getOrElse($else);", "public function orWhere()\n {\n if ( func_num_args() == 2 )\n {\n list($field, $value) = func_get_args();\n $op = '=';\n }\n else\n {\n list($field, $op, $value) = func_get_args();\n }\n $this->appendWhere('OR', $field, $op, $value); \n return $this;\n }", "public function hasField();", "public function getOrFilter() {\n\t\treturn $this->db->getOrFilter();\n\t}", "public function orWhere()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => $value]);\n }", "function drush_behat_op_is_field($is_field_info) {\n list($entity_type, $field_name) = $is_field_info;\n return _drush_behat_is_field($entity_type, $field_name);\n}", "function acf_get_valid_field($field = \\false)\n{\n}", "function _field_select_or($fval) \n {\n\n $aux_val = '';\n $res = '';\n\n // aux value is set - for useability, dont show anything in the dropdown - and show the valu in the box\n if (!in_array($fval, $this->opts) && !in_array($fval, array_keys($this->opts))) {\n $aux_val = $fval;\n $fval = '';\n $this->attribs['top_value'] = ' ';\n }\n\n if (count($this->opts) > 0) {\n $res = \"choose a previous value: \";\n $res .= $this->_field_select($fval);\n $res .= \"<br />or \"; \n }\n\n // set up new field object for the textares - has '_aux' appended to the name!\n $orsize = $this->_get_field_size() - 15; // comp. for \"enter a new one\" (can use only w/ single-selects)\n $orfield = new formex_field($this->fex, $this->name.'_aux', array('Aux field', 'text', '', array('size'=>$orsize), null));\n $orfield->render_html($aux_val);\n\n $res .= \"enter a new one:\";\n $res .= $orfield->html;\n unset($orfield);\n return $res;\n }", "private function conditional_hit_type($field, $value) {\n\n\t\tswitch ($field) {\n\n\t\t\tcase 't':\n\t\t\t\tif ($value == 'event') {\n\t\t\t\t\t$this->add_mandatory_parameter('ec');\n\t\t\t\t\t$this->add_mandatory_parameter('ea');\n\t\t\t\t}\n\t\t\t\tif ($value == 'screenview')\n\t\t\t\t\t$this->add_mandatory_parameter('sn');\n\t\t\t\tbreak;\n\n\t\t\tcase 'qt':\n\t\t\t\tif ($value > $this->_qt_max) {\n\t\t\t\t\techo \"qt is too high </br>\\n\";\n\t\t\t\t\treturn False;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n//We assume that wci means wui in the spec\n\t\t\tcase 'wui':\n\t\t\t\t$userList = new UserList;\n\t\t\t\tif (!in_array($value, $userList->get_userlist())) {\n\t\t\t\t\techo \"User unknown </br>\\n\";\n\t\t\t\t\treturn False;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn True;\n\t}", "function _matches($field, $other_field)\r\n\t{\r\n\t\treturn ($this->{$field} !== $this->{$other_field}) ? FALSE : TRUE;\r\n\t}", "function field_edit($name)\r\n {\r\n if (right::superuser()) return (true);\r\n \r\n $rightArray = right::get_field($name);\r\n $userRight = right::get(\"rights\");\r\n\r\n if ($rightArray[edit]) return($userRight & $rightArray[edit]);\r\n else return(false); // default no edit\r\n }", "static function _OR($params1, $params2){\n /* del parametro 1 separa el campo del valor */\n $params_1 = explode('=', $params1);\n $campo1 = trim($params_1[0]);\n $var1 = trim($params_1[1]);\n\n /* del parametro 2 separa el campo del valor */\n $params_2 = explode('=', $params2);\n $campo2 = trim($params_2[0]);\n $var2 = trim($params_2[1]);\n\n if($campo1 != $campo2)\n throw new \\Exception('Unexpected error creating OR clause. The fields involved should be the same.');\n\n /* busca si existe el campo en el modelo en cuestion */\n if(aModels::findFieldModel($campo1) == 'STRING'){\n return \"(\". $campo1 . \"= '\" .(strip_tags($var1)). \"' {or} \". $campo2 . \"= '\" .(strip_tags($var2)) .\"')\";\n }else\n return '('. $params1 . ' {or} '. $params2 .')';\n }", "function isRight() { # :: Either a b -> Bool\n return Bool(True);\n }", "function check_db_fields($db_fields, &$args) {\n\tif (!is_array($args)) {\n\t\treturn false;\n\t}\n\n\tforeach ($db_fields as $field => $def) {\n\t\tif (!isset($args[$field])) {\n\t\t\tif (is_null($def)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$args[$field] = $def;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "public function whereOR()\n {\n $this->where_clause .= \" OR \";\n }", "public function orWhere($operand, $operatorOrValue=null, $value=null);", "public function orNotBracketOpen()\n {\n return $this->bracketOpen('NOT ', 'OR ');\n }", "public function isField($field_name){\n\t\treturn isset($this->Fields[$field_name]) && is_object($this->Fields[$field_name]);\n\t}", "public function or_not_like($field, $match = '', $side = 'both', $escape = NULL)\n\t{\n\t\treturn $this->_like($field, $match, 'OR ', $side, 'NOT', $escape);\n\t}", "public function or()\n {\n $this->logicQueue = 'or';\n\n return $this;\n }", "function orB($lhs = null, $rhs = null)\n{\n return call_user_func_array(__PRIVATE__::$instance[orB], func_get_args());\n}", "public function isOptional($field) {\n return !$this->isRequired($field);\n }", "public function isValue()\n {\n return\n $this->type === 'string' ||\n $this->type === 'number' ||\n $this->type === 'null' ||\n $this->type === 'boolTrue' ||\n $this->type === 'boolFalse';\n }", "public function or_not_group_start()\n\t{\n\t\treturn $this->group_start('NOT ', 'OR ');\n\t}", "public function isOperator()\n {\n return\n $this->type === 'plus' ||\n $this->type === 'minus' ||\n $this->type === 'slash' ||\n $this->type === 'star';\n }", "public function createOr()\n {\n $o = new OrSelector();\n $this->appendSelector($o);\n\n return $o;\n }", "function is_set($field) {\n\t\treturn isset($this->data[$field]) || isset($this->associations[$field]);\n\n\t}", "public function whereOr($value) {\n\t$this->parseQuery->where('$or', $value);\n }", "function field_view($name)\r\n {\r\n if (right::superuser()) return (true);\r\n \r\n $fieldRight = right::get_field($name);\r\n $view = $fieldRight[view];\r\n\r\n $userRight = right::get(\"rights\");\r\n\r\n if ($view != 0) return($userRight & $view);\r\n else return(false); // default no display\r\n }", "private function checkMergeFields($mergeFields)\n {\n if (!empty($mergeFields) && is_array($mergeFields)) {\n return true;\n }\n \n return false;\n }", "public function conditionalOrExpression(){\n try {\n // Sparql11query.g:382:3: ( conditionalAndExpression ( OR conditionalAndExpression )* ) \n // Sparql11query.g:383:3: conditionalAndExpression ( OR conditionalAndExpression )* \n {\n $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1301);\n $this->conditionalAndExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:383:28: ( OR conditionalAndExpression )* \n //loop48:\n do {\n $alt48=2;\n $LA48_0 = $this->input->LA(1);\n\n if ( ($LA48_0==$this->getToken('OR')) ) {\n $alt48=1;\n }\n\n\n switch ($alt48) {\n \tcase 1 :\n \t // Sparql11query.g:383:29: OR conditionalAndExpression \n \t {\n \t $this->match($this->input,$this->getToken('OR'),self::$FOLLOW_OR_in_conditionalOrExpression1304); \n \t $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1306);\n \t $this->conditionalAndExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop48;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "private function isString($field)\n {\n return (!is_string($field)) ? false : true;\n\n }", "public function isFieldFlagSet($flag) {}", "function _or( $value ) {\n\t\tif(strpos($this->prefixes, \"(\") === false)\n\t\t\t$this->prefixes .= \"(\";\n\t\tif(strpos($this->suffixes, \")\") === false)\n\t\t\t$this->suffixes .= \")\";\n\n\t\t$this->add(\")|(\");\n\t\tif($value)\n\t\t\t$this->add($value);\n\n\t\treturn $this;\n\n\t}", "protected function allowedLogicalOperators(): array\n {\n return [\n FieldCriteria::AND,\n FieldCriteria::OR,\n ];\n }", "public static function orOp($left, $right)\n {\n self::checkParameter($left, $right);\n $f = self::checkMathFunc('or');\n $bignumber = $f || self::operIsBig($left, $right);\n if($f) {\n return $f($left, $right);\n } elseif($bignumber) {\n $len = self::bitLen($left, $right);\n return self::strBitOp($left, $right, $len, function ($l, $r) {\n return $l | $r;\n });\n }\n return $left | $right;\n }", "public function testBuildWhereOnlyOr()\n {\n $query = $this->getQuery()\n ->whereOr(\n $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->where('is_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE (table1.id = '100' OR table1.is_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function orLike($column,$data,$wildCardPlacement);", "public function orWhere($column, $operator = null, $value = null);", "public function testBuildWhereWithOr()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where('is_super_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR is_super_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function text_or_binary()\n {\n }", "public function hasField(){\n return $this->_has(2);\n }", "public function or_where($key, $char = NULL)\r\n {\r\n return $this->_where($key, $char, 'OR ');\r\n }", "function sql_is_compare_operator($op){\n\treturn in_array($op, array('=', 'LIKE', 'NOT LIKE', 'NOT', '<>'));\n}", "private function is_meta_field( $key ) {\n\t\treturn '_' === $key[0];\n\t}", "function acf_is_field_group($field_group = \\false)\n{\n}", "public function can_select()\n {\n return $this->allowDelete || $this->allowEdit;\n }", "function isTextType($type)\n{\n return($type == \"string\" or $type == \"varchar\" or $type == \"tinytext\" or $type == \"password\" or\n $type == \"set\" or $type == \"enum\" or $type == \"char\" or $type == \"file\" or isTextAreaType($type));\n}", "function NonTextFilterApplied(&$fld) {\n\t\tif (is_array($fld->DefaultDropDownValue) && is_array($fld->DropDownValue)) {\n\t\t\tif (count($fld->DefaultDropDownValue) <> count($fld->DropDownValue))\n\t\t\t\treturn TRUE;\n\t\t\telse\n\t\t\t\treturn (count(array_diff($fld->DefaultDropDownValue, $fld->DropDownValue)) <> 0);\n\t\t}\n\t\telse {\n\t\t\t$v1 = strval($fld->DefaultDropDownValue);\n\t\t\tif ($v1 == EWRPT_INIT_VALUE)\n\t\t\t\t$v1 = \"\";\n\t\t\t$v2 = strval($fld->DropDownValue);\n\t\t\tif ($v2 == EWRPT_INIT_VALUE || $v2 == EWRPT_ALL_VALUE)\n\t\t\t\t$v2 = \"\";\n\t\t\treturn ($v1 <> $v2);\n\t\t}\n\t}", "function NonTextFilterApplied(&$fld) {\n\t\tif (is_array($fld->DefaultDropDownValue) && is_array($fld->DropDownValue)) {\n\t\t\tif (count($fld->DefaultDropDownValue) <> count($fld->DropDownValue))\n\t\t\t\treturn TRUE;\n\t\t\telse\n\t\t\t\treturn (count(array_diff($fld->DefaultDropDownValue, $fld->DropDownValue)) <> 0);\n\t\t}\n\t\telse {\n\t\t\t$v1 = strval($fld->DefaultDropDownValue);\n\t\t\tif ($v1 == EWRPT_INIT_VALUE)\n\t\t\t\t$v1 = \"\";\n\t\t\t$v2 = strval($fld->DropDownValue);\n\t\t\tif ($v2 == EWRPT_INIT_VALUE || $v2 == EWRPT_ALL_VALUE)\n\t\t\t\t$v2 = \"\";\n\t\t\treturn ($v1 <> $v2);\n\t\t}\n\t}", "public function isInputField($field)\n {\n return ! is_null(array_get($this->data, $field));\n }", "public function isAllowOtherConditions() {\n return $this->allow_other_conditions;\n }", "public function isOr($roles)\n {\n return !!$this->roles->whereIn('slug', (array)$roles)->count();\n }", "public function isOrsApproved() {\r\n global $db;\r\n\r\n $sql = sprintf('SELECT approvalType.type, approvalType.friendlyName, approvals.*\r\n FROM forms_tracking_approvals as approvals\r\n LEFT JOIN forms_approval_type as approvalType ON approvals.approval_type_id = approvalType.id\r\n WHERE `approvals`.`tracking_id` = %s AND `approval_type_id` IN (%s, %s)'\r\n , $this->trackingFormId, COI, ORS_REVIEW);\r\n $approvals = $db->getAll($sql);\r\n\r\n if(empty($approvals)) {\r\n return true; // no required approvals we assume approved.\r\n } else {\r\n $numApprovals = count($approvals);\r\n $i = 0;\r\n $approved = 1;\r\n // iterate through each approval and bitwise 'and' with the previous result\r\n while($i < $numApprovals) {\r\n $approved = $approvals[$i]['approved'] & $approved;\r\n $i++;\r\n }\r\n }\r\n\r\n return $approved;\r\n }", "function has_sub_field($field_name, $post_id = \\false)\n{\n}", "function pseudoTypeFalseAndBool(bool|false $var = false) {}", "function check($key) {\n\t\tswitch ($key) {\n\t\t\tcase 'name':\n\t\t\tcase 'email':\n\t\t\tcase 'type_demande':\n\t\t\t\t// field(s) is(are) compulsory\n\t\t\t\treturn $this->checkEmpty($key);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// any other field is fine as it is\n\t\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}", "function cmb_id_only($field) { global $post; return ($post->ID == 626 || $post->ID == 7 ) ; }", "public function is_other_choice() {\n return (self::content_is_other_choice($this->content));\n }" ]
[ "0.784892", "0.64803207", "0.6404991", "0.6402417", "0.6307742", "0.6279862", "0.6230594", "0.6225763", "0.6151024", "0.61423516", "0.60762316", "0.60149133", "0.5905267", "0.5867836", "0.5826702", "0.57914704", "0.57892126", "0.57688487", "0.5762928", "0.57293683", "0.56777865", "0.55559146", "0.55483353", "0.5542658", "0.5533918", "0.5478705", "0.5444017", "0.5442315", "0.5439374", "0.542015", "0.5419353", "0.5392455", "0.5390689", "0.5388247", "0.53874665", "0.5378847", "0.5346072", "0.53396916", "0.53124666", "0.5308661", "0.5300815", "0.52972823", "0.52924716", "0.52894914", "0.5276073", "0.5274888", "0.52745354", "0.52680916", "0.5267462", "0.5267205", "0.52628696", "0.52439076", "0.522936", "0.5222387", "0.5210174", "0.51942086", "0.5192344", "0.51875687", "0.5186248", "0.5182103", "0.5181538", "0.51735836", "0.51714045", "0.5162103", "0.51539344", "0.5150595", "0.5132135", "0.51283675", "0.5127875", "0.51204616", "0.5116964", "0.5112299", "0.5110732", "0.50922376", "0.5083545", "0.50831556", "0.50684905", "0.506528", "0.50534457", "0.5049327", "0.5047527", "0.5043177", "0.5042686", "0.50272024", "0.5023764", "0.5021993", "0.50217223", "0.50191844", "0.50133544", "0.5000786", "0.49911293", "0.49911293", "0.49891308", "0.49881798", "0.49773055", "0.49707735", "0.49606895", "0.49354315", "0.4933529", "0.4927512", "0.49265748" ]
0.0
-1
add backslashes at end of line
function jsStringify($txt) { $txt = str_replace("\n", "\\n\\"."\n", $txt); // escape single quotes $txt = str_replace("'", "\\'", $txt); // fill-in {{vars}} $txt = preg_replace( "/ {{ ( [A-Za-z0-9_]+ ) }} /x", "'+\\1+'", $txt ); return "'$txt'"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function escape( $line ) {\n\t\t$line = preg_replace( '/\\\\\\\\$/', '', $line );\n\t\t$line = addcslashes( $line, '\\\\\"' );\n\t\t$line = str_replace( \"\\n\", '\\n', $line );\n\t\t$line = '\"' . $line . '\"';\n\n\t\treturn $line;\n\t}", "function crlf_endings(string $input) {\n\treturn str_replace(\"\\n\", \"\\r\\n\", $input);\n}", "function fix_eol($r){\n\t\t$r = str_replace(\"\\r\\n\", \"\\n\", $r);\n\t\t$r = str_replace(\"\\r\", \"\\n\", $r);\n\t\t$t = str_replace(\"\\n\", $this->eol, $r);\n\t\treturn $r;\n\t}", "private function terminateLine()\n {\n if ($this->isInline) {\n $this->isInline = false;\n $this->writeToFile('<br>');\n }\n }", "function pt_convert_line_break($str){\n\treturn str_replace(\"\\n\",\"\\\\n\", str_replace(array(\"\\n\\r\", \"\\r\\n\", \"\\r\"),\"\\n\", $str));\n}", "private function setNewLine() {\n $extension = pathinfo($this->path, PATHINFO_EXTENSION);\n if ($extension === Lexer::LINUX_FILE_EXTENSION) {\n $this->newLine = \"\\n\";\n } else {\n $this->newLine = \"\\r\\n\";\n }\n }", "public function addSlash(){\n $this->firstname = addslashes($this->firstname);\n $this->lastname = addslashes($this->lastname);\n $this->company = addslashes($this->company);\n $this->country = addslashes($this->country);\n $this->place = addslashes($this->place);\n $this->street = addslashes($this->street);\n $this->description = addslashes($this->description); \n }", "static function crlf() {\n return chr(13) . chr(10);\n }", "private function add_slashes($data) {\r\n\t\treturn addslashes ( $data );\r\n\t}", "function writeraw( $raw) {\r\n\t\t$raw=preg_replace(\"/\\r/\", \"\", $raw);\r\n\t\t$raw=preg_replace(\"/\\n/\", \" \", $raw);\r\n\t return $raw;\r\n }", "public function db_addslashes($text) {\n if ($this->get_config('dbsybasequoting')) {\n $text = str_replace('\\\\', '\\\\\\\\', $text);\n $text = str_replace(array('\\'', '\"', \"\\0\"), array('\\\\\\'', '\\\\\"', '\\\\0'), $text);\n } else {\n $text = str_replace(\"'\", \"''\", $text);\n }\n return $text;\n }", "public function db_addslashes($text) {\n if ($this->get_config('dbsybasequoting')) {\n $text = str_replace('\\\\', '\\\\\\\\', $text);\n $text = str_replace(array('\\'', '\"', \"\\0\"), array('\\\\\\'', '\\\\\"', '\\\\0'), $text);\n } else {\n $text = str_replace(\"'\", \"''\", $text);\n }\n return $text;\n }", "protected function escapeCharacter () : string {\n return '\\\\';\n }", "function pun_linebreaks($str)\r\n{\r\n\treturn str_replace(\"\\r\", \"\\n\", str_replace(\"\\r\\n\", \"\\n\", $str));\r\n}", "private function filter_addslashes($text) {\n $text = str_replace('\\\\', '\\\\5c', $text);\n $text = str_replace(array('*', '(', ')', \"\\0\"),\n array('\\\\2a', '\\\\28', '\\\\29', '\\\\00'), $text);\n return $text;\n }", "function add_quote($line)\r\n{\r\n $line = trim($line);\r\n if ($line[0] != '\"')\r\n $new_line = '\"';\r\n else \r\n $new_line = '';\r\n\r\n $inquote = false;\r\n for ($i = 0; $i < strlen($line); $i++){\r\n if ($line[$i] == '\"'){//碰到引号\r\n if ($inquote == false){ //如果不在引号内\r\n $inquote = true;\r\n $new_line .= '\"';\r\n continue;\r\n } else { //在引号内\r\n if ($i + 1 < strlen($line) && $line[$i+1] == '\"'){ //处理双引号\r\n $new_line .= '\"\"';\r\n $i++;\r\n continue;\r\n } else { //引号关闭\r\n $inquote = false;\r\n $new_line .= '\"';\r\n }\r\n }\r\n } else if ($line[$i] == ','){ //碰到逗号\r\n if ($inquote == true){ //如果在引号内 \r\n $new_line .= ',';\r\n } else { //不在引号内的逗号\r\n if ($line[$i-1] != '\"'){\r\n $new_line .= '\"';\r\n }\r\n $new_line .= ',';\r\n if ($i + 1 < strlen($line) && $line[$i+1] != '\"'){\r\n $new_line .= '\"';\r\n } else if ($i + 1 >= strlen($line)){\r\n $new_line .= '\"\"';\r\n }\r\n }\r\n } else if ($line[$i] == \"'\"){\r\n $new_line .= \"'\";\r\n } else {\r\n $new_line .= $line[$i];\r\n }\r\n }\r\n\r\n return $new_line;\r\n}", "function add_line_return($file_path)\n {\n file_put_contents($file_path, \"\\n\", FILE_APPEND);\n }", "private function add_new_line() {\n\n\t\t$this->fields[] = array( 'newline' => true );\n\n\t}", "function add_trailing_slash($path) {\n\treturn remove_trailing_slash($path) . '/';\n}", "private function processLine($line)\n {\n return\n '\"' .\n implode(\n \"\\\",\\\"\",\n array_map(\n function ($e) {\n if($e == '' || $e == 'NULL' || $e == null) return '\\\\N';\n return str_replace(\"\\n\", '\\n',\n $e\n );\n },\n $line\n )\n )\n . \"\\\"\\n\";\n }", "function reduce_double_slashes($str) {\n\treturn preg_replace(\"#([^:])//+#\", \"\\\\1/\", $str);\n}", "public function doubleQuoteEscapingAtTheEOL()\n {\n\n $data = [\"Section\" => [\"key1\" => \"\\\"\\nwhatever\\\"\"]];\n $ini = StringUtils::ensureLf(<<<'INI'\n[Section]\nkey1 = \"\\\"\nwhatever\\\"\"\n\nINI\n );\n\n $this->assertSame($ini, IniSerializer::serialize($data));\n $this->assertSame($data, IniSerializer::deserialize($ini));\n\n }", "function preg_windows_slashes($string_value, $rep_value = \"\\\\\\\\\")\n {\n if (strtoupper(PHP_OS == \"WINDOWS\") || strtoupper(PHP_OS) == 'WINNT') {\n $string_value = str_replace('/', $rep_value, $string_value);\n }\n return $string_value;\n }", "function str_backslash($string)\n {\n return str_replace('/', '\\\\', $string);\n }", "public static function normalizeLineEndings($input)\n\t{\n\t\t$output = preg_replace(\"/(\\n\\r|\\r\\n|\\r|\\n)/\", PHP_EOL, $input);\n\t\t\n\t\treturn $output;\n\t}", "function backslashit($value)\n {\n }", "function lineFeed(&$fp) {\n\n fwrite($fp, chr(10));\n }", "function convertlinebreaks ($str) {\r\n return preg_replace (\"/\\015\\012|\\015|\\012/\", \"\\n\", $str);\r\n}", "private function ensure_trailing_backslash( string $namespace ): string {\n\t\treturn \\rtrim( $namespace, '\\\\' ) . '\\\\';\n\t}", "function pun_linebreaks2($str)\r\n{\r\n\treturn str_replace(\"\\r\", \"\\n\", str_replace(\"\\r\\n\", \"<br>\", $str));\r\n}", "function trailingslashit($value)\n {\n }", "function linebreak() {\n $this->doc .= '<br/>'.DOKU_LF;\n }", "function mc_newline_replace( $string ) {\n\n\treturn (string) str_replace( array( \"\\r\", \"\\r\\n\", \"\\n\" ), '', $string );\n}", "public static function addTrailingSlash($path){\n return rtrim($path, '/').'/';\n }", "function smartaddslashes($str) {\n\t\tif ( get_magic_quotes_gpc() == false ) {\n\t\t\t$str = addslashes( $str );\n\t\t}\n\t\treturn $str;\n\t}", "public function getNewline(): string;", "function nice_addslashes($string)\n{\n // if magic quotes is on the string is already quoted, just return it\n if(MAGIC_QUOTES)\n return $string;\n else\n return addslashes($string);\n}", "public function newLine()\n {\n echo \"\\n\";\n }", "public function addSlashes(&$value){\nreturn $value = \"'$value'\";\n}", "protected function new_line()\n {\n }", "function add_ending_slash($path)\n{\n if (substr($path, (0 - (int)strlen(DIRECTORY_SEPARATOR))) !== DIRECTORY_SEPARATOR) {\n $path .= DIRECTORY_SEPARATOR;\n }\n return $path;\n}", "function _put_safe_slashes ($text = \"\") {\n\t\t$text = str_replace(\"'\", \"&#039;\", trim($text));\n\t\t$text = str_replace(\"\\\\&#039;\", \"\\\\'\", $text);\n\t\t$text = str_replace(\"&#039;\", \"\\\\'\", $text);\n\t\tif (substr($text, -1) == \"\\\\\" && substr($text, -2, 1) != \"\\\\\") {\n\t\t\t$text .= \"\\\\\";\n\t\t}\n\t\treturn $text;\n\t}", "static function replace_newline($string,$spliter) {\r\n return (string)str_replace(array(\"\\r\", \"\\r\\n\", \"\\n\"), $spliter, $string);\r\n }", "static function convert_to_windows_lf(&$string){\n // Unix uses LF line feed.\n $string = str_replace(\"\\n\", \"\\r\\n\", $string);\n\n }", "private function normalizeLineEndings(string $content): string\n {\n // move '\\r\\n' or '\\n' to PHP_EOL\n // first substitution '\\r\\n' -> '\\n'\n // second substitution '\\n' -> PHP_EOL\n // remove any EOL at the EOF\n return rtrim(str_replace([\"\\r\\n\", \"\\n\"], [\"\\n\", PHP_EOL], $content), PHP_EOL);\n }", "private function FixEOL($str) {\n\t $str = str_replace(\"\\r\\n\", \"\\n\", $str);\n\t $str = str_replace(\"\\r\", \"\\n\", $str);\n\t $str = str_replace(\"\\n\", $this->LE, $str);\n\t return $str;\n\t}", "protected function escape_windows_directory_separator($path)\n {\n return preg_replace('/[\\\\\\\\]+/', '\\\\\\\\\\\\\\\\', $path);\n }", "function untrailingslashit($value)\n {\n }", "public static function addSlashes($cadena)\n\t\t{\n\t\t\treturn str_replace(\"'\", \"''\", $cadena);\n\t\t}", "private function add_next_line($content) {\r\n\t\treturn $content . \"\\n\";\r\n\t}", "public function testNewLineAppend() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->append(\"Hello\")->newLine(true)->newLine(true)->append(\"World\");\n\n\t\t\t$this->assertEquals(\"Hello\\n\\nWorld\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "public function appendLine($value = \"\")\r\n {\r\n $this->addElement($value.PHP_EOL);\r\n }", "public function eol()\n {\n $this->result .= PHP_EOL;\n return $this;\n }", "function ss_addslashes($args) {\n\tif( !defined('MAGIC_QUOTES_GPC') ) define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());\n\tif( !MAGIC_QUOTES_GPC ) { \n\t\tif( is_array($args) ) {\n\t\t\tforeach($args as $key => $val) {\n\t\t\t\t$args[$key] = ss_addslashes($val);\n\t\t\t}\t\t\n\t\t} else {\n\t\t\t$args = addslashes($args);\n\t\t}\n\t}\n\treturn $args;\n}", "function add_br(&$output)\n{\n\t$output = preg_replace(\"~\\n~\", \"<br />\\n\", $output);\n}", "public function setLineEndingStyle($lineEndingStyle) {}", "public function newLineWritten();", "function No_new_Line($string){\n \n return str_replace(\"'\",\"' + \" . '\"' . \"'\" . '\"' . \" + '\",str_replace(\"\\n\",\"\",$string));\n \n }", "function add_leading_slash( $string ) {\n\t$string = ltrim( $string, '\\/' );\n\n\treturn '/' . $string;\n}", "function set_eol(){\n\t\tif(strtolower(substr(PHP_OS, 0, 3)) == 'win'){\n\t\t\t$this->eol = \"\\r\\n\";\n\t\t}elseif(strtolower(substr(PHP_OS, 0, 3)) == 'mac'){\n\t\t\t$this->eol = \"\\r\";\n\t\t}else{\n\t\t\t$this->eol = \"\\n\";\n\t\t}\n\t}", "protected function lineBreak() {\n\n return PHP_EOL;\n }", "function removeDoubleBslash( $str ) {\n\t\t$str = str_replace('\\\\\\\\', '\\\\', $str);\n\t\treturn $str;\n\t}", "public function fixEOL($str) {\r\n\t\t$str = str_replace(\"\\r\\n\", \"\\n\", $str);\r\n\t\t$str = str_replace(\"\\r\", \"\\n\", $str);\r\n\t\t$str = str_replace(\"\\n\", $this->cfg->crlf, $str);\r\n\t\treturn $str;\r\n\t}", "public static function escape($text)\n {\n \tassert(null !== $text);\n \tassert(is_string($text));\n \t\n return addcslashes($text, \"\\\\\\n,:;\");\n }", "function tidy(string $path, bool $ending = false, string $separator = \\DIRECTORY_SEPARATOR)\n{\n\treturn preg_replace('/[\\/\\\\\\\\]+/', $separator, $path . ($ending ? $separator : ''));\n}", "public static function replace_backslashes($str) {\n return str_replace('\\\\', '/', $str);\n }", "public function addSlashes( $t );", "function untrailingslashit( $string ) {\n\treturn rtrim( $string, '/\\\\' );\n}", "public function testLineIntrospectionWithCRLFLineEndings() {\n\t\t$tmpPath = Libraries::get(true, 'resources') . '/tmp/tests/inspector_crlf';\n\t\t$contents = implode(\"\\r\\n\", ['one', 'two', 'three', 'four', 'five']);\n\t\tfile_put_contents($tmpPath, $contents);\n\n\t\t$result = Inspector::lines($tmpPath, [2]);\n\t\t$expected = [2 => 'two'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = Inspector::lines($tmpPath, [1,5]);\n\t\t$expected = [1 => 'one', 5 => 'five'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$this->_cleanUp();\n\t}", "public static function addTrailingSlash($path) {\n\t\tif (substr($path, -1) != '/') {\n\t\t\treturn $path.'/';\n\t\t}\n\t\telse {\n\t\t\treturn $path;\n\t\t}\t\n\t}", "private function appendLineToRewrites($line){\n\t\t$this->rewrites .= \"\\n\" . $line;\n\t}", "public function test_linebreaks_removed() {\n\n\t\t$this->assertStringMatchesFormat(\n\t\t\t'%s'\n\t\t\t, $this->export_data['classes'][0]['doc']['long_description']\n\t\t);\n\t}", "function _autop_newline_preservation_helper( $matches ) {\n\t\t\treturn str_replace(\"\\n\", \"<WPPreserveNewline />\", $matches[0]);\n\t\t}", "protected function quote_escaped()\n {\n }", "private function reduce_double_slashes($str)\n {\n return preg_replace('#([^:])//+#', '\\\\1/', $str);\n }", "protected function textLine($val) {\r\n\t\treturn $val.$this->cfg->crlf;\r\n\t}", "public function testPrependLineTerminate() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->prependLine(\"Hello\", true)->prependLine(\"World\", true);\n\n\t\t\t$this->assertEquals(\"World\\nHello\\n\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "private static function normalizeEndOfLine(string $s): string\n {\n return str_replace(\"\\r\\n\", \"\\n\", $s);\n }", "function path_escape($v) {\n\treturn preg_replace('/(\\/\\.\\/)|[\\/\\\\\\]|(\\.\\.)/', '', $v);\n}", "public function testNewLine()\n {\n $str = new Str($this->testString);\n $result = $str->newline();\n $this->assertTrue($result->value === 'The quick brown fox jumps over the lazy dog,\nSnowball');\n }", "function fix_newlines($text) {\n\n#return str_replace('&#xD;', '', $text);\nreturn str_replace(\"\\r\", \"\", $text);\n\n}", "private function unifyCRLF(string $str): string\n {\n $strUnifiedLF = str_replace(\"\\r\", \"\\n\", str_replace(\"\\r\\n\", \"\\n\", $str));\n return str_replace(\"\\n\", \"\\r\\n\", $strUnifiedLF);\n }", "function add_quote($value) {\n\t\treturn '\"' . addslashes($value) . '\"';\n\t}", "static function convert_to_unix_lf(&$string){\n // Unix uses LF line feed.\n $string = str_replace(\"\\r\\n\", \"\\n\", $string);\n\n }", "function endLineCharDelete()\n {\n $newArray = [];\n $array = $this->prepMethods;\n for ($i = 0; $i < count($array); $i++) {\n $new_element = str_replace($this->endLinePHP, $this->endLineSwift, $array[$i]);\n array_push($newArray, $new_element);\n }\n $this->prepMethods = $newArray;\n }", "function getStrWithBreak($str) {\n $strArry = explode(PHP_EOL, $str);\n $length = count($strArry);\n\n $newStr = \"\";\n for ($i=0; $i < $length ; $i++) {\n if($i == $length - 1) {\n $newStr = $newStr . $strArry[$i];\n } else {\n $newStr = $newStr . $strArry[$i] . \"\\\\r\\\\n\";\n }\n }\n return $newStr;\n }", "function textAreaNewlinesToSimpleNewline($string)\n {\n $string = str_replace([\"\\n\", \"\\r\\n\", \"\\r\"],\"\\n\",$string);\n return $string;\n }", "public function writeLine($text);", "public function reverseJournal($newLineAfter);", "function Rec($text)\r\n {\r\n \t$text = htmlspecialchars(trim($text), ENT_QUOTES);\r\n \tif (1 === get_magic_quotes_gpc())\r\n \t{\r\n \t\t$text = stripslashes($text);\r\n \t}\r\n \r\n \t$text = nl2br($text);\r\n \treturn $text;\r\n }", "function user_removeChr($content,$conf) {\r\n\t//$content = str_replace('\\r', '2', $content);\r\n\t$content = str_replace(chr(13), '/', $content);\r\n\t$content = str_replace(chr(10), '', $content);\r\n\treturn $content;\r\n}", "private function ensure_trailing_slash( string $path ): string {\n\t\treturn \\rtrim( $path, '/' ) . '/';\n\t}", "public function checkCRLF(&$text)\n {\n $text = preg_replace(\"#(\\r\\n|\\r|\\n)#\", \"\\r\\n\", $text);\n }", "function wp_slash( $value ) {\n\tif ( is_array( $value ) ) {\n\t\tforeach ( $value as $k => $v ) {\n\t\t\tif ( is_array( $v ) ) {\n\t\t\t\t$value[$k] = wp_slash( $v );\n\t\t\t} else {\n\t\t\t\t$value[$k] = addslashes( $v );\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$value = addslashes( $value );\n\t}\n\n\treturn $value;\n}", "public function escapeText($str) {\n $str = preg_replace('/([,\\'\";\\\\\\\\])/', \"\\\\\\\\$1\", $str);\n return preg_replace('/\\n/', '\\\\\\\\n', $str);\n }", "public function testEndline()\n {\n $this->assertEquals( \"\\r\\n\", ezcMailTools::lineBreak() );\n\n // now let's set it and check that it works\n ezcMailTools::setLineBreak( \"\\n\" );\n $this->assertEquals( \"\\n\", ezcMailTools::lineBreak() );\n }", "static public function addSlash($path) {\n $path = substr($path, strlen($path)-1, 1) == \"/\" ? $path : $path.\"/\";\n return $path;\n }", "function &nl2Br( $text ) {\n $text = preg_replace( \"/(\\015\\012)|(\\015)|(\\012)/\", \"<br />\", $text );\n return $text;\n }", "public function testLiteralBackslash()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /\\\\\\\\/ \");\n $this->assertEquals(array(\"\\\\\"), $grammar1->parse(\"\\\\\"));\n\n }", "function wd_convert_slash($string){\n return str_replace(\"\\\\\", \"/\", $string);\n}", "public function addSlash($path) {\n $path = substr($path, strlen($path) - 1, 1) == \"/\" ? $path : $path . \"/\";\n return $path;\n }" ]
[ "0.6743838", "0.6562555", "0.6265857", "0.60758305", "0.60705906", "0.60550034", "0.604621", "0.6029425", "0.5976416", "0.5972771", "0.5927611", "0.5927611", "0.59108835", "0.5891376", "0.58694816", "0.58291095", "0.580229", "0.5786157", "0.5771759", "0.5766086", "0.575912", "0.57499665", "0.57442284", "0.5706206", "0.5704807", "0.57022667", "0.57019466", "0.5697891", "0.5687647", "0.56726307", "0.5669642", "0.56679267", "0.5656398", "0.565597", "0.5646398", "0.5645209", "0.56393975", "0.56303596", "0.5627235", "0.5620013", "0.55886906", "0.5586329", "0.5585514", "0.55794895", "0.55583143", "0.5552266", "0.5549258", "0.55464685", "0.5514073", "0.5509882", "0.5501606", "0.5491314", "0.5490918", "0.5481636", "0.5476418", "0.5470705", "0.54687816", "0.54676795", "0.5465844", "0.54597205", "0.54461145", "0.54434955", "0.544258", "0.54419196", "0.54419", "0.54341376", "0.54173744", "0.5410718", "0.54048455", "0.5388734", "0.5379096", "0.5373823", "0.53651065", "0.5352166", "0.5350971", "0.5350158", "0.534959", "0.5341853", "0.53414947", "0.53243804", "0.53160316", "0.53049666", "0.52936745", "0.52936524", "0.5292581", "0.5278754", "0.527858", "0.52740556", "0.5271723", "0.5268365", "0.52649695", "0.5260016", "0.5252089", "0.52261436", "0.52005404", "0.51981086", "0.51942414", "0.5192138", "0.5186922", "0.5172127", "0.5165803" ]
0.0
-1
instituciones 2 se usa para mostrar la descripcion donde sale el codigo
public function instituciones2() { $this->db->trans_start(); $query = $this->db->select('poliza_institucion, nombre_institucion')->from('institucion_educativa')->order_by("nombre_institucion", "asc")->get(); //$str = $this->db->last_query(); //log_message('ERROR', 'error CIE10 ' . $str); if ($query->num_rows() > 0) { foreach ($query->result() as $key) { $data[$key->poliza_institucion] = $key->nombre_institucion; } $this->db->trans_complete(); return $data; } else { $this->db->trans_complete(); return FALSE; } $this->db->trans_complete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDesciption();", "function opcion__info()\n\t{\n\t\t$p = $this->get_proyecto();\n\t\t$param = $this->get_parametros();\n\t\t$this->consola->titulo( \"Informacion sobre el PROYECTO '\" . $p->get_id() . \"' en la INSTANCIA '\" . $p->get_instancia()->get_id() . \"'\");\n\t\t$this->consola->mensaje(\"Version de la aplicación: \".$p->get_version_proyecto().\"\\n\");\n\t\tif ( isset( $param['-c'] ) ) {\n\t\t\t// COMPONENTES\n\t\t\t$this->consola->subtitulo('Listado de COMPONENTES');\n\t\t\t$this->consola->tabla( $p->get_resumen_componentes_utilizados() , array( 'Tipo', 'Cantidad') );\n\t\t} elseif ( isset( $param['-g'] ) ) {\n\t\t\t// GRUPOS de ACCESO\n\t\t\t$this->consola->subtitulo('Listado de GRUPOS de ACCESO');\n\t\t\t$this->consola->tabla( $p->get_lista_grupos_acceso() , array( 'ID', 'Nombre') );\n\t\t} else {\n\t\t\t$this->consola->subtitulo('Reportes');\n\t\t\t$subopciones = array( \t'-c' => 'Listado de COMPONENTES',\n\t\t\t\t\t\t\t\t\t'-g' => 'Listado de GRUPOS de ACCESO' ) ;\n\t\t\t$this->consola->coleccion( $subopciones );\n\t\t}\n\t}", "public function get_description()\n {\n }", "public function get_description()\n {\n }", "abstract function getdescription();", "function getDescription() ;", "public function getDescription(): string\n {\n return 'Se crea el campo anexos del sistema';\n }", "public function description();", "public function description();", "public static function getDescription();", "static function description(): string {\r\n return 'A website owned or used by The Medium'; \r\n }", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public static function getDescription(): string\n {\n }", "public static function getDescription(): string\n {\n }", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "abstract public function getDescription();", "abstract public function getDescription();", "function getDescription();", "abstract function getDescription();", "public function description()\r\n {\r\n }", "public abstract function getDescription();", "public function description(){ return $this->name . \" [\" . $this->ID . \"]\"; }", "public function getDescription():string;", "public function __construct()\n {\n $this->setCode('desconto');\n }", "public function getDescription()\n {\n return 'Developer at Afrihost. Design Patterns acolyte. Dangerous sysadmin using \\'DevOps\\' as an excuse. I like '.\n 'long walks on the beach and craft beer.';\n }", "function get_description() \t{\n \t\treturn $this->description;\n \t}", "function describe() {\n print(\"\\nI am \" . $this->getName() . \" - \" . $this->getCode() . \" price: \" . $this->price);\n }", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "function description_vide(){\n\t\tglobal $infos_id;\n\t\tif($infos_id['description'] == \"\"){\n\t\t\treturn \"Aucune description\";\n\t\t}else{\n\t\t\treturn $infos_id['description'];\n\t\t}\n\t}", "function getDescription()\n {\n $description = '\n\t\tThis is the template installation type. Change this text within the file for this installation type.';\n return $description;\n }", "function info() {\n\t \treturn $this->description;\n\t }", "public function getDescrizione()\n\t\t{\n\t\treturn $this->descrizione;\n\t\t}", "public function getShortDescription() {}", "public function description(): string;", "public function description(): string;", "public function get_description(){ return $this->_description;}", "public function getDescription(): string {\n return \"$this->description\";\n }", "static public function getDescription(): string\n {\n return static::$description;\n }", "public function getDescription(): string\n {\n return 'Se adiciona filtros a los indicadores y se ajusta el alias a la vista';\n }", "function getDescripcion()\n {\n if (!isset($this->sdescripcion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sdescripcion;\n }", "public static function getDescription(): string\n {\n return static::$description;\n }", "public function getDescriptionData() {}", "public function getDescrizione()\n {\n return $this->descrizione;\n }", "public function description() {\n return 'I am garlic sandwich';\n }", "public function getDescription(){\n return $this->description;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function description()\n {\n\n return static::$description;\n\n }", "public function get_description() {\r\n\t\treturn $this->get_name();\r\n\t}", "public function get_description()\n\t{\n\t\treturn '';\n\t}", "public function getDescription(): string\n {\n }", "public function mostrarInfo()\n {\n // $datos.= \"Cuatrimestre\".$this->cuatrimestre;\n // return parent::mostrarInfo().\" \".$datos;\n }", "function tipoCota($cod,$desc){\r\n\t $fCot = new fachada_tipoCota();\r\n\t\t$oCot = $fCot->tipoCota($cod,$desc);\r\n\t\treturn $oCot;\r\n\t}", "function sGetDistrHtmlDescription ($aArgDistributore) {\n\t\n\textract ($aArgDistributore);\n\t$dst_note = htmlentities($dst_note);\n\t$dst_allevatore = htmlentities($dst_allevatore);\n\t$aDistrDescription = array();\n\tif ($dst_foto) $aDistrDescription[] = '<img class=\"distr_pic\" src=\"'.URL_ROOT.'images/aziende/distributori/'.$dst_foto.'\">';\n\tif ($dst_note) $aDistrDescription[] = '<p>Note: '.$dst_note.'</p>';\n\tif ($dst_logo) $aDistrDescription[] = '<img class=\"az_logo\" src=\"'.URL_ROOT.'images/aziende/loghi/'.$dst_logo.'\">';\n\tif ($dst_allevatore) $aDistrDescription[] = '<p>Allevatore: '.$dst_allevatore.'</p>';\n\tif ($dst_telefono) $aDistrDescription[] = '<p>Telefono: '.$dst_telefono.'</p>';\n\tif ($dst_cellulare) $aDistrDescription[] = '<p>Cellulare: '.$dst_cellulare.'</p>';\n\tif ($dst_email) $aDistrDescription[] = '<p>Email: <a href=\"mailto:'.$dst_email.'?subject=Contatto da www.milkmaps.com\">'.$dst_email.'</a></p>';\n\tif ($dst_sito) $aDistrDescription[] = '<p>Sito internet: <a href=\"http://'.str_replace('http://','',$dst_sito).'?referer=www.milkmaps.com\" target=\"_blank\">'.$dst_sito.'</a></p>';\n\t$sDistrDescription = (count($aDistrDescription)) ? implode(\"\\n\",$aDistrDescription) : '<p>Nessuna informazione aggiuntiva.</p>';\n\t$sCommands = '<p>'.\n\t\t'<a href=\"#\" onclick=\"myZoomTo('.$dst_id.'); myShowZoomLink('.$dst_id.', \\'out\\'); return false;\" style=\"margin-right:0.5em;\" id=\"in'.$dst_id.'\">Ingrandisci qui &raquo;</a>'.\n\t\t'<a href=\"#\" onclick=\"myAutoZoom(aDistributori); myShowZoomLink('.$dst_id.', \\'in\\'); return false;\" style=\"margin-right:0.5em; display:none;\" id=\"out'.$dst_id.'\">&laquo; Visualizza tutti</a>'.\n\t\t'<a href=\"#\" onclick=\"getDirections('.$dst_id.'); return false;\" style=\"margin-right:0.5em;\">Indicazioni stradali</a>' .\n\t\t'</p>';\n\treturn $sDistrDescription . $sCommands;\n}", "static function Describe() { return \"\"; }", "public function get_description()\n {\n return 'Populate your image of the day gallery with 40 LOLCAT images. After installing the addon select the image of the day in the usual way by going to Admin zone > Content > Images of the day and select the image you want to display.';\n }", "function descriptor_def()\n {\n return \"[description]\";\n }", "abstract public function description(): string;", "protected function get__description()\n\t{\n\t\treturn NULL;\n\t}", "public function ReturnCodeDesc($cadena, $referencia1, $ticket, $origen) {\n $strMensaje =\"\";\n switch ($cadena) {\n case \"OK\":{\n $strMensaje=\"La transacción fue APROBADA en la Entidad Financiera\";\n }break;\n case \"PENDING\":{\n if(isset($origen) && $origen!=''){\n $strMensaje=\"En este momento su orden de pago \".$referencia1.\" \".\n \" presenta un proceso de pago cuya transacción se encuentra PENDIENTE de recibir \".\n \" confirmación por parte de su entidad financiera, por favor espere unos minutos y \".\n \" vuelva a consultar más tarde para verificar si su pago fue confirmado de forma exitosa. \".\n \" Si desea mayor información sobre el estado actual de su operación puede comunicarse a \".\n \" nuestras líneas de atención al cliente al teléfono 6489000 ext 1555 o enviar sus inquietudes \".\n \" al correo [email protected] y pregunte por el estado de la transaccion: \".$ticket.\" \";\n }else{\n $strMensaje=\"La transacción se encuentra PENDIENTE. Por favor verificar si el débito fue realizado en el Banco.\";\n }\n }break;\n case \"FAILED\":{\n $strMensaje=\"La transacción fué FALLIDA\";\n }break;\n case \"FAIL_INVALIDENTITYCODE\":{\n $strMensaje=\"La transacción fué FALLIDA\";\n }break;\n case \"NOT_AUTHORIZED\":{\n $strMensaje=\"La transacción fué RECHAZADA por la Entidad Financiera\";\n }break;\n default:{\n if(isset($origen)&& $origen!=''){\n $strMensaje=\"En este momento su orden de pago \".$referencia1.\" \".\n \" presenta un proceso de pago cuya transacción se encuentra PENDIENTE de recibir \".\n \" confirmación por parte de su entidad financiera, por favor espere unos minutos y \".\n \" vuelva a consultar más tarde para verificar si su pago fue confirmado de forma exitosa. \".\n \" Si desea mayor información sobre el estado actual de su operación puede comunicarse a \".\n \" nuestras líneas de atención al cliente al teléfono 6489000 ext 1555 o enviar sus inquietudes \".\n \" al correo [email protected] y pregunte por el estado de la transaccion: \".$ticket.\" \";\n }else{\n $strMensaje=\"La transacción se encuentra PENDIENTE. Por favor verificar si el débito fue realizado en el Banco.\";\n }\n }break;\n }//switch\n return $strMensaje;\n }", "private function get_description()\n\t{\n\t\treturn $this->m_description;\n\t}", "private function get_description()\n\t{\n\t\treturn $this->m_description;\n\t}", "public function get_description(){\n\t\treturn $this->description;\n\t}", "public function getDescription()\n {\n return;\n }", "protected static function get_default_description()\n {\n }", "public static function getDesc(): string\n {\n return SPLASH_DESC;\n }", "public function catalogos() \n\t{\n\t}" ]
[ "0.6644359", "0.6596619", "0.64949834", "0.64949834", "0.64889354", "0.6468787", "0.6436932", "0.6405706", "0.6405706", "0.63695586", "0.6323727", "0.63069034", "0.63069034", "0.63069034", "0.63069034", "0.63069034", "0.63069034", "0.63069034", "0.63069034", "0.63069034", "0.6306025", "0.6306025", "0.6306025", "0.6280316", "0.6280316", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.6243429", "0.62415683", "0.62415683", "0.6239019", "0.62224", "0.61657673", "0.6144014", "0.6097922", "0.60707325", "0.6056834", "0.6054251", "0.60373336", "0.6020665", "0.6018438", "0.6018438", "0.6018438", "0.6018438", "0.6018438", "0.6018438", "0.6010473", "0.6004646", "0.59654856", "0.59508723", "0.5950157", "0.59194255", "0.59194255", "0.5914219", "0.5907732", "0.59025335", "0.588998", "0.5882105", "0.5861761", "0.58607185", "0.584014", "0.58353", "0.5834526", "0.5827908", "0.58276546", "0.5813584", "0.5807516", "0.5805011", "0.5804606", "0.57959", "0.5789101", "0.57840455", "0.5774067", "0.5768577", "0.5747541", "0.5739336", "0.5738779", "0.57325554", "0.57325554", "0.572653", "0.5719183", "0.5704955", "0.5701243", "0.5699879" ]
0.0
-1
/ Con el id del evento miro el id de la institucion educativa con el id de la institucion educativa, valido al aseguradora
function valida_Aseguradora_mail($id) { $this->db->trans_start(); $this->db->select('i.aseguradora')->from('institucion_educativa i, evento e') ->where('i.id_institucion = e.institucion_edu_id') ->where('e.id_evento',$id); $query = $this->db->get(''); //retornamos el id de la aseguradora. if($query->num_rows() > 0) { $this->db->trans_complete(); return $query; } else { $this->db->trans_complete(); return FALSE; } $this->db->trans_complete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function email_evento_id($id){\r\n $this->db->trans_start();\r\n\r\n $query = $this->db->select('registrado_por')\r\n ->where('id_evento', $id)\r\n ->get('evento');\r\n \r\n log_message('ERROR', 'llego a email_evento_id con id -->'.$id);\r\n \r\n if ($query->num_rows() > 0) \r\n {\r\n $row = $query->row(); \r\n $this->db->trans_complete(); \r\n \r\n $email = $this->email_evento($row->registrado_por); //llega el nombre de quien registra\r\n log_message('ERROR', 'se captura el correo -->'.$email);\r\n \r\n return $email;\r\n } \r\n else \r\n {\r\n $this->db->trans_complete();\r\n return FALSE;\r\n }\r\n\r\n $this->db->trans_complete();\r\n }", "function cargar_registro_venta_id($id) {\n return true;\n }", "public function getIdEvento()\n {\n return $this->id_evento;\n }", "public function getIdCalendario(){\n return $this->idCalendario;\n }", "function obtenerIdEvento($entrada) {\n $evento = trim(filter_var($entrada, FILTER_SANITIZE_STRING));\n $con = crearConexion();\n\n $query = \"SELECT id FROM evento WHERE nombre = '$evento'\";\n $result = mysqli_query($con, $query);\n\n $row = mysqli_fetch_array($result);\n\n cerrarConexion($con);\n\n return $row['id'];\n}", "public function setIdCalendario($idCalendario){\n $this->idCalendario = $idCalendario;\n }", "public function getIdEvento()\n {\n return $this->IdEvento;\n }", "public function identificacionegresado(){\n \treturn $this->embedsOne('encuestas\\identificacionEgresado');\n }", "function setId_situacion($iid_situacion = '')\n {\n $this->iid_situacion = $iid_situacion;\n }", "public function setIdEvento($id_evento)\n {\n if (!empty($id_evento) && !is_null($id_evento))\n $this->id_evento = $id_evento;\n }", "private function creaEvento() {\n $fevento = USingleton::getInstance('FEvento');\n $dati = $this->dati;\n $classe = $this->classe;\n \n //----------------sezione di controllo delle operazioni-----------------\n \n if ($this->operazione == 'inserimento') {\n if ($this->tabella == 'evento') {\n $id = 1 + $fevento->loadultimoevento()[0];\n }\n if ($this->tabella == 'evento_spec') {\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'biglietti') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n if ($this->operazione == 'cancellazione') {\n if ($this->tabella == 'evento') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'evento_spec') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n//---------------------------------------------------------------------------------------------------------\n\n $zona = [new EZona($dati['zona'], $dati['capacita'])];\n $luogo = new ELuogo($dati['citta'], $dati['struttura'], $zona);\n $partecipazioni = [new EPartecipazione($zona[0], $dati['prezzo'])];\n\n if ($classe == 'EPartita') {\n $eventoSpecifico = [new EPartita($luogo, $dati['data'], $partecipazioni, $dati['casa'], $dati['ospite'])];\n }\n if ($classe == 'ESpettacolo') {\n $eventoSpecifico = [new ESpettacolo($luogo, $dati['data'], $partecipazioni, $dati['compagnia'])];\n }\n if ($classe == 'EConcerto') {\n $eventoSpecifico = [new EConcerto($luogo, $dati['data'], $partecipazioni, $dati['artista'])];\n }\n\n $evento = new EEvento($id, $dati['immagine'], $dati['nome_evento'], $eventoSpecifico);\n\n return $evento;\n }", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "private function __validate_id() {\n if (isset($this->initial_data[\"id\"])) {\n # Check the Unbound ACLs array for ID\n if (array_key_exists($this->initial_data[\"id\"], $this->config[\"unbound\"][\"acls\"])) {\n $this->id = $this->initial_data[\"id\"];\n } else {\n $this->errors[] = APIResponse\\get(2074);\n }\n } else {\n $this->errors[] = APIResponse\\get(2072);\n }\n }", "function setId_situacion($iid_situacion = '')\n {\n $this->iid_situacion = (int)$iid_situacion;\n }", "function obtenerEventoPorId($id) {\n $idEvento = trim(filter_var($id, FILTER_SANITIZE_NUMBER_INT));\n $evento = [];\n\n $con = crearConexion();\n\n $query = \"SELECT evento.id, evento.nombre, evento.fecha_hora, evento.descripcion, evento.imagen, evento_categoria.categoria, localizacion.ciudad, localizacion.id AS id_ciudad, cp, direccion FROM `evento`, evento_categoria, localizacion_evento, localizacion WHERE evento.id = '$idEvento' AND evento.id = evento_categoria.evento AND evento.id = localizacion_evento.evento AND localizacion_evento.ciudad=localizacion.id\";\n\n $result = mysqli_query($con, $query);\n $row = mysqli_fetch_array($result);\n $evento['id'] = $row['id'];\n $evento['nombre'] = $row['nombre'];\n $evento['descripcion'] = $row['descripcion'];\n $evento['categoria'] = $row['categoria'];\n $evento['fecha_hora'] = $row['fecha_hora'];\n $evento['imagen'] = $row['imagen'];\n $evento['ciudad'] = $row['ciudad'];\n $evento['id_ciudad'] = $row['id_ciudad'];\n $evento['cp'] = $row['cp'];\n $evento['direccion'] = $row['direccion'];\n\n cerrarConexion($con);\n\n return $evento;\n}", "function setId_situacion($iid_situacion)\n {\n $this->iid_situacion = $iid_situacion;\n }", "final private function insertNewAutorizado($id) {\n # Si hay alergias\n if(null != $this->autorizado) {\n \n # Insertar de nuevo esas relaciones\n $autorizado = $this->db->prepare(\"INSERT INTO nino_autorizado_2 (id_nino,id_autorizado)\n VALUES ('$id',?);\");\n foreach($this->autorizado as $id_autorizado){\n $autorizado->execute(array($id_autorizado));\n }\n $autorizado->closeCursor();\n } \n }", "Public function addEvent(){\n // Imposto l'azienda di riferimento\n\t$id_azienda=$this->session->id_azienda;\n\t// Costruisco l'array contentente i campi _POST: titolo, inizio, fine, descrizione, colore, url\n\t$dati_evento = array(\n\t\t'id_azienda' => $id_azienda,\n\t\t'id_cliente' => $_POST['id_cliente'],\n\t\t'titolo' => $_POST['titolo'],\n 'inizio' => $_POST['inizio'],\n\t\t'fine' => $_POST['fine'],\n\t\t'descrizione' => $_POST['descrizione'],\n\t\t'colore' => $_POST['colore'],\n\t\t'url' => $_POST['url']\n\t);\n\n\t$this->db->insert('eventi', $dati_evento);\n\treturn ($this->db->affected_rows()!=1)?false:true;\n\n\t/* Imposto la query\n\t$sql = \"INSERT INTO eventi (id_cliente, id_azienda, title,events.date, description, color) VALUES \";\n\t$sql.=\"(?,?,?,?)\";\n\t$this->db->query($sql, array($_POST['title'], $_POST['date'], $_POST['description'], $_POST['color']));\n\t\treturn ($this->db->affected_rows()!=1)?false:true;\n\t\t*/\n\t}", "function servicioID($id){\n\t\t\n\t\t$query = $this->db->from('servicio')->where('id',$id)->get();\n\t\tif($query-> num_rows() > 0)\n\t\t\t{\n\t\t\treturn $query;\n\t\t\t// SI SE MANDA A RETORNAR SOLO $QUERY , SE PUEDE UTILIZAR LOS ELEMENTOS DEL QUERY \n\t\t\t// COMO usuarioID($data['sesion']->result()[0]->id_usuario POR EJEMPLO. \n\t\t\t}\n\t\n\t}", "function get_entrada_lote_id($id,$auth){\n\t\tif($auth==0){\n\t\t\t$validacion=\"and prf.usuario_validador_id=0 \";\n\t\t} else {\n\t\t\t$validacion=\" and prf.usuario_validador_id>0 \";\n\t\t}\n\t\t\t\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, ( prf.monto_total - prf.descuento ) as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and lf.lote_id='$id' $validacion\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, prf.descuento, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc \";\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function GuardarEmpleado()\n {\n //Creo la conexion a la DB.\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n\n //Creo la consulta INSERT.\n $consulta = $objetoAccesoDato->RetornarConsulta(\"INSERT into empleado (nombre,turno,tipo)values('$this->nombre','$this->tipo','$this->turno')\");\n\n //Ejecuto la consulta.\n $consulta->execute();\n\n //Guardo su ID.\n $this->id = $objetoAccesoDato->RetornarUltimoIdInsertado();\n\n //Retorno\n return $this->id;\n }", "public function testFindOneById(): void\n {\n // given\n $event = $this->simpleEvent();\n $expectedId = $event->getId();\n\n // when\n $result = $this->eventService->findOneById($expectedId);\n\n // then\n $this->assertEquals($expectedId, $result->getId());\n }", "public function ingresarEmpleadoSinID(){\n $conexion = new Conexion;\n $con = new mysqli($conexion->servername, $conexion->username, $conexion->password, $conexion->dbname);\n $sql = \"INSERT INTO empleado (rut, nombre, password, categoria, estado ) VALUES ('\".$this->rut.\"', '\".$this->nombre.\"','\".$this->password.\"', '\".$this->categoria.\"', 1)\";\n if ($con->connect_error) {\n die(\"Conexión fallida: \" . $con->connect_error);\n } \n if ($con->query($sql) === TRUE) {\n echo \"Empleado ingresada correctamente.\";\n } else {\n echo \"Error: \" . $sql . \"<br>\" . $con->error;\n }\n $con->close();\n }", "private static function asociarImagenAnteriorEvento($id_evento, $imagen_evento)\n {\n try {\n\n $pdo = ConexionBD::obtenerInstancia()->obtenerBD();\n\n\n // Sentencia INSERT\n $consulta = \"INSERT INTO \" . self::NOMBRE_TABLA_IMAGENES_EVENTO . \" ( \" .\n self::ID_EVENTO . \",\" .\n self::IMAGEN_EVENTO_ANTERIOR . \")\" .\n \" VALUES(?,?)\";\n\n // Preparar la sentencia\n $sentencia = $pdo->prepare($consulta);\n\n $sentencia->bindParam(1, $id_evento);\n $sentencia->bindParam(2, $imagen_evento->imagen);\n\n $sentencia->execute();\n\n } catch (PDOException $e) {\n throw new ExcepcionApi(self::ERROR_BDD, $e->getMessage());\n }\n\n }", "function obtenerUsuario_EspecialistaID($id){\n\t\n\t//$query = $this->db->from('sesion')->where('id',$id)->get();\n\t\n\t\t$user = 'user';\n\t $query = $this->db->from('usuario')->where('perfil',$user)->get();\n\t if($query-> num_rows() > 0){\n\t \t\n\t \t$row = $query->row($id);\n\t \t\n\t if (isset($row))\n\t\t\t{\n\t\t\t\t//echo ('ESTE ES EL ID'.' '.$row->id.'- ');\n \treturn $row->id; }\n\t\t}\n\t else return false ;\n\t \n\t}", "function event_id() \n {\n $list = explode( ':', $this->rule->rule_key);\n if ( count( $list) == 4 && $list[2] == 'event') return $list[3];\n return NULL;\n }", "public function newEvent($id = null){\n //Recupera id de grupo e o grupo\n $id = $this->request->getParam('id');\n $group = $this->Groups->get($id);\n //Se requisição for Post, cria evento\n if($this->request->is('post')){\n //Recupera dados do Form\n $data = $this->request->getData();\n //Valida a data que o usuário informou\n if(empty($data['time']) || empty($data['date'])){\n $this->Flash->error(__('Atenção, a data e horário do evento não podem ficar em branco'));\n return $this->redirect(['_name' => 'groups.events.new','id'=>$id]);\n }\n //Configura a data\n $data['datetime'] = $this->request->getData(['date']).' '.$this->request->getData('time');\n unset($data['time'],$data['date']);\n $data['datetime'] = Time::createFromFormat('d/m/Y H:i',$data['datetime'],'America/Sao_Paulo');\n\n //Cria entidade de evento\n $eventTable = TableRegistry::get('Event');\n $event = $eventTable->newEntity($data);\n\n if($eventTable->save($event)){\n //cria Relação entre evento e Grupo\n $groupEvent = ['group_id'=>$id,'event_id'=>$event->id];\n $groupEventEntity = $this->Groups->GroupEvents->newEntity($groupEvent);\n $this->Groups->GroupEvents->save($groupEventEntity);\n\n /* Recupera usuarios do grupo*/\n $usersGroup = $this->Groups->UsersGroup->find()->where(['group_id'=>$id]);\n $notif = [];\n /* Cria array de notificações para todos os usuários*/\n foreach ($usersGroup as $ug){\n $notif[] = ['user_id'=>$ug['user_id'],'event_id'=>$event->id,'status'=>0];\n }\n\n /* Cria entidades das notificações e salva*/\n $this->Notifications->saveEventsNotifications($notif);\n\n $this->Flash->success(__('Evento '.$event->name.' criado com sucesso'));\n return $this->redirect(['_name' => 'groups.view','id'=>$id]);\n }\n $this->Flash->error(__('Não foi possivel criar o grupo pois erros ocorreram:'),['params'=>['errors'=>$event->getErrors()]]);\n\n }\n\n $this->set('group',$group);\n $this->set('user',$this->user);\n $this->set('invites',$this->invites);\n $this->set('eventNotifications',$this->eventNotifications);\n $this->set('messageNotifications',$this->messageNotifications);\n $this->set('sortNotifications',$this->sortNotifications);\n\n }", "public function testId()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's ID is correct\n $this->assertTrue($feed->getId() instanceof Zend_Gdata_App_Extension_Id);\n $this->verifyProperty2(\n $feed,\n \"id\",\n \"text\",\n \"http://www.google.com/calendar/feeds/default/private/composite\"\n );\n\n // Assert that all entry's have an Atom ID object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getId() instanceof Zend_Gdata_App_Extension_Id);\n }\n\n // Assert one of the entry's IDs\n $entry = $feed[2];\n $this->verifyProperty2(\n $entry,\n \"id\",\n \"text\",\n \"http://www.google.com/calendar/feeds/default/private/composite/lq2ai6imsbq209q3aeturho50g\"\n );\n }", "public function getIdEvent(): int\r\n {\r\n return $this->idEvent;\r\n }", "public function getIdEmpresa($instance=false){\n if ($instance && !is_object($this->_data['id_empresa'])){\n $this->setIdEmpresa('',array('required'=>false));\n }\n return $this->_data['id_empresa'];\n }", "public function obtenerId() {}", "function getId_asignatura()\n {\n if (!isset($this->iid_asignatura) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_asignatura;\n }", "public function aggiungiEvento($idu,$password, $tit, $data, $ore, $b_desc, $tipo, $categ, $city){\r\n if($this->esisteUtenteConPassword($idu,$password) && $this->isUtentePremium($idu)){\r\n if($tit!='' && $data !='' && $b_desc!=''&& isset($tipo)&& isset($categ) && $city!=''){\r\n $data = self::$conn->real_escape_string($data);\r\n $ore = self::$conn->real_escape_string($ore);\r\n $city = self::$conn->real_escape_string($city);\r\n $t = $this->giveNomeTypeEvent($tipo); \r\n if($t != ''){\r\n $c = $this->giveNomeCatEvent($categ);\r\n if($c != ''){\r\n $id = uniqid('ev');\r\n $filexml = $id.'.xml';\r\n \r\n $tit = self::escapeCharacters($tit);\r\n $tit = self::$conn->real_escape_string($tit);\r\n $b_desc = self::escapeCharacters($b_desc);\r\n $b_desc = self::$conn->real_escape_string($b_desc);\r\n \r\n $city = mb_strtoupper($city, 'UTF-8');\r\n $query = \"INSERT INTO `evento` (`id`,`dataEv`,`ora`,`dataPub`,`creator`,`titolo`,`breveDesc`,`tipo`,`categ`,`city`,`filexml`) \".\r\n \"VALUES('$id','$data','$ore','\".date('d\\/m\\/Y').\"','$idu','$tit','$b_desc',$tipo,$categ,'$city','$filexml')\";\r\n if(self::$conn->query($query)){\r\n //CREAZIONE DEL FILEXML DELL'EVENTO\r\n $file = str_replace('<evento></evento>',\"<evento>$id</evento>\", file_get_contents('Modello/EventoFile_model.xml'));\r\n file_put_contents($this->folderFilexmlUser .\"$idu/\".$filexml, $file);\r\n return $id;\r\n } \r\n }\r\n }\r\n }\r\n }\r\n return '';\r\n }", "public function testShowEventValidId()\n {\n $event = factory(Events::class)->create(['id' => 4]);\n\n $this->get(route('events.show', $event->id))\n ->assertStatus(200);\n }", "public function insertViaje($puntuacion){\n\t\t$query = \"INSERT INTO aventon_calificar\n\t\t(calificacion, id_usuario, id_viaje, id_calificador, comentario)\".\n\t\t \"VALUES (\".$puntuacion->getCalificacion().\",\".$puntuacion->getIdUsuario().\",\".$puntuacion->getIdViaje().\",\".$puntuacion->getIdCalificador().\", '\".$puntuacion->getComentario().\"')\";\n\t\t$result = Db::query($query); //usar para delete insert update\n\t\t$result = Db::select(\"SELECT LAST_INSERT_ID() as id\");\n\t\treturn $result[0][\"id\"];\n\t\t\n\t}", "public function setEduardoCreate($datos)\n {\n $this->fijarValores($datos);\n $this->guardar();\n $val = $this->lastId();\n return $val;\n }", "public function getIdVeiculo($instance=false){\n if ($instance && !is_object($this->_data['id_veiculo'])){\n $this->setIdVeiculo('',array('required'=>false));\n }\n return $this->_data['id_veiculo'];\n }", "public function getIdEvent(){\n\t\treturn $this->_idEvent;\n\t}", "function getSolicitud_id ($id_solicitud) {\n $db = new MySQL();\n $sql = \"SELECT \n t01.id as id_solicitud,\n date_format(t01.fecha_solicitud,'%d-%m-%Y') fecha_solicitud, \n t01.id_paciente, \n t01.id_medico,\n t03.nombre as medico,\n t01.id_lugarentrega,\n t01.id_servicio,\n concat(t02.nombres,' ', t02.apellidos) paciente,\n t02.edad,\n t02.id_sexo,\n t02.id_empresa,\n t04.nombre as empresa,\n t01.sumas,\n t01.descuento,\n t01.venta_total\n FROM lab_solicitud t01\n LEFT JOIN mnt_paciente t02 ON t02.id = t01.id_paciente\n LEFT JOIN ctl_medico t03 ON t03.id = t01.id_medico\n LEFT JOIN ctl_empresa t04 ON t04.id = t01.id_empresa\n WHERE t01.id=$id_solicitud\";\n return $db->fetch_array($db->consulta($sql));\n }", "public function determineId() {}", "function getId_situacion()\n {\n if (!isset($this->iid_situacion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_situacion;\n }", "function getId_situacion()\n {\n if (!isset($this->iid_situacion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_situacion;\n }", "function email_conferencia($id){\r\n $this->db->trans_start();\r\n\r\n $query = $this->db->select('email_user') //busco el email del user que registro el evento.\r\n ->where('id_evento', $id)\r\n ->get('evento');\r\n \r\n log_message('ERROR', 'llego a email_conferencia con id -->'.$id);\r\n \r\n if ($query->num_rows() > 0) \r\n {\r\n $row = $query->row(); \r\n $this->db->trans_complete(); \r\n \r\n //$email = $this->email_evento($row->registrado_por); //llega el nombre de quien registra\r\n log_message('ERROR', 'email_conferencia envio link a correo -->'.$email);\r\n \r\n return $row->email_user;\r\n } \r\n else \r\n {\r\n $this->db->trans_complete();\r\n log_message('ERROR', 'momv->email_conferencia eno encuentra correo ');\r\n return FALSE;\r\n }\r\n\r\n $this->db->trans_complete();\r\n }", "public function giveIdTypeEvent($str){\r\n $str = self::$conn->real_escape_string(mb_strtoupper($str, 'UTF-8'));\r\n $query = \"SELECT id FROM \".$this->tables['tipoEventoTable'].\r\n \" WHERE UCASE(nome)='$str'\";\r\n\t\t$result = self::$conn->query($query);\r\n if(!$result || $result->num_rows != 1)\r\n return -1; \r\n $row = $result->fetch_array(MYSQLI_NUM);\r\n return (int)$row[0];\r\n }", "public static function saveGroupEvent($request, $id, $id2){\n $dateStart = $request->eventStartDate;\n $dateEnd = $request->eventEndDate;\n $timeStart = date(\"Hi\", strtotime($request->eventTimeStart));\n $timeEnd = date(\"Hi\", strtotime($request->eventTimeEnd));\n $time_start = new DateTime( $dateStart . 'T' . $timeStart);\n $time_end = new DateTime($dateEnd . 'T' . $timeEnd);\n $allDay = false;\n\n if($request->has('allDay')){\n $allDay = true;\n }else{\n $allDay = false;\n }\n\n $group_event = new GroupEvents;\n $group_event->event_title = $request->eventTitle;\n $group_event->event_description = $request->eventDesc;\n $group_event->user_id = $id;\n $group_event->group_id = $id2;\n $group_event->location = $request->eventLocation;\n $group_event->full_day = $allDay;\n $group_event->time_start = $time_start;\n $group_event->time_end = $time_end;\n $group_event->color = $request->eventColor;\n $group_event->save();\n return $group_event;\n }", "public function __construct($incidencia, $id)\n {\n //\n $this->incidencia = $incidencia;\n $this->id = $id; \n }", "function get_entrada_pr_factura_id($id,$auth){\n\t\tif($auth==0){\n\t\t\t$validacion=\"and prf.usuario_validador_id=0 \";\n\t\t} else {\n\t\t\t$validacion=\" and prf.usuario_validador_id>0 \";\n\t\t}\n\t\t\t\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, ( prf.monto_total - prf.descuento ) as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and prf.id='$id' $validacion\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, prf.descuento, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function conseguirId (){\n $query = $this->db->query (\"SELECT * FROM acceso WHERE id_acceso = '{$this->id_acceso}'\");\n if ($query->num_rows === 1)\n {\n $this->datos= $query->fetch_assoc();\n \n }\n return $this->datos;\n }", "private function _agregarSeguimiento($id_practica, $titulo, $id_segui = NULL, $id_lp_seg = NULL) {\n $_objUsuPractica = new DAO_UsuariosPracticas(); // DAO de practicas del usuario\n $_objUsuPractica->set_id_practica($id_practica);\n $_objUsuPractica->consultar();\n $estado = $_objUsuPractica->get_estado_practica(); // el estado del seguimiento es el estado actual de la practica\n $_objSeguimiento = new DAO_Seguimientos();\n if (!empty($id_segui)) {\n $_objSeguimiento->set_id_segui($id_segui);\n $_objSeguimiento->consultar();\n $estado = $_objSeguimiento->get_segui_tipo(); // no puede actualizar el tipo de seguimiento \n }\n $_objSeguimiento->set_id_practica($id_practica);\n $_objSeguimiento->set_segui_titulo($titulo);\n $_objSeguimiento->set_segui_tipo($estado);\n $_objSeguimiento->set_id_usu_cent($_SESSION['id_usuario']);\n if (!$_objSeguimiento->guardar()) {\n $this->_mensaje = $_objSeguimiento->getMysqlError();\n throw new ControllerException(\"No se pudo guardar seguimiento \", 0);\n }\n if (!empty($id_lp_seg)) {\n $_objProgramacionSeg = new DAO_ConfLineasPracticaSeguimiento();\n $_objProgramacionSeg->set_id_lp_seg($id_lp_seg);\n $_id_usu_cp_solicitado = $_objProgramacionSeg->get_id_usu_cp();\n if($_id_usu_cp_solicitado != $_SESSION['id_usu_cp']){\n throw new ControllerException(\"usted no es el usuario que debe generar éste seguimiento\");\n }\n $_objProgramacionSeg->set_id_segui($_objSeguimiento->get_id_segui());\n if (!$_objProgramacionSeg->guardar()) {\n $this->_mensaje = $_objSeguimiento->getMysqlError();\n throw new ControllerException(\"No se pudo relacionar seguimiento actual con el seguimiento programado\", 0);\n }\n }\n $this->_guardarLog($_SESSION['id_usu_cent'], ['accion' => 'insertar', 'metodo' => get_class() . ':_agregarSeguimiento', 'parametros' => ['id_practica' => $id_practica, 'titulo' => $titulo, 'id_segui' => $id_segui, 'id_lp_seg' => $id_lp_seg]]);\n return $_objSeguimiento->getArray();\n }", "function setId_asignatura($iid_asignatura = '')\n {\n $this->iid_asignatura = $iid_asignatura;\n }", "function inscribirEstudiante($estudiante_id,$semestre_id,$dicta_id) {\n //Creamos la evaluacion\n leerClase('Evaluacion');\n $evaluacion = new Evaluacion();\n $evaluacion->estado = Objectbase::STATUS_AC;\n $evaluacion->save();\n \n $this->semestre_id = $semestre_id;\n $this->dicta_id = $dicta_id;\n $this->estudiante_id = $estudiante_id;\n $this->evaluacion_id = $evaluacion->id;\n $this->estado = Objectbase::STATUS_AC;\n $this->save();\n }", "public function getIdUsuarioAcalificar()\n {\n return $this->idUsuarioAcalificar;\n }", "public function getId()\n\t\t{\n\t\t\t\treturn $this->id_sucursal;\n }", "public function getIdEvento0()\n {\n return $this->hasOne(Evento::className(), ['idEvento' => 'idEvento']);\n }", "function getDatosId_situacion()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_situacion'));\n $oDatosCampo->setEtiqueta(_(\"id_situacion\"));\n return $oDatosCampo;\n }", "function getDatosId_situacion()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_situacion'));\n $oDatosCampo->setEtiqueta(_(\"id_situacion\"));\n return $oDatosCampo;\n }", "public function id_test($id) {\r\n\r\n $error_msg = \"\";\r\n $errors = 0;\r\n\r\n if(isset($id)) {\r\n $identifiant = trim($id);\r\n $identifiant = htmlentities($identifiant, ENT_NOQUOTES, 'utf-8');\r\n $identifiant = preg_replace('#&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);#', '\\1', $identifiant);\r\n $identifiant = preg_replace('#&([A-za-z]{2})(?:lig);#', '\\1', $identifiant); // pour les ligatures e.g. '&oelig;'\r\n $identifiant = preg_replace('#&[^;]+;#', '', $identifiant);\r\n $identifiant = str_replace(';', '', $identifiant);\r\n $identifiant = str_replace(' ', '', $identifiant);\r\n $identifiant = str_replace('php', '', $identifiant);\r\n\r\n if($identifiant == '') {\r\n $error_msg .= \"Vous devez spécifier un identifiant. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) < 3) {\r\n $error_msg .= \"Votre identifiant est trop court. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) > 24) {\r\n $error_msg .= \"Votre identifiant est trop long. <br/>\";\r\n $errors++;\r\n } else {\r\n\r\n if(Model::getModel(\"Session\\\\User\")->exists($identifiant)) {\r\n $error_msg .= \"Cet identifiant est déjà utilisé. <br/>\";\r\n $errors++;\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n return array(\r\n \"value\" => $identifiant,\r\n \"error_msg\" => $error_msg,\r\n \"errors\" => $errors\r\n );\r\n\r\n }", "public function getIdConteudo($instance=false){\n if ($instance && !is_object($this->_data['id_conteudo'])){\n $this->setIdConteudo('',array('required'=>false));\n }\n return $this->_data['id_conteudo'];\n }", "public function getId()\n {\n \treturn $this->id_actadocumentacion;\n }", "public function testEventStatusInvalidId()\n {\n $event = factory(Events::class)->create(['id' => 1]);\n $user = factory(User::class)->create();\n $params = ['status' => 0, 'id' => 1000];\n\n $this->actingAs($user)\n ->seeIsAuthenticatedAs($user)\n ->get(route('events.status', $params))\n ->assertStatus(404);\n }", "private function check_alertas_enviar_ahora($id='') {\n\t\t// seleccionar todas las alertas en estado enviar_ahora\n\t\t$alertas = $this->Global_model->get_rows(\"*\",\"alertas\",array(\"estado\"=>\"enviar_ahora\",\"localizacion\"=>localizacion()));\n\n\t\tif (count($alertas)>0):\n\t\t \t\n\t\t\t$data[\"fecha_envio\"] = date(\"Y-m-d H:i:s\");\n\t\t\tforeach ($alertas as $alerta):\n\t\t\t\t$this->Global_model->delete_data(\"alertas_enviadas\",array(\"id_alerta\"=>$alerta->id_alerta)); // Limpiar por si acaso es segunda vez\n\t\t\t\t\n\t\t\t\t$tipos_alerta = $this->Global_model->get_rows(\"tipo\",\"alertas_tipos\",array(\"id_alerta\"=>$alerta->id_alerta));\n\t\t\t\t$data[\"id_alerta\"] = $alerta->id_alerta;\t\n\t\t\t\t\n\t\t\t\tif (count($tipos_alerta)>0):\n\t\t\t\t\tforeach ($tipos_alerta as $tipo): \n\t\t\t\t\t\t$data[\"tipo\"] = $tipo->tipo;\t\t\t\t\n\t\t\t\t\t\t// seleccionar todos los usuarios admin\n\t\t\t\t\t\t$usuarios = $this->Global_model->get_rows(\"*\",\"administradores\",array(\"localizacion\"=>localizacion(),\"estado\"=>\"1\"));\n\t\t\t\t\t\tif (count($usuarios)>0):\n\t\t\t\t\t\t\t$data[\"tipo_usuario\"] = 'administrador';\n\t\t\t\t\t\t\tforeach ($usuarios as $usr): \n\t\t\t\t\t\t\t\t$data[\"usuario\"] = $usr->usuario;\n\t\t\t\t\t\t\t\t$this->Global_model->insert_data(\"alertas_enviadas\",$data); // insertar la alerta al usuario\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tendif;\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// seleccionar todos los usuarios distribuidor\n\t\t\t\t\t\t$usuarios = $this->Global_model->get_rows(\"*\",\"distribuidores_usuarios\",array(\"localizacion\"=>localizacion(),\"estado\"=>\"1\"));\n\t\t\t\t\t\tif (count($usuarios)>0):\n\t\t\t\t\t\t\t$data[\"tipo_usuario\"] = 'distribuidor';\n\t\t\t\t\t\t\tforeach ($usuarios as $usr): \n\t\t\t\t\t\t\t\t$data[\"usuario\"] = $usr->email;\n\t\t\t\t\t\t\t\t$this->Global_model->insert_data(\"alertas_enviadas\",$data); // insertar la alerta al usuario\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// seleccionar todos los usuarios externos\n\t\t\t\t\t\t$usuarios = $this->Global_model->get_rows(\"*\",\"usuarios\",array(\"localizacion\"=>localizacion(),\"estado\"=>\"1\"));\n\t\t\t\t\t\tif (count($usuarios)>0):\n\t\t\t\t\t\t\t$data[\"tipo_usuario\"] = 'usuario';\n\t\t\t\t\t\t\tforeach ($usuarios as $usr): \n\t\t\t\t\t\t\t\t$data[\"usuario\"] = $usr->email;\n\t\t\t\t\t\t\t\t$this->Global_model->insert_data(\"alertas_enviadas\",$data); // insertar la alerta al usuario\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($tipo->tipo == \"email\"):\n\t\t\t\t\t\t\t// enviar email con una funcion comun en global\n\t\t\t\t\t\t\t$this->Global_model->enviar_alertas_tipo_email_pendientes();\n\t\t\t\t\t\tendif;\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tendforeach; // tipos\t\t\t\t\n\t\t\t\tendif;// tipos\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// marcar la alerta como enviada \n\t\t\t\t$this->Global_model->update_data(\"alertas\",array(\"estado\"=>\"enviado\"),array(\"id_alerta\"=>$alerta->id_alerta)); \n\t\t\tendforeach;\n\t\tendif;\n\t\t\n\t\t\n\t\t\n\t\t// seleccionar todas las alertas en estado enviar_prueba_ahora\n\t\t$alertas = $this->Global_model->get_rows(\"*\",\"alertas\",array(\"estado\"=>\"enviar_prueba_ahora\",\"localizacion\"=>localizacion()));\n\n\t\tif (count($alertas)>0):\n\t\t \t\n\t\t\t$data[\"fecha_envio\"] = date(\"Y-m-d H:i:s\");\n\t\t\tforeach ($alertas as $alerta):\n\t\t\t\t$this->Global_model->delete_data(\"alertas_enviadas\",array(\"id_alerta\"=>$alerta->id_alerta)); // Limpiar por si acaso es segunda vez\n\t\t\t\t\n\t\t\t\t$tipos_alerta = $this->Global_model->get_rows(\"tipo\",\"alertas_tipos\",array(\"id_alerta\"=>$alerta->id_alerta));\n\t\t\t\t$data[\"id_alerta\"] = $alerta->id_alerta;\t\n\t\t\t\t\n\t\t\t\tif (count($tipos_alerta)>0):\n\t\t\t\t\tforeach ($tipos_alerta as $tipo): \n\t\t\t\t\t\t$data[\"tipo\"] = $tipo->tipo;\t\t\t\t\n\t\t\t\t\t\t// seleccionar todos los usuarios admin\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data[\"tipo_usuario\"] = $this->data[\"usuarioPerfil\"]->tipo;\t\t\t\t\t\t\n\t\t\t\t\t\t$data[\"usuario\"] = $this->data[\"usuarioPerfil\"]->email;\n\t\t\t\t\t\t$this->Global_model->insert_data(\"alertas_enviadas\",$data); // insertar la alerta al usuario\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($tipo->tipo == \"email\"):\n\t\t\t\t\t\t\t// enviar email con una funcion comun en global\n\t\t\t\t\t\t\t$this->Global_model->enviar_alertas_tipo_email_pendientes();\n\t\t\t\t\t\tendif;\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tendforeach; // tipos\t\t\t\t\n\t\t\t\tendif;// tipos\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// marcar la alerta como enviada \n\t\t\t\t$this->Global_model->update_data(\"alertas\",array(\"estado\"=>\"enviado\"),array(\"id_alerta\"=>$alerta->id_alerta)); \n\t\t\t\t\n\t\t\t\tredirect(base_url().'edit/alertas/?id_alerta='.$alerta->id_alerta, 'location', 302);\n\t\t\t\texit();\n\t\t\t\t\n\t\t\tendforeach;\n\t\tendif;\n\t\t\n\t}", "public function testid() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo(NULL, NULL, NULL);\n\t$id=$tarjeta->obtenerID();\n $boleto = new Boleto(NULL, NULL, $tarjeta, $tarjeta->obtenerID(),NULL, NULL, NULL, NULL, $tiempo);\n\n $this->assertEquals($boleto->obteneriID(), $id);\n }", "public function valide_messageid() {\n\t\tif (empty ( $this->getMessageId () )) {\n\t\t\t$this->onDebug ( $this->getMessageId (), 2 );\n\t\t\t$this->onError ( \"Il faut un message id renvoye par O365 pour travailler\" );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function getEventID() \n {\n return $this->getValueByFieldName('event_id');\n }", "public function getIdEdificio()\n {\n return $this->c_id_edificio;\n }", "public function Guardar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\t\t\t$sql = \"INSERT INTO denuncia (ID_VICTIMA, ES_LA_VICTIMA, DESCRIPCION_EVENTO, ASESORADO, \n\t\t\tASISTENCIA_PROFESIONAL, DENUNCIA_POLICIAL, PERPETRADOR_CONOCIDO, PROCEDIMIENTO_PERPETRADOR) VALUES ('$this->victima','$this->esLaVictima','$this->descripcionEvento','$this->yaAsesorado','$this->asistenciaProfesional',\n\t\t\t'$this->denunciaPolicial','$this->perpetradorConocido','$this->procedimientoPerpetrador')\";\n\t\t\tif ($enlace->query($sql) === TRUE) {\n \t\t\techo \"Nueva denuncia creada. Id de denuncia: \" . $enlace->insert_id;\n \t\t\treturn $enlace->insert_id;\n\t\t\t} else {\n \t\t\techo \"Error al guardar la denuncia \";\n\t\t\t}\n\t\t}", "function crearSesion($data){\n\t\n\tif($data['pagada']==NULL){\n\t\t\n\t\t$data['pagada'] = FALSE ;\n\t\t\n\t}else \t$data['pagada'] = TRUE;\n\t\n\t/*\n\tif($data['checkin']==NULL){\n\t\t\n\t\t$data['checkin'] = FALSE ;\n\t}\n\tif($data['ejecutada']==NULL){\n\t\t\n\t\t$data['ejecutada'] = FALSE ;\n\t} \n\t\n\t\n\tif(strlen($data['idagenda']) == 0){\n\t$data['idagenda']= NULL; \n\t\n\t}*/\n\t\n\t// Poner aqui metodo para buscar servicio por tipo y recibir id\n\t// luego insertar ese id abajo\n\t\n\t$resultado = $this->db->insert('sesion',array('pagada'=>$data['pagada'],\n\t\t\t\t\t\t\t\t\t'id_cliente'=>$data['idcliente'],'id_servicio'=>$data['idservicio'],\n\t\t\t\t\t\t\t\t\t'id_usuario'=>$data['idusuario']));\n\t\t\t\t\t\t\t\t\t\n\t if($resultado == TRUE){\n\t \n\t echo \"<script> alert('Sesión creada !');\n\t </script>\";\n\t }\n\n\t}", "public function eventitoajqij(Request $request){\n $input = $request->all();\n $id = $input[\"id\"];\n\n\n $datos = Agenda::find($id);\n $descripcion = $datos->descripcion;\n $precio = $datos->precio;\n \n\n // Agenda::find($id);\n\n // $descripcion = $datos['descripcion'];\n // dd($descripcion);\n // $input = $request->all();\n \n // return view('agenda.index')->with('datos', $id);\n // return view(\"agenda.index\")->with('datos', $id);\n \n // return response()->json([\n // 'name' => 'Abigail',\n // 'state' => 'CA'\n // ]); \n return array(\"datoid\"=>$descripcion,\"precio\"=>$precio);\n \n // return response()->json([\"ok\"=>true ]);\n \n // return view(\"agenda.index\")->with(\"dato\",\"POR LA GRAN PUTAAAAA FUNCIONÄ MIERDA!!\" );\n }", "function obtenerServicioID($descripcion){\n\n\t $query = $this->db->get('servicio');\n\t \n\t if($query-> num_rows() > 0){\n\t $row = $query->row($descripcion);\n\t\tif (isset($row))\n\t\t\t{\n \treturn $row->id;\n\t\t\t} \n\t }\n\t else return false ;\n\t}", "public function edit($id)\n {\n //\n $proposta = $request->all()['id_proposta'];\n $proposta = Proposta::find($request->id_proposta);\n $proposta->status_proposta = $request->status_proposta;\n $proposta->nm_solicitante = $request->nm_solicitante;\n $proposta->nm_contratante = $request->nm_contratante;\n $proposta->obs_proposta = $request->obs_proposta;\n $proposta->id_evento = $request->id_evento;\n $proposta->id_cliente = $request->id_cliente;\n $proposta->id_palestrante = $request->id_palestrante;\n $proposta->id_usuario = $request->id_usuario;\n $proposta->id_tipo_servico = $request->id_tipo_servico;\n $proposta->vlr_total_proposta = $request->vlr_total_proposta;\n $proposta->mensagem_proposta = $request->mensagem_proposta;\n $proposta->save();\n\n /*\n if($proposta->id_evento == null){\n $proposta->id_evento = Evento::create([\n 'id_usuario' => ' $request->id_usuario '\n ]);\n //dd($proposta);\n $proposta->save();\n }\n */\n //dd($request);\n $evento = $request->all()['id_evento'];\n $evento = Evento::find($request->id_evento);\n $evento->nm_evento = $request->nm_evento;\n $evento->tema_evento = $request->tema_evento;\n $evento->tema_palestra = $request->tema_palestra;\n $evento->dt_evento_inicio = $request->dt_evento_inicio;\n $evento->dt_evento_fim = $request->dt_evento_fim;\n $evento->tm_evento = $request->tm_evento;\n $evento->tm_duracao = $request->tm_duracao;\n $evento->obs_data_evento = $request->obs_data_evento;\n $evento->qtd_participantes_evento = $request->qtd_participantes_evento;\n $evento->perfil_participante_evento = $request->perfil_participante_evento;\n $evento->objetivo_evento = $request->objetivo_evento;\n $evento->vlr_verba_evento = $request->vlr_verba_evento;\n $evento->save();\n\n $cliente = $request->all()['id_cliente'];\n $cliente = Cliente::find($request->id_cliente);\n $cliente->nm_cliente = $request->nm_cliente;\n $cliente->ind_cliente = $request->ind_cliente;\n $cliente->tipo_cliente = $request->tipo_cliente;\n $cliente->cpf = $request->cpf;\n $cliente->cnpj = $request->cnpj;\n $cliente->obs_cliente = $request->obs_cliente;\n $cliente->save();\n \n\n $solicitante = $request->all()['id'];\n //$solicitante->id = $request->id_solicitante;\n $solicitante->nm_solicitante = $request->nm_solicitante;\n $solicitante->save();\n\n return redirect('dashboard/prpoposta/{$data->id}/edit');\n\n }", "public function GetIdObsAluno()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"observacoes_ibfk_1\");\n\t}", "function get_entrada_pr_pedido_id($id){\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, prf.monto_total as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and prf.pr_pedido_id='$id'\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function criar(Evento $evet){\n $securty = new SegurancaDao();\n $login=$_SESSION['login'];\n try {\n parent::setTabela('evento');\n parent::setCampos('nomeEvento,descricao,categoria,dtLimiteInscr,hrLimiteInscr,dataRealiza,horaInicioRealiza,horaFimRealiza,estado,ambito,dataCriacao,anexo,idSala,idDocente');\n parent::setDados(':nomeEvento,:descricao,:categoria,:dtLimiteInscr,:hrLimiteInscr,:dataRealiza,:horaInicioRealiza,:horaFimRealiza,:estado,:ambito,:dataCriacao,:anexo,:idSala,:idDocente');\n\n //chamada da query que vai montar o inserte\n $inserir = parent::inserir();\n $inserir->bindParam(':nomeEvento', $evet->getNome(), PDO::PARAM_STR);\n $inserir->bindParam(':descricao', $evet->getDescricao(), PDO::PARAM_STR);\n $inserir->bindParam(':categoria', $evet->getCategoria(), PDO::PARAM_STR);\n $inserir->bindParam(':dtLimiteInscr', $evet->getDataLimiteInscricao(), PDO::PARAM_STR);\n $inserir->bindParam(':hrLimiteInscr', $evet->getHoraLimiteInscricao());\n $inserir->bindParam(':dataRealiza', $evet->getDataRealiz());\n $inserir->bindParam(':horaInicioRealiza', $evet->getHora_inicioRealiz());\n $inserir->bindParam(':horaFimRealiza', $evet->getHora_fimRealiz());\n $inserir->bindParam(':estado', $evet->getEstado(), PDO::PARAM_INT);\n $inserir->bindParam(':ambito', $evet->getAmbito(), PDO::PARAM_STR);\n $inserir->bindParam(':dataCriacao', $evet->getDataCriacao());\n $inserir->bindParam(':anexo', $evet->getAnexo(), PDO::PARAM_STR);\n $inserir->bindParam(':idSala', $evet->getId_Sala());\n $inserir->bindParam(':idDocente', $login->idUser);\n $retorno = $inserir->execute();\n /* recuperando o ultimo id inserido */\n $evet->setIdEvento(parent::getId()->lastInsertId());\n\n /**vai destroir a session do formulario do evento*/\n $securty->destroyToken();\n\n if ($retorno) :\n\n return TRUE;\n\n else :\n\n return FALSE;\n\n endif;\n\n } catch (Exception $exc) {\n return $exc->getMessage();\n }\n }", "public function tieneEntrada($id_expo){\n\t\t//$expo = Evento::buscaEvento($nombre_expo,'Expo');\n\t\t//$id_expo = $expo->id();\n\t\t$app = Aplicacion::getInstance();\n $conn = $app->conexionBd();\n\t\t$query = sprintf(\"SELECT * FROM Entradas WHERE id_evento=%d AND id_usuario=%d\", $id_expo ,$this->id);\n $rs = $conn->query($query);\n $result = false;\n if ($rs) {\n\t\t\t$result = $rs->num_rows;\n \n $rs->free();\n } else {\n echo \"Error al consultar en la BD: (\" . $conn->errno . \") \" . utf8_encode($conn->error);\n exit();\n }\n\t\tif($result==0){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "public function getid(){\r\n\t\tif($this::isLoggedIn()){\r\n\t\t\t$id2=$this->id;\r\n\t\t\treturn $id2;}\r\n\t\telse {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\t//throw new Exception('Nessun utente loggato!');}\r\n\t}", "public function insertarAsistencia($idDocente,$nombre,$apellidos,$hora,$tipo,$fecha,$grupo,$salon){\n\t\t$sql = \" INSERT INTO asistencia (id_docente, nombre, apellidos, hora, tipo, fecha, grupo, salon) VALUES ('$idDocente' , '$nombre' , '$apellidos' , '$hora' , '$tipo' , '$fecha' , '$grupo' , '$salon' ) \";\n\n\t\t$resultado = $this->db->query($sql);\n\n\t\t$sql2 = \" SELECT hora_entrada FROM empleados WHERE id = '$idDocente' LIMIT 1 \";\n\t\t$resultado2 = $this->db->query($sql2);//ejecutando la consulta con la conexión establecida\n\n\t\t$row = $resultado2->fetch(PDO::FETCH_ASSOC);\n\n\t\t//Conviertiendo hora de llegada establecida a segundos\n\t\t$string = implode(\":\", $row);\n\t\t$entrada = strtotime($string);\n\n\t\t$llega = strtotime($hora); //Hora en la que llegó el empleado a segundos\n\n\t\t$nombreCompleto = $nombre.\" \".$apellidos;\n\n\n\t\tif($llega > $entrada){\n\t\t\t$sql3 = \" INSERT INTO incidencias (nombre, hora_inicio, llego_tarde) VALUES ('$nombreCompleto' , '$hora' , 1) \";\n\t\t\t$resultado3 = $this->db->query($sql3);\t\n\t\t}\t\t\n\t\t\t\n\t\theader(\"Location: principal.php?c=controlador&a=muestraRegistros\");\n\t\t\t\n\t}", "public function getEncuestaId()\r\n {\r\n return $this->encuesta_id;\r\n }", "public function __construct($id,$key,$add=false)\n {\n \n // Instancia classe Evento\n $this->evento = new eventos();\n $this->id = $id;\n $this->key = $key;\n \n // Verifica se estamos tentando adicionar um novo evento\n if($add != false)\n {\n $apost = $this->evento->adicionaEvento($_POST['nome'], $_POST['n-dia'], $_POST['n-mes'], $_POST['hora'], $_POST['minuto'], $_POST['descricao'], $_POST['logradouro'], $_POST['bairro'], $_POST['cidade'], $_POST['estado'], $_FILES['banner-e'], $_POST['participantes'], $_POST['genero'],$_POST['n-ano']);\n if($apost != 'true')\n echo \"<div class='error-create-evento'>$apost</div>\";\n \n }\n \n // Verifica se o servidor enviou o BANNER\n if($_FILES['banner-e'])\n {\n $a = $this->evento->createBanner($_FILES['banner-e'],$_POST['data-info-e']);\n }\n \n if($id != \"\")\n {\n // Verifica se o ID existe\n if(!is_numeric($id))\n return;\n \n $this->evento->id = $id;\n $infos = $this->evento->pegaInfo(); \n if($infos == false)\n {\n include(\"includes/site/404.php\");\n return;\n }\n }\n \n $this->loadBody();\n }", "public function getID()\n {\n return $this->idUsuario;\n }", "public function anioLectivoSiguiente(){\n $fecha= date('d/m/Y');\n $fecha=Carbon::createFromFormat('d/m/Y', date('d/m/Y'));\n $fecha->addYear();\n //$fecha->addYear();\n\n $fechaBuscar=substr($fecha, 0,-15);//$fecha_de_creacion.slice(0,-6);\n $fechaBuscar=(int)$fechaBuscar;\n $anio=Anio::where('año',$fechaBuscar)->select('id')->get()->toArray();\n\n if($anio!=null){\n $var=\"Existe\";\n return $var;\n }else{\n $var=\"NoExiste\";\n return $var;\n }\n }", "public function getIdfa();", "function PesquisaUsuarioPorId($id){\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\"SELECT * FROM Usuario WHERE usuario_id = :id AND usuario_ativo = TRUE\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$statm->execute();\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $row = $statm->fetch(PDO::FETCH_ASSOC);\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}", "function setId_asignatura($iid_asignatura)\n {\n $this->iid_asignatura = $iid_asignatura;\n }", "public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "public function getEventId($obj)\n {\n if ($obj->numero && $obj->evento) {\n $code = $obj->numero;\n $date = $obj->evento->data;\n $hour = $obj->evento->hora;\n $type = $obj->evento->tipo;\n return \"{$code}::{$date}{$hour}::{$type}\";\n }\n return false;\n }", "public function activarEvento($id)\n {\n $sede = Evento::find($id);\n $sede->activo = 'A';\n $sede->save();\n //flash('La categoría ' . $category->name . ' ha sido desactivada de manera exitosa', 'warning');\n return redirect()->route('lista_sedes');\n }", "public function asignacionSeg($id){\n\t\t$asigExiste = DB::select('SELECT ap.Nro_asignacion, ap.id_requerimiento, ap.id_gestor, ap.id_programador, ap.fecha_asignacion, ap.hora_asignacion, ap.asignado_por, CONCAT(us.name ,\" \",us.ap_paterno) as asignado_a, accesible FROM (\n\t\t\tSELECT Nro_asignacion, id_requerimiento, id_gestor, id_programador, fecha_asignacion, hora_asignacion, CONCAT(name, \" \", ap_paterno) asignado_por, accesible \n\t\t\tFROM tb_asignacion_requerimiento ar\n\t\t\tJOIN users u on ar.id_gestor=u.id \n\t\t\tWHERE ar.id_requerimiento = :id\n\t\t\t)ap\n\t\t\tJOIN users us on ap.id_programador = us.id', ['id' => $id]);\n\n\t\treturn $asigExiste;\n\t}", "function listar_inscrito($id) {\n $this->db->distinct ('distinct evento.id_evento');\n\t\t$this->db->select ( 'evento.*' );\n\t\t$this->db->from ( 'evento,participacao,usuario' );\n\t\t$this->db->where ( 'participacao.id_evento = evento.id_evento' );\n\t\t$this->db->where ( 'participacao.id_face = usuario.id_face' );\n\t\t$this->db->where ( 'participacao.id_face = ' . \"'\" . $id . \"'\" );\n\t\n\t\t$query = $this->db->get ();\n\t\n\t\tif ($query->num_rows () != 0) {\n\t\t\treturn $query->result ();\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function get_id();", "public function get_id();", "function agregarCita($idUsuario, $fecha, $detalles, $hora_reserva){\n\t\t\t$con= new Conexion ( );\n\t\t\t$idUsuario=$con->escapar($idUsuario);\n\t\t\t$fecha=$con->escapar($fecha);\n\t\t\t$detalles=$con->escapar($detalles);\n\t\t\t$hora_reserva=$con->escapar($hora_reserva);\n\t\t\t\n\t\t\t$this -> fecha=$fecha;\n\t\t\t$this -> cliente=$idUsuario;\n\t\t\t$this -> detalles=$detalle;\n\t\t\t$this -> hora_reserva=$hora_reserva;\t\t\t\t\n \n\t\t\tif(!$con->conecta())\n\t\t\t\tdie('error conexion');\n\t\t\t//crear el query\n\t\t\t$sql=\"INSERT INTO cita(idPersona,fecha,detalles,inicio) VALUES ('$this->idUsuario','$this->fecha','$this->detalles','$this->hora_reserva') \";\n\t\t\t//$sql=$con->escapar($sql);\n\t\t\t//ejecutar el query\n\t\t\t$resultado=$con->consulta($sql);\n\t\t\tif($resultado==false){\n\t\t\t\tdie('error insercion');\n\t\t\t\t$con->cerrar();\n\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t$this -> id =$resultado;\n\t\t\t$con->cerrar();\n\t\t\treturn $this->id;\n\t\t\t \n }", "public function obtenerID();", "public function testGetInvalidEventbyEventId() : void {\n // grab a profile id that exceeds the maximum allowable profile id\n $event = Event::getEventByEventId($this->getPDO(), generateUuidV4());\n $this->assertNull($event);\n }", "public function getIdAnexo()\n {\n return $this->id_anexo;\n }", "private function _savePreventivo($id_preventivo = null) {\n $con = DBUtils::getConnection();\n $data = date('Y-m-d');\n $id_cliente = $this->id_cliente;\n if ($this->customer)\n $email_cliente = $this->customer->email;\n else\n $email_cliente = '';\n\n $citta_partenza = $this->partenza->citta;\n $provincia_partenza = $this->partenza->provincia;\n $cap_partenza = $this->partenza->cap;\n $indirizzo_partenza = $this->partenza->indirizzo;\n $partenza_codice_citta = $this->partenza->codice_citta;\n $partenza_codice_provincia = $this->partenza->codice_provincia;\n\n\n $citta_destinazione = $this->destinazione->citta;\n $provincia_destinazione = $this->destinazione->provincia;\n $cap_destinazione = $this->destinazione->cap;\n $indirizzo_destinazone = $this->destinazione->indirizzo;\n\n $destinazione_codice_citta = $this->destinazione->codice_citta;\n $destinazione_codice_provincia = $this->destinazione->codice_provincia;\n\n $data_sopraluogo = $this->data_sopraluogo;\n $data_trasloco = $this->data_trasloco;\n $id_agenzia = $this->id_agenzia;\n $flag_sopraluogo = $this->flag_sopraluogo;\n $note = mysql_real_escape_string($this->note);\n $imponibile = $this->imponibile;\n $iva = $this->iva;\n $note_interne = mysql_real_escape_string($this->note_interne);\n\n $piano = $this->piani_da_salire;\n $montaggio = $this->montaggio ? 1: 0;\n $montaggio_locali_preggio = $this->montaggio_locali_preggio ? 1: 0;\n $peso = $this->peso;\n $pagamento_contrassegno = $this->pagamento_contrassegno ? 1: 0;\n\n $algoritmo = $this->tipo_algoritmo;\n\n $sql =\"INSERT INTO preventivi (data, id_cliente, partenza_cap, partenza_citta, partenza_provincia, partenza_indirizzo, destinazione_cap, destinazione_citta, destinazione_provincia,\ndestinazione_indirizzo, importo, stato, email_cliente, id_trasportatore, id_traslocatore_partenza, id_traslocatore_destinazione,\ndata_sopraluogo, data_trasloco, id_agenzia, flag_sopraluogo, note, id_depositario, importo_commessa_trasportatore, importo_commessa_depositario, importo_commessa_traslocatore_partenza,\nimporto_commessa_traslocatore_destinazione, imponibile, iva, partenza_codice_citta, partenza_codice_provincia,\ndestinazione_codice_provincia, destinazione_codice_citta, note_interne,\npartenza_localizzazione, partenza_localizzazione_tipo, partenza_localizzazione_tipo_piano,\ndestinazione_localizzazione, destinazione_localizzazione_tipo, destinazione_localizzazione_tipo_piano, mc, tipologia_cliente,\npiano, montaggio, montaggio_locali_preggio, pagamento_contrassegno, algoritmo,\nnote_partenza, note_destinazione)\n VALUES ('$data', '$id_cliente', '$cap_partenza',\n '$citta_partenza', '$provincia_partenza', '$indirizzo_partenza',\n '$cap_destinazione',\n '$citta_destinazione', '$provincia_destinazione', '$indirizzo_destinazone',\n '$this->importo', '$this->stato', '$email_cliente',\n '$this->id_trasportatore', '$this->id_traslocatore_partenza', '$this->id_traslocatore_destinazione',\n '$data_sopraluogo', '$data_trasloco', '$id_agenzia',\n '$flag_sopraluogo', '$note', '$this->id_depositario',\n '$this->importo_commessa_trasportatore', '$this->importo_commessa_depositario', '$this->importo_commessa_traslocatore_partenza', '$this->importo_commessa_traslocatore_destinazione',\n '$imponibile','$iva',\n '$partenza_codice_citta', '$partenza_codice_provincia',\n '$destinazione_codice_provincia', '$destinazione_codice_citta', '$note_interne',\n '$this->partenza_localizzazione', '$this->partenza_localizzazione_tipo', '$this->partenza_localizzazione_tipo_piano',\n '$this->destinazione_localizzazione', '$this->destinazione_localizzazione_tipo', '$this->destinazione_localizzazione_tipo_piano',\n '$this->mc',1,\n '$piano', '$montaggio', '$montaggio_locali_preggio', '$pagamento_contrassegno',\n '$algoritmo', '$this->note_partenza', '$this->note_destinazione'\n )\";\n\n //se il preventivo già c'è significa che lo sto salvando e quindi riuso lo stesso id\n if ($id_preventivo)\n {\n $data= $this->data_preventivo;\n $sql =\"UPDATE preventivi SET\n data='$data',\n id_cliente = '$id_cliente',\n partenza_cap = '$cap_partenza',\n partenza_citta = '$citta_partenza',\n partenza_provincia = '$provincia_partenza',\n partenza_indirizzo = '$indirizzo_partenza',\n destinazione_cap = '$cap_destinazione',\n destinazione_citta = '$citta_destinazione',\n destinazione_provincia = '$provincia_destinazione',\n destinazione_indirizzo = '$indirizzo_destinazone',\n importo = '$this->importo',\n stato = '$this->stato',\n email_cliente = '$email_cliente',\n id_trasportatore = '$this->id_trasportatore',\n id_traslocatore_partenza = '$this->id_traslocatore_partenza',\n id_traslocatore_destinazione = '$this->id_traslocatore_destinazione',\n id_depositario = '$this->id_depositario',\n flag_sopraluogo = '$this->flag_sopraluogo',\n note = '$this->note',\n data_sopraluogo = '$data_sopraluogo',\n data_trasloco = '$data_trasloco',\n importo_commessa_trasportatore = '$this->importo_commessa_trasportatore',\n importo_commessa_depositario = '$this->importo_commessa_depositario',\n importo_commessa_traslocatore_partenza = '$this->importo_commessa_traslocatore_partenza',\n importo_commessa_traslocatore_destinazione = '$this->importo_commessa_traslocatore_destinazione',\n id_agenzia = '$id_agenzia',\n imponibile = '$imponibile',\n iva = '$iva',\n partenza_codice_citta = '$partenza_codice_citta',\n partenza_codice_provincia = '$partenza_codice_provincia',\n destinazione_codice_citta = '$destinazione_codice_citta',\n destinazione_codice_provincia = '$destinazione_codice_provincia',\n note_interne = '$note_interne',\n partenza_localizzazione = '$this->partenza_localizzazione',\n partenza_localizzazione_tipo = '$this->partenza_localizzazione_tipo',\n partenza_localizzazione_tipo_piano = '$this->partenza_localizzazione_tipo_piano',\n destinazione_localizzazione = '$this->destinazione_localizzazione',\n destinazione_localizzazione_tipo = '$this->destinazione_localizzazione_tipo',\n destinazione_localizzazione_tipo_piano = '$this->destinazione_localizzazione_tipo_piano',\n mc = '$this->mc',\n tipologia_cliente='1',\n piano = $piano,\n montaggio = $montaggio,\n montaggio_locali_preggio = $montaggio_locali_preggio,\n pagamento_contrassegno = $pagamento_contrassegno,\n algoritmo = $algoritmo,\n note_partenza = '$this->note_partenza',\n note_destinazione = '$this->note_destinazione'\n\n\n WHERE id_preventivo='$id_preventivo'\n \";\n\n }\n\n //echo \"\\nSQL: \".$sql;\n $res = mysql_query($sql);\n\n if (!$res) {\n die (\"ERRORE: \".$sql);\n }\n if (!$id_preventivo)\n $id_preventivo = mysql_insert_id();\n\n $this->id_preventivo = $id_preventivo;\n return $id_preventivo;\n }", "public function isValidId($id);", "public function store($id_sesion)\n {\n \n\n $data_evento = request()->only(['tema', 'descripcion']);\n $data_evento ['dni_administrador'] = '72745480';\n $evento = Evento::create($data_evento);\n\n // dd($evento->id);\n $data_ponencia = request()->only(['arch_presentacion']);\n $data_ponencia['id_evento'] = $evento->id;\n Ponencia::create($data_ponencia);\n\n $data_sesion_evento = ['id_sesion' => $id_sesion, 'id_evento' => $evento->id, 'hora_inicio' => request('hora_inicio')];\n SesionEvento::create($data_sesion_evento);\n\n $data_evento_ponente = ['dni_ponente' => request('ponente') , 'id_ponencia' => $evento->id];\n EventoPonente::create($data_evento_ponente);\n\n return redirect()->route('sesion.mostrar', $id_sesion);\n }", "function ler_id($id) {\n $x = (int)$id;\n if($x >= $this->bd[0][0] || $x <= 0) {return false;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\n return true;\n }", "abstract public function get_id();", "function ical_uid_evt($evt_tmp)\r\n{\r\n\treturn md5($evt_tmp[\"date_crea\"].$evt_tmp[\"id_evenement\"]);\r\n}" ]
[ "0.64520437", "0.6323812", "0.62310785", "0.61544585", "0.60535616", "0.6038143", "0.60276496", "0.5986846", "0.595325", "0.59106195", "0.589407", "0.58729273", "0.5868825", "0.5862526", "0.58622104", "0.5807817", "0.5790571", "0.5786156", "0.5767716", "0.57535857", "0.5741525", "0.5741386", "0.5736269", "0.5717321", "0.5700645", "0.5691963", "0.56891614", "0.56874406", "0.56868505", "0.56831455", "0.56746966", "0.5669999", "0.56646603", "0.5664021", "0.5662905", "0.5662749", "0.5652887", "0.56459624", "0.560369", "0.5598746", "0.55924517", "0.55924517", "0.55887544", "0.5585524", "0.5573441", "0.55675536", "0.5557768", "0.55535185", "0.55522764", "0.555215", "0.5549203", "0.5530303", "0.5519733", "0.5503416", "0.5501343", "0.5501343", "0.5489944", "0.5484422", "0.54800904", "0.5474205", "0.54731005", "0.54730535", "0.5469999", "0.5465074", "0.5443911", "0.5440663", "0.5439321", "0.54366744", "0.5436262", "0.54355305", "0.54340225", "0.543368", "0.5427252", "0.5426667", "0.5422015", "0.54167175", "0.54145086", "0.5414191", "0.54086566", "0.5404355", "0.5402231", "0.53998446", "0.5398735", "0.5393712", "0.53860635", "0.53801525", "0.53732866", "0.53707457", "0.53704226", "0.53704226", "0.536875", "0.53664565", "0.5359707", "0.53596187", "0.5347198", "0.53431183", "0.53394145", "0.5335977", "0.5335421", "0.53328997" ]
0.6108392
4
consulto los codigos de cie10 de la base de datos
function cie10() { $this->db->trans_start(); //log_message('ERROR', 'mdchat total_pendientes() Aqui estoy 0'); $query = $this->db->select('cie10_codigo, cie10_nombre')->from('cie10')->order_by("cie10_nombre", "asc")->get(); //$str = $this->db->last_query(); //log_message('ERROR', 'error CIE10 ' . $str); if ($query->num_rows() > 0) { //log_message('ERROR', 'mdchat total_pendientes() Aqui estoy 2'); foreach ($query->result() as $key) { //$data[$key->cie10_cie2]=word_limiter($key->cie10_descripcion,5); $data[$key->cie10_codigo.' | '.$key->cie10_nombre] = $key->cie10_nombre; } $this->db->trans_complete(); return $data; } else { $this->db->trans_complete(); return FALSE; } //return $query; $this->db->trans_complete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllCargos(){\n\t\t\tDB_DataObject::debugLevel(0);\n\t\t\t$obj = DB_DataObject::Factory('VenCargo');\n\t\t\t$data=false;\n\t\t\t$obj->find();\n\t\t\t$i=0;\n\t\t\twhile($obj->fetch()){\n\t\t\t\t$data[$i]['idCargo']=$obj->idCargo;\n\t\t\t\t$data[$i]['nombre']=utf8_encode($obj->nombre);\n\t\t\t\t$data[$i]['estado']=$obj->estado;\n\t\t\t\t$data[$i]['fechaMod']=$obj->fechaMod;\n\t\t\t\t$data[$i]['fecha']=$obj->fecha;\t\n\t\t\t\t$i++;\t\t\n\t\t\t}\n\t\t\t$obj->free();\n\t\t\t//printVar($data,'getAllCargos');\n\t\t\treturn $data;\n\t\t}", "function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }", "public function data_resumen_cxc_cliente()\n {\n $consulta = DB::select('exec RPT_SP_RESUMEN_CXC_CLIENTE');\n $columns = array();\n if (count($consulta) > 0) {\n //queremos obtener las columnas dinamicas de la tabla\n $cols = array_keys((array)$consulta[0]);\n //obtenemos las columnas de las semanas dinamicas, estas tienen un _\n /******\n * NO AGREGAR _ EN LOS NOMBRES DE LA CONSULTA SQL\n * ***/\n $numerickeys = array_where($cols, function ($key, $value) {\n return is_numeric(strpos($value, '_'));\n });\n //las ordenamos\n sort($numerickeys);\n //dd($cols);\n //obtenemos las primeras 3 columnas, esas no cambian\n $columns_init = array_slice($cols, 0, 3);\n //agregamos las columnas dinamicas ordenadas\n //dd($columns_init);\n $columns_init = array_merge($columns_init, $numerickeys);\n //preparamos el array final para el datatable\n foreach ($columns_init as $key => $value) {\n array_push($columns, [\"data\" => $value, \"name\" => $value]);\n }\n array_push($columns, [\"data\" => \"RESTO\", \"name\" => \"RESTO\"]);\n }\n return response()->json(array('data' => $consulta, 'columns' => $columns));\n }", "function extraeServicio()\n{\n $link = conection();\n $parseUTF8 = array();\n $contador = null;\n \n $query = \"select * from Servicio\";\n $result = mysqli_query($link, $query);\n \n $array = mysqli_num_rows($result); \n \n if($array > 0)\n {\n while ($rows = mysqli_fetch_assoc($result))\n {\n $contador ++;\n \n $parseUTF8[$contador] = [\"idServicio\" => $rows[\"idServicio\"], \"nombreSe\" => strtoupper(utf8_encode($rows[\"nombreSe\"])),\n \"costoSe\" => utf8_decode($rows[\"costoSe\"]),\"descripcion\" => strtoupper(utf8_encode($rows[\"descripcion\"]))];\n }\n }\n \n return $parseUTF8;\n}", "function dadosCadastros(){//função geral que será chamada na index\n pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array\n contaNumeroCadastros();//conta Quantos cadastros existem\n }", "public static function generarCodBarras()\n {\n $ultimocod = Producto::orderBy(\"codigobarra\", \"DESC\")->first()->codigobarra;\n if ($ultimocod == null && strlen($ultimocod) == 0) {\n $ultimocod = 0;\n }\n $ultimocod++;\n $lista = Producto::where(\"codigobarra\", \"=\", \"\")->orderBy(\"nombre\", \"ASC\")->get();\n foreach ($lista as $key => $producto) {\n $producto->codigobarra = str_pad($ultimocod, 5, '0', STR_PAD_LEFT);\n $producto->barcode = DNS1D::getBarcodeHTML($producto->codigobarra, 'C128', 2, 40, 'black');\n $producto->save();\n $ultimocod++;\n }\n }", "public function CodigoProducto()\n\t{\n\t\tself::SetNames();\n\n\t\t$sql = \" select codproducto from productos order by codproducto desc limit 1\";\n\t\tforeach ($this->dbh->query($sql) as $row){\n\n\t\t\t$codproducto[\"codproducto\"]=$row[\"codproducto\"];\n\n\t\t}\n\t\tif(empty($codproducto[\"codproducto\"]))\n\t\t{\n\t\t\techo $nro = '00001';\n\n\t\t} else\n\t\t{\n\t\t\t$resto = substr($codproducto[\"codproducto\"], 0, -0);\n\t\t\t$coun = strlen($resto);\n\t\t\t$num = substr($codproducto[\"codproducto\"] , $coun);\n\t\t\t$dig = $num + 1;\n\t\t\t$codigo = str_pad($dig, 5, \"0\", STR_PAD_LEFT);\n\t\t\techo $nro = $codigo;\n\t\t}\n\t}", "public function cbo_zootecnico(){\n $data = array();\n $query = $this->db->get('zootecnico');\n if ($query->num_rows() > 0) {\n foreach ($query->result_array() as $row){\n $data[] = $row;\n }\n }\n $query->free_result();\n return $data;\n }", "public static function obtener_newcod_categoria($conexion) {\n $resultado = \"\";\n if (isset($conexion)) {\n try {\n $sql = \"SELECT\n COUNT( categoria.codigo_tipo)\n FROM\n categoria\n \";// obtenermos el numero de tipos registrados\n\n foreach ($conexion->query($sql) as $row) {\n $r = $row[0];\n }\n \n if (($r / 10) < 1) {//si el numero obtenido es menor que 10 se asigna de la siguiente manera el codigo\n $cod = \"CEJ-001-00\" . ($r+1) ;\n } else {\n if (($r / 10) < 10) {//si el numero obtenido es mayor que 10 se asigna de la siguiente manera el codigo\n $cod = \"CEJ-001-0\" .($r+1) ;\n } \n }\n return $cod ;//enviamos el codigo generado\n } catch (PDOException $ex) {\n print 'ERROR: ' . $ex->getMessage();\n }\n }\n }", "public function listarChikera($codigo){\n $lista_detalles = array();\n $listDetalle= $this->empresa_model->listChikera($codigo);\n if(count($listDetalle)>0){ \n foreach ($listDetalle as $key => $value) {\n $objeto = new stdClass();\n $objeto->CHEK_Codigo =$value->CHEK_Codigo;\n $objeto->CUENT_NumeroEmpresa =$value->CUENT_NumeroEmpresa;\n $objeto->CHEK_FechaRegistro =mysql_to_human($value->CHEK_FechaRegistro);\n $objeto->SERIP_Codigo =$value->SERIP_Codigo;\n $objeto->CHEK_Numero=$value->CHEK_Numero;\n $lista_detalles[] = ($objeto);\n }\n $resultado[] = array();\n $resultado = json_encode($lista_detalles,JSON_NUMERIC_CHECK);\n echo $resultado; \n } \n }", "function obtenerCadenaCodigos($estudiantes){\n $cadena_codigos='';\n foreach ($estudiantes as $key => $row) {\n if(!$cadena_codigos){\n $cadena_codigos = $row['COD_ESTUDIANTE'];\n }else{\n $cadena_codigos .= \",\".$row['COD_ESTUDIANTE'];\n }\n }\n return $cadena_codigos;\n }", "function cargar_cuenta_de_ingreso() {\n $sql = \"SELECT id_plan_contable,cuenta_plan_contable,descripcion_plan_contable,cargar_plan_contable,abonar_plan_contable,transferencia_plan_contable FROM prosic_plan_contable WHERE cuenta_plan_contable LIKE '7%' ORDER BY cuenta_plan_contable\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function extraeRazas()\n{\n $link = conection();\n $parseUTF8 = array();\n $contador = null;\n \n $query = \"select * from Raza\";\n $result = mysqli_query($link, $query);\n \n $array = mysqli_num_rows($result);\n \n if($array > 0)\n {\n while ($rows = mysqli_fetch_assoc($result))\n {\n $contador ++;\n \n $parseUTF8 [$contador] = [\"idRaza\" => $rows[\"idRaza\"],\n \"nombreRaza\" => utf8_encode($rows[\"nombreRa\"]),\n \"idTipo\" => $rows[\"idTipo\"]];\n }\n }\n \n mysqli_close($link);\n \n return $parseUTF8;\n}", "public function buscarDatosDeCodigo($lote, $suc){\n $db = new My();\n $my = new My();\n $datos = array();\n $query = \"SELECT a.codigo AS Codigo,l.lote,CONCAT( a.descrip, '-', p.nombre_color) AS Descrip , s.suc, s.cantidad AS Stock, s.estado_venta,a.um AS UM,l.ancho AS Ancho,l.gramaje AS Gramaje,l.tara AS Tara,l.padre AS Padre,s.ubicacion AS U_ubic,\n l.img AS Img, l.kg_desc AS U_kg_desc,h.fecha_hora AS entDate\n\n FROM articulos a INNER JOIN lotes l ON a.codigo = l.codigo INNER JOIN stock s ON l.codigo = s.codigo AND l.lote = s.lote \n INNER JOIN pantone p ON l.pantone = p.pantone INNER JOIN historial h ON l.codigo = h.codigo AND l.lote = h.lote\n WHERE s.cantidad > 0 AND s.suc = '$suc' AND l.lote ='$lote' GROUP BY lote ORDER BY h.fecha_hora ASC LIMIT 1\";\n \n $my->Query($query);\n if($my->NextRecord()){\n $datos = $my->Record;\n if(count($datos)){\n $datos = array_map(\"utf8_encode\",$datos);\n // print_r($datos);\n \n $rem = \"SELECT CONCAT(fecha_cierre,' ',hora_cierre) AS fecha_ingreso FROM nota_remision n, nota_rem_det d WHERE n.n_nro = d.n_nro AND lote = '$lote' AND n.estado = 'Cerrada' AND n.suc_d = '$suc'\";\n \n $db->Query($rem);\n if($db->NumRows() > 0){ \n $db->NextRecord();\n $fecha_ingreso = $db->Record['fecha_ingreso'];\n $datos['entDate'] = $fecha_ingreso;\n }\n // Buscar si esta en una Remision Abierta o En Proceso\n $rem2 = \"SELECT n.n_nro, n.suc_d FROM nota_remision n, nota_rem_det d WHERE n.n_nro = d.n_nro AND lote = '$lote' AND n.estado != 'Cerrada' AND n.suc = '$suc'\";\n \n $db->Query($rem2);\n if($db->NumRows() > 0){ \n $db->NextRecord();\n $n_nro = $db->Record['n_nro'];\n $destino = $db->Record['suc_d'];\n $datos['NroRemision'] = $n_nro;\n $datos['Destino'] = $destino;\n $datos['Mensaje']=\"En Remision\";\n }else{\n $datos['Mensaje']=\"Ok\"; \n }\n \n }\n echo json_encode($datos);\n }else{\n echo '{\"Mensaje\":\"Error: Codigo no encontrado!\"}';\n } \n $my->Close();\n }", "function consultarIncapacidad(){\n $queryconsultarIncapacidad=$this->mdlOrdenes->consultarIncapacidad(base64_decode($_POST[\"idAtencion\"]));\n echo json_encode($queryconsultarIncapacidad);\n }", "public function get_all_cajeros()\n { \n $this->parametros = array();\n $this->sp = \"str_consultacajeros\";\n $this->executeSPConsulta();\n\n if (count($this->rows)<=0){\n $this->mensaje=\"No existen niveles economicos en la BD.\";\n array_pop($rol);\n array_push($rol, array(0 => -1, \n 1 => 'Seleccione...',\n 3 => ''));\n\t\t\t\n }else{\n $rol = array();\n\n array_pop($rol);\n array_push($rol, array(0 => -1, \n 1 => 'Seleccione...',\n 3 => ''));\n\t\t\t\n foreach($this->rows as $niveles_economicos){\n array_push($rol, array_values($niveles_economicos));\n }\n\n $this->rows = $rol;\n unset($rol);\n }\n }", "function arrayColaEstudiantes (){\n\t\t\t$host = \"localhost\";\n\t\t\t$usuario = \"root\";\n\t\t\t$password = \"\";\n\t\t\t$BaseDatos = \"pide_turno\";\n\n\t $link=mysql_connect($host,$usuario,$password);\n\n\t\t\tmysql_select_db($BaseDatos,$link);\n\t\t\t$retorno = array();\n\t\t\t$consultaSQL = \"SELECT turnos.codigo, turnos.nombre, turnos.carrera FROM turnos WHERE turnos.estado='No atendido' ORDER BY guia;\";\n\t\t\tmysql_query(\"SET NAMES utf8\");\n\t\t\t$result = mysql_query($consultaSQL);\n\t\t\tfor($i=0;$fila= mysql_fetch_assoc($result); $i++) {\n\t\t\t\tfor($a= 0;$a<mysql_num_fields($result);$a++){\n\t\t\t\t\t$campo = mysql_field_name($result,$a);\n\t\t\t\t\t$retorno[$i][$campo] = $fila[$campo];\n\t\t\t\t}\n\t\t\t};\n\t\t\tmysql_close($link);\n\n\t\t\treturn $retorno;\n\t\t}", "public function getAllCommande(){\n $cmd = Bon_commande::all();\n \n foreach ($cmd as $value) {\n $fournisseur = $value->fournisseur;\n $command_article = $value->command_article;\n }\n $nb = 0;\n foreach ($cmd as $key ) {\n $nb ++;\n }\n \n return response()->json([\n 'commande' => $cmd,\n 'nb' => $nb,\n ]);\n\n }", "static public function getCausaDeser() {\n try {\n $sql = 'SELECT causa_desercion.cod_causa, causa_desercion.desc_causa, causa_desercion.estado FROM causa_desercion';\n return conexion::getInstance()->query($sql)->fetchAll(PDO::FETCH_ASSOC);\n } catch (PDOException $e) {\n return $e;\n }\n }", "public function cboProfec(){\n\t\t$db = new connectionClass();\n\n\t\t$sql = $db->query(\"SELECT * FROM profesiones\");\n\t\t$numberRecord = $sql->num_rows;\n\n\t\tif ($numberRecord != 0) {\n\t\t\t$dataArray = array();\n\t\t\t$i = 0;\n\n $dataArray[$i] = array(\"id\" => '0' , \"descripcion\" => 'Seleccione La Profecion');\n\n\t\t\twhile($data = $sql->fetch_assoc()){\n $i++;\n\t\t\t\t$dataArray[$i] = array(\"id\" => $data['idProfesion'], \"descripcion\" => $data['Profesion']);\n\t\t\t}\n\n\t\t\theader(\"Content-type: application/json\");\n\t\t\treturn json_encode($dataArray);\n\t\t}\n\t}", "function cargar_cuenta_de_costo() {\n $sql = \"SELECT id_plan_contable,cuenta_plan_contable,descripcion_plan_contable,cargar_plan_contable,abonar_plan_contable,transferencia_plan_contable FROM prosic_plan_contable WHERE cuenta_plan_contable LIKE '9%' ORDER BY cuenta_plan_contable\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function get_cargos($centro_costo){\n\t\t\t\n\t\t\t\n\t\t\ttry { \n\t\t\t\tglobal $conn;\n\t\t\t\t$sql=\"SELECT distinct c.cod_car, C.NOM_CAR \n\t\t\t\t\t FROM CARGOS C, CENTROCOSTO2 AREA, EMPLEADOS_BASIC EPL\n\t\t\t\t\t\tWHERE \n\t\t\t\t\t EPL.COD_CC2='\".$centro_costo.\"'\n\t\t\t\t\t\tAND EPL.COD_CAR=C.COD_CAR\n\t\t\t\t\t\torder by nom_car asc\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\t\t\t$rs=$conn->Execute($sql);\n\t\t\t\twhile($fila=$rs->FetchRow()){\n\t\t\t\t\t$this->lista[]=array(\"codigo\" => $fila[\"cod_car\"],\n\t\t\t\t\t\t\t\t\t\t \"cargos\"=> utf8_encode($fila[\"NOM_CAR\"]));\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn $this->lista;\n\t\t\t\t\n\t\t\t}catch (exception $e) { \n\n\t\t\t var_dump($e); \n\n\t\t\t adodb_backtrace($e->gettrace());\n\n\t\t\t} \n\t\t\n\t\t}", "public function cbo_clinica(){\n $data = array();\n $query = $this->db->get('clinica');\n if ($query->num_rows() > 0) {\n foreach ($query->result_array() as $row){\n $data[] = $row;\n }\n }\n $query->free_result();\n return $data;\n }", "function leerCreditos(){\n \n try{\n $stmt = $this->dbh->prepare(\"SELECT c.idcredito, t.NombreCte,c.tipoContrato, c.montoTotal, c.plazo,c.mensualidad, c.interes,\"\n . \" c.metodoPago, c.observaciones, c.status FROM tarjetas_clientes t join credito c on t.idClienteTg=c.cteId where c.status=1 or c.status=3\");\n // Especificamos el fetch mode antes de llamar a fetch()\n $stmt->execute();\n $clientes = $stmt->fetchAll(PDO::FETCH_NUM);\n } catch (PDOException $e){\n $clientes=array(\"status\"=>\"0\",\"mensaje\"=>$e->getMessage());\n }\n \n return $clientes;\n }", "function buscarCenso()\r\n {\r\n $data = $this->input->post('data');\r\n log_message('DEBUG', '#censo #buscarCensos'.$data);\r\n $rsp = $this->Censos->buscarCensos($data)->censos->censo;\r\n echo json_encode($rsp);\r\n }", "public function getConocimientos()\n {\n $this->db->select(\"*\");\n $this->db->from(\"conocimientos\");\n $this->db->where(\"verificado\",1);\n echo json_encode($this->db->get()->result());\n }", "public function getcboprovxclie() {\n \n $parametros = array(\n '@ccliente' => $this->input->post('ccliente')\n );\n\t\t$resultado = $this->mregctrolprov->getcboprovxclie($parametros);\n\t\techo json_encode($resultado);\n\t}", "function get_cod_area_telefono($id='',$codigo=''){\n\t\t$sQuery=\"SELECT * FROM cod_area_telefono WHERE 1 = 1 \";\n\t\tif($id) {\t$sQuery.=\"AND id = '$id' \";\t}\n\t\tif($codigo) {\t$sQuery.=\"AND codigo = '$codigo' \";}\n\t\t$sQuery.=\"ORDER BY codigo \";\n\t//\tdie($sQuery);\n\t\t$result=mssql_query($sQuery) or die(mssql_min_error_severity());\n\t\t$i=0;\n\t\twhile($row=mssql_fetch_array($result)){\n\t\t\tforeach($row as $key=>$value){\n\t\t\t\t$res_array[$i][$key]=$value;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn($res_array);\n\t\t\t\n\t}", "public function cbo_cliente(){\n $data = array();\n $query = $this->db->get('cliente');\n if ($query->num_rows() > 0) {\n foreach ($query->result_array() as $row){\n $data[] = $row;\n }\n }\n $query->free_result();\n return $data;\n }", "public function cboCourse(){\n\t\t$db = new connectionClass();\n\n\t\t$sql = $db->query(\"SELECT * FROM cursos\");\n\t\t$numberRecord = $sql->num_rows;\n\n\t\tif ($numberRecord != 0) {\n\t\t\t$dataArray = array();\n\t\t\t$i = 0;\n\n $dataArray[$i] = array(\"id\" => '0' , \"descripcion\" => 'Curso');\n\n\t\t\twhile($data = $sql->fetch_assoc()){\n $i++;\n\t\t\t\t$dataArray[$i] = array(\"id\" => $data['idCurso'], \"descripcion\" => $data['nombreCurso']);\n\t\t\t}\n\n\t\t\theader(\"Content-type: application/json\");\n\t\t\treturn json_encode($dataArray);\n\t\t}\n\t}", "function extraeTipos()\n{\n $link = conection();\n $parseUTF8 = array();\n $contador = null;\n \n $query = \"select * from Tipo_Raza\";\n $result = mysqli_query($link, $query);\n \n $array = mysqli_num_rows($result);\n \n if($array > 0)\n {\n while ($rows = mysqli_fetch_assoc($result))\n {\n $contador ++;\n \n $parseUTF8 [$contador] = [\"idTipo\" => $rows[\"idTipo\"],\n \"tamano\" => utf8_encode($rows[\"tamano\"])];\n }\n }\n \n mysqli_close($link);\n \n return $parseUTF8;\n}", "function listarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_sel';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('id_cuenta_bancaria_boa','int4');\n\t\t$this->captura('banco','int4');\n\t\t$this->captura('cuenta','varchar');\n\t\t$this->captura('desc_cuenta','varchar');\n\t\t$this->captura('moneda','int4');\n\t\t$this->captura('tipo_cuenta','bpchar');\n\t\t$this->captura('estado_cuenta','bpchar');\n\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('desc_cuenta_banco','varchar');\n\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function cirugias_tatalCirugias(){ \t\n\n\t\t\t$resultado = array();\n\t\t\t\n\t\t\t$query = \"Select count(idCirugia) as cantidadCirugias from tb_cirugias \";\n\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado['cantidadCirugias'];\t\t\t\n\t\t\t\n\t\t\t\n }", "function cuentabancos(){\n\t\t\t$sql=$this->query(\"select m.IdPoliza,m.Cuenta,c.description,c.manual_code\n\t\t\tfrom cont_movimientos m,cont_polizas p,cont_accounts c,cont_config conf\n\t\t\twhere m.cuenta=c.account_id and c.currency_id=2 \n\t\t\tand c.`main_father`=conf.CuentaBancos and p.idtipopoliza!=3 and m.TipoMovto not like '%M.E%'\n\t\t\tand m.IdPoliza=p.id and p.activo=1 and m.Activo=1 group by m.Cuenta\n\t\t\t\");\n\t\t\treturn $sql;\n\t\t}", "function apiGetCokeData()\n\t{\n\t\t$data = $this->model->dbGetData();\n\t\techo json_encode($data);\n\t}", "private function codIva(): array\n {\n $codigos = [];\n if ($this->ws === 'wsfe') {\n $codigos = $this->FEParamGetTiposIva();\n $codigos = array_map(function ($o) {\n return $o->Id;\n }, $codigos->IvaTipo);\n } elseif ($this->ws === 'wsmtxca') {\n /** @var array $authRequest */\n $authRequest = $this->service->authRequest;\n $codigos = (new WsParametros())->consultarAlicuotasIVA($this->service->client, $authRequest);\n $codigos = array_map(function ($o) {\n return $o->codigo;\n }, $codigos->arrayAlicuotasIVA->codigoDescripcion);\n }\n\n return $codigos;\n }", "static function GetChuyenDi($ten){\r\n\t\t\t$str = \"select * from tuyendi where Ten='\".$ten.\"'\";\r\n\t\t\t$kq = Query($str);\t\r\n\t\t\t$arr=array();\t\t\r\n\t\t\tif($kq>0){\r\n\t\t\t\t$i=0;\r\n\t\t\t\twhile($row=mysql_fetch_array($kq)){\r\n\t\t\t\t\t$arr[$i] = self:: ConversToObject($row);\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $arr;\r\n\t\t}", "function sincCxP(){\n $data=array();\n $this->query=\"SELECT ('T'||trim(cve_prov)) as cve_prov, p.* from paga_m03 p where ref_sist is null\";\n $res=$this->EjecutaQuerySimple();\n while ($tsarray=ibase_fetch_object($res)){\n $data[]=$tsarray;\n }\n $this->query=\"UPDATE paga_m03 set ref_sist = 'T'\";\n $this->EjecutaQuerySimple();\n return $data;\n }", "function traeConverssacion($idConver){\n\t\t$data = array(); \n\t\t$q = $this->db->query(\"SELECT * FROM conversaciones c WHERE c.cID='$idConver'\");\n\t\tif($q->num_rows() > 0) {\n\t\t\tforeach($q->result() as $row){\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\t$q->free_result(); \t\n\t\t}\n\t\treturn $data;\n\t}", "public function danh_sach_chucdanh(){\n\t\t//khai bao bien $db thành biến toàn cục để sử dụng bên trong class\n\t\tglobal $db;\n\t\t//truyền chuỗi sql để thực hiện truy vấn, kết quả trả về một biens object\n\t\t$result= mysqli_query($db,\"select * from chucdanh\");\n\t\t//duyet qua cac phan tu cua result, moi value duyet qua se duoc gan vao array\n\t\t$arr=array();\n\t\twhile($rows=mysqli_fetch_object($result))\n\t\t\t$arr[]=$rows;\n\t\treturn $arr;\n\t}", "public function getAllCountrie()\n\t{\n\t\t$countrie = Countrie::all() ;\t\n\t\t$data = array() ;\n\t\tforeach($countrie as $value){\n\t\t\t$countryData = array(\n\t\t\t'id' => $value->id ,\n\t\t\t'name_ar' => $value->name_ar ,\n\t\t\t'name_en' => $value->name_en \n\t\t\t) ;\n\t\t\tarray_push($data , $countryData) ;\n\t\t}\n\t\t return response()->json([\n 'status' => 1,\n 'data' => $data, \t\t\t\t\n ]); \n\t}", "public function get_Banco(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n $sql=\"select * from banco;\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function cboTipoPago(){\n\t\t$db = new connectionClass();\n\n\t\t$sql = $db->query(\"SELECT * FROM tipopago\");\n\t\t$numberRecord = $sql->num_rows;\n\n\t\tif ($numberRecord != 0) {\n\t\t\t$dataArray = array();\n\t\t\t$i = 0;\n\n $dataArray[$i] = array(\"id\" => '0' , \"descripcion\" => 'Seleccione el Tipo de Pago');\n\n\t\t\twhile($data = $sql->fetch_assoc()){\n $i++;\n\t\t\t\t$dataArray[$i] = array(\"id\" => $data['idTipoPago'], \"descripcion\" => $data['Descripcion']);\n\t\t\t}\n\n\t\t\theader(\"Content-type: application/json\");\n\t\t\treturn json_encode($dataArray);\n\t\t}\n\t}", "public function getConocimientosVerif()\n {\n $this->db->select(\"*\");\n $this->db->from(\"conocimientos\");\n echo json_encode($this->db->get()->result());\n }", "public function getData(){\n\n //Connetto al database\n $conn = $this->connection->sqlConnection();\n\n $sql = $conn->prepare(\"SELECT * FROM compra\");\n\n //Eseguo la query\n $sql->execute();\n\n $dataArray = array();\n //Se ci sono dei valori\n if($sql->rowCount() > 1) {\n\n // Ciclo tutti i valori\n while ($row = $sql->fetch()) {\n array_push($dataArray, $row);\n }\n //Se c'è un solo valore lo inserisco\n }else if($sql->rowCount() == 1) {\n $dataArray = $sql->fetch();\n }\n $conn = null;\n return $dataArray;\n }", "public function obtenerListaCIE() {\r\n $request = new simpleRest();\r\n //obtiene los datos de la peticion\r\n //$json = $request->getHttpRequestBody();\r\n //objeto que maneja las codificaciones/descodificaciones\r\n $handler = new requestRestHandler();\r\n \r\n //if (filter_var($username, FILTER_VALIDATE_EMAIL)) { \r\n $consulDB = new consultasDB(); \r\n //$this->mostrarRespuesta($this->convertirJson($respuesta), 200); \r\n $responseCIE = $consulDB->obtenerListaCIE();\r\n\r\n //echo $responseUsuario;\r\n //$datosRespuesta = (array)$handler->decodeJson($responsePaises);\r\n $datosRespuesta = $responseCIE;\r\n //$datosRespuesta = $handler->decodeJson($responsePaises);\r\n\r\n if (!isset($datosRespuesta[\"error\"])){\r\n //$respuesta['usuario'] = $username;\r\n $responseObtenerCIE10[\"error\"] = \"false\";\r\n $responseObtenerCIE10[\"status\"] = \"OK\";\r\n $responseObtenerCIE10[\"message\"] = \"SUCCESS\";\r\n $responseObtenerCIE10['fecha'] = ObtenerFecha(); //Obtiene la fecha actual\r\n //Aqui se implementa el manejo del token\r\n $responseObtenerCIE10[\"respuesta\"] = $datosRespuesta;\r\n\r\n }\r\n else {\r\n //Hay posiblidades: 1 - usuario no existe 2 - clave invalida\r\n $responseObtenerCIE10[\"error\"] = \"true\";\r\n $responseObtenerCIE10[\"status\"] = \"error\";\r\n $responseObtenerCIE10[\"message\"] = $datosRespuesta['error'];\r\n $responseObtenerCIE10['fecha'] = \"\";\r\n $responseObtenerCIE10[\"respuesta\"] = \"{}\";\r\n }\r\n\r\n $consulDB = null;\r\n //enviar respuesta\r\n return $responseObtenerCIE10;\r\n\r\n //}\r\n \r\n }", "public function buscarConectividad(){\n\t//\t$claveCT = '22FUA0044P'; clavecct de ejemplo\n\t//\t$claveCT = '22FUA0044P';\n\t\t$claveCT = $_POST['claveCT'];\n\t\t$conectividad = $this->conectividad_model->getCentroByClave($claveCT);\n\t\tif($conectividad){\n\t\t\t$bandera = 1;\n\t\t\tif($conectividad['statusServicio'] == 1){\n\t\t\t\t$status = \"Conectado\";\n\t\t\t}else{\n\t\t\t\t$status = \"No conectado\";\n\t\t\t}\n\t\t\t$msj = \"Este clave ya se encuentra agregada con un estatus de \" . $status;\n\t\t}else{\n\t\t $conectividad = $this->conectividad_model->getCentroByClaveCTCTBA($claveCT);\n\t\t\tif($conectividad){\n\t\t\t\t$bandera = 2;\n\t\t\t\t$msj = \"Clave encontrada\";\n\t\t\t}else{\n\t\t\t\t$conectividad = NULL;\n\t\t\t\t$bandera = 3;\n\t\t\t\t$msj=\"Clave no encontrada\";\n\t\t\t}\n\t\t} \n\t\techo json_encode(array(\"bandera\" => $bandera, \"msj\"=> $msj, \"conectividad\" => $conectividad)); \n\t}", "public function listAllCCO( Request $request ) \n {\n\n $reportes = $this->reportaDao->listAll();\n \n $arregloReporta = array();\n foreach( $reportes as $indice => $reporta ){\n\n $arreglo = array( \n \"id\" => $reporta->getId(), \n \"etiqueta\" => $reporta->getEtiqueta()\n );\n $arregloReporta[] = $arreglo;\n }\n \n return response( $arregloReporta , 200)->header('Content-Type', 'application/json'); \n \n\n \n}", "function getComentarios(){\n $this->bd->setConsulta(\"select * from comentario\");\n $comentario = array();\n $i=0;\n while ($fila = $this->bd->getFila()){\n $comentario[$i] = new Comentario($fila[\"id\"], $fila[\"descripcion\"],$fila[\"fechacreacion\"],$fila[\"idEntrada\"],$fila[\"idUsuario\"]);\n $i++;\n }\n return $comentario;\n }", "public function getAllDataSocioEcon($data)\n {\n $result = array();\n if (!count($data) || !count(current($data))) {\n return json_encode($result);\n }\n foreach ($data as $year => $values) {\n foreach ($values as $indicator) {\n $indicator['nazv_pokazat'] = iconv('CP1251', 'UTF-8', $indicator['nazv_pokazat']);\n $result[$year][] = $indicator;\n }\n }\n\n return json_encode($result);\n }", "public function getContrasenia():string{return $this->contrasenia;}", "public function getcbocalif() {\n \n\t\t$resultado = $this->mregctrolprov->getcbocalif();\n\t\techo json_encode($resultado);\n\t}", "public function obtenerViajesplusAbonados();", "public function getListetextes() \n\t{ \n require_once('dbconnect.php');\n\t\t$res = Array();\n\t\t$query = \"SELECT * FROM contenusite WHERE id IN ((SELECT min(id) FROM contenusite b), (SELECT max(id) FROM contenusite c))\" ;\n \n\t\tif($mrResultat = $mysqli->query($query))\n\t\t{ \n\t\t\twhile($result = $mrResultat->fetch_assoc())\n\t\t\t{ \n \n \n\t\t\t\tforeach( $result as $cle=> $valeur)\n\t\t\t\t{\n\t\t\t\t\t$result[$cle] =$valeur;\n \n\t\t\t\t}\n \n\t\t\t\t$res[] = $result;\n \n \n\t\t\t}\n header('Content-Type: application/json; charset=utf8 ');\n\t\techo json_encode($res, JSON_PRETTY_PRINT);\n exit;\n\t\t}\n \n\t}", "public function JsonDioceses() {\n $o_data = new Db();\n $qr_result = $o_data->query(\"select grandsparents.idno, CASE objects.status WHEN 0 THEN \\\"en attente\\\" WHEN 1 THEN \\\"en cours\\\" WHEN 2 THEN \\\"à valider\\\" WHEN 3 THEN \\\"validé\\\" ELSE \\\"valeur incohérente\\\" END as statut, count(*) as nombre from ca_objects as objects left join ca_objects as parents on parents.object_id=objects.parent_id left join ca_objects as grandsparents on parents.parent_id=grandsparents.object_id and grandsparents.type_id=261 where objects.type_id = 262 and objects.deleted=0 and parents.type_id=23 and parents.parent_id is not null and grandsparents.object_id is not null group by parents.parent_id, objects.status;\");\n $first=1;\n print \"[\";\n while($qr_result->nextRow()) {\n if(!$first) print \",\";\n print \"{\\\"idno\\\":\\\"\".$qr_result->get('idno').\"\\\",\\n\";\n print \"\\\"statut\\\":\\\"\".$qr_result->get('statut').\"\\\",\\n\";\n print \"\\\"nombre\\\":\\\"\".$qr_result->get('nombre').\"\\\"}\\n\";\n $first=0;\n }\n print \"]\\n\";\n exit;\n }", "public function datos_conductor()\n {\n $usuario = auth()->user();\n\n $conductor = ConductorModel::where(\"con_fk_usr\",$usuario->id)->first();\n \n return response()->json([\n \"success\" => true,\n \"data\" => $conductor\n ], 200);\n }", "public static function getAllCancioness(){\n $bd = Database::getInstance();\n $bd->query(\"SELECT * FROM canciones;\");\n \n $datos = [];\n\n while($item = $bd->getRow(\"cancion\")){\n array_push($datos,$item);\n }\n return $datos;\n }", "function getdata(){\n\t\t$grid = $this->jqdatagrid;\n\n\t\t// CREA EL WHERE PARA LA BUSQUEDA EN EL ENCABEZADO\n\t\t$mWHERE = $grid->geneTopWhere('scon');\n\n\t\t$response = $grid->getData('scon', array(array()), array(), false, $mWHERE, 'id','desc' );\n\t\t$rs = $grid->jsonresult( $response);\n\t\techo $rs;\n\t}", "function listarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_sel';\n\t\t$this->transaccion='TES_CTABAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha_baja','date');\n\t\t$this->captura('nro_cuenta','varchar');\n\t\t$this->captura('fecha_alta','date');\n\t\t$this->captura('id_institucion','int4');\n\t\t$this->captura('nombre_institucion','varchar');\n\t\t$this->captura('doc_id','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_moneda','integer');\n\t\t$this->captura('codigo_moneda','varchar');\n\t\t$this->captura('denominacion','varchar');\n\t\t$this->captura('centro','varchar');\n\t\t\n\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public static function viewTeenCoin(){\n try {\n $conexion = ConexionDB::conectar(\"cryptoMonedas\");\n $cursor = $conexion->monedas->find();\n $result = json_encode($cursor->toArray());\n } catch(Exception $e) {\n echo $e;\n }\n $conexion = null;\n return $result;\n}", "private function buscarCorreoERP($obj_con,$CedRuc, $DBTable) {\n //$obj_con = new cls_Base();\n //Nota debe extraer los Correos del SIstema ERP\n $conCont = $obj_con->conexionIntermedio();\n $rawData='';\n $sql = \"SELECT IFNULL(CORRE_E,'') CorreoPer FROM \" . $obj_con->BdIntermedio . \".$DBTable \"\n . \"WHERE CED_RUC='$CedRuc' AND CORRE_E<>'' \";\n //echo $sql;\n $sentencia = $conCont->query($sql);\n if ($sentencia->num_rows > 0) {\n $fila = $sentencia->fetch_assoc();\n $rawData= str_replace(\",\", \";\", $fila[\"CorreoPer\"]);//Remplaza las \",\" por el \";\" Para poder enviar.\n }\n $conCont->close();\n return $rawData;\n }", "public function getCicloCotable(){\n\t\t\t// creamos el array $retorna con los datos de la tabla lcompras\n\t\t\t$result = $this->_db->query(\"SELECT * FROM ciclocontable WHERE show_by = '1' ORDER BY idCicloContable DESC\");\n\t\t\t$retorna = $result->fetch_all(MYSQL_ASSOC);\n\n\t\t\treturn $retorna;\n\t\t}", "public function getCicloCotable(){\n\t\t\t// creamos el array $retorna con los datos de la tabla lcompras\n\t\t\t$result = $this->_db->query(\"SELECT * FROM ciclocontable WHERE show_by = '1' ORDER BY idCicloContable DESC\");\n\t\t\t$retorna = $result->fetch_all(MYSQL_ASSOC);\n\n\t\t\treturn $retorna;\n\t\t}", "function getCitas(){\n\t\n\t\treturn conectar()->query( \"SELECT hora, fecha, usuario, motivo FROM citas\");\n\t}", "public function generar_codigo_BD($basedatos,$cantidad) {\n\t\t$tabla = DB::table($basedatos)\n\t\t->select(DB::raw('max(codigo) as codigo'))\n\t\t->where('empresa_id','=',Session::get('empresas')->COD_EMPR)\n\t\t->where('centro_id','=',Session::get('centros')->COD_CENTRO)\n\t\t->get();\n\n\t\t//conversion a string y suma uno para el siguiente id\n\t\t$idsuma = (int)$tabla[0]->codigo + 1;\n\n\t\t//concatenar con ceros\n\t\t$correlativocompleta = str_pad($idsuma, $cantidad, \"0\", STR_PAD_LEFT); \n\n\t\treturn $correlativocompleta;\n\t}", "public function getDataCriacao()\n {\n return $this->data_criacao;\n }", "public function getComunas()\n\t{\n\t\t$comunas = $this->Model_Comuna->getComunas();\n\t\techo json_encode($comunas);\n\t}", "function allinea_db(){\n\t\tif ($this->attributes['BYTB']!='' ) $this->fields_value_bytb($this->attributes['BYTB']);\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\n\t\t\t\t$ret[$i]=\"{$key} NUMBER\";\n\t\t\t\t$i++;\n\t\t\t\t$ret[$i]=\"D_{$key} VARCHAR2(200 CHAR)\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}\n\t\telse return ;\n\t}", "static function listaClanaka(){\n\t\trequire_once(MODEL_ABS.'DB_DAO/Broker_baze.php');\n\t\trequire_once(MODEL_ABS.'DB_DAO/Clanak.php');\n\t\t\n\t\t$broker=new Broker();\n\t\t$clanak=new Clanak($broker);\n\t\t(isset($_GET['pag'])) ? $pag=$_GET['pag'] : $pag=0;\n\t\t(isset($_GET['korak'])) ? $korak=$_GET['korak'] : $korak=5;\n\t\t\n\t\t$rezultat['clanci']=$clanak->limitClanci($pag,$korak);\n\t\t$br_clanaka=$clanak->brojanjeClanaka();\n\t\t$rezultat['pags']=ceil($br_clanaka/$korak);\n\t\t$rezultat['pag']=$pag;\n\t\t\n\t\treturn $rezultat;\n\t}", "public function ciudades_all()\n {\n $ciudad = Ciudad::with('departamento')->get();\n\n return $this->sendResponse($ciudad->toArray(), 'Ciudades devueltas con éxito');\n }", "function Readto()\n {\n $conexion=floopets_BD::Connect();\n $conexion->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);\n\n $consulta=\"SELECT denuncia.*,tipo_denuncia.* FROM tipo_denuncia INNER JOIN denuncia on tipo_denuncia.td_cod_tipo_denuncia=denuncia.td_cod_tipo_denuncia \";\n // $consulta=\"SELECT * FROM citas WHERE Cod_usu=?\";\n $query=$conexion->prepare($consulta);\n $query->execute(array());\n\n\t$resultado=$query->fetchAll(PDO::FETCH_BOTH);\n\n\tfloopets_BD::Disconnect();\n\n\treturn $resultado;\n }", "public function cargarEstados()\r\n {\r\n \r\n $data = $this->cargar_model->cargarEstados();\r\n\r\n print_r(json_encode($data)); \r\n \r\n }", "public function cboGrados(){\n\t\t$db = new connectionClass();\n\n\t\t$sql = $db->query(\"SELECT * FROM grado\");\n\t\t$numberRecord = $sql->num_rows;\n\n\t\tif ($numberRecord != 0) {\n\t\t\t$dataArray = array();\n\t\t\t$i = 0;\n\n $dataArray[$i] = array(\"id\" => '0' , \"descripcion\" => 'Grado');\n\n\t\t\twhile($data = $sql->fetch_assoc()){\n $i++;\n\t\t\t\t$dataArray[$i] = array(\"id\" => $data['idGrado'], \"descripcion\" => $data['Descripcion']);\n\t\t\t}\n\n\t\t\theader(\"Content-type: application/json\");\n\t\t\treturn json_encode($dataArray);\n\t\t}\n\t}", "public function listaCompraFinal(){\n\t\n\t\t$sql = sprintf(\"SELECT * FROM compra_final\");\n\t\n\t\t$conn = new Conexao();\n\t\t$conn->openConnect();\n\t\n\t\t$mydb = mysqli_select_db($conn->getCon(), $conn->getBD());\n\t\t$resultado = mysqli_query($conn->getCon(), $sql);\n\t\n\t\t$arrayProduto = array();\n\t\n\t\twhile ($row = mysqli_fetch_assoc($resultado)) {\n\t\t\t$arrayProduto[]=$row;\n\t\t}\n\t\n\t\t$conn->closeConnect ();\n\t\treturn $arrayProduto;\n\t\n\t}", "function cargar_datos($tabla)\n {\n //2015-12-04 solucionar problema memory limit y tiempo de ejecución\n ini_set('memory_limit', '2048M'); \n set_time_limit(120); //120 segundos, dos minutos por ciclo\n \n $json_descarga = $this->input->post('json_descarga');\n $descarga = json_decode($json_descarga);\n $respuesta = $this->Develop_model->cargar_registros($tabla, $descarga);\n \n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode($respuesta));\n }", "public function obtenerCiclos() {\r\n $ciclo = new Ciclo;\r\n $respuestaObtenerCiclos = $ciclo->obtenerCiclos();\r\n return $respuestaObtenerCiclos;\r\n }", "public function getcboestado() {\n \n\t\t$resultado = $this->mregctrolprov->getcboestado();\n\t\techo json_encode($resultado);\n\t}", "public function verificarCarnet($ci){\n $verificar=DB::select('SELECT *,COUNT(*)as contador from cliente where ci='.$ci);\n return response()->json($verificar);\n\n }", "public function cekapi()\n {\n $term = 'CABANG';\n $data = $this->M_msj->getMaster();\n // $data = $this->M_msj->getFPB('SJ200500001');\n echo \"<pre>\";\n print_r($data);\n die;\n }", "public function consumo($id_cirugia) {\n return $this->db\n ->select(format_select(array(\n 'cirugia.idCirugia' => 'id_cirugia',\n 'material_osteosintesis.nombre' => 'nombre',\n 'cirugia_material_osteosintesis.cantidad' => 'cantidad'\n )))\n ->join('cirugia_material_osteosintesis','cirugia_material_osteosintesis.idCirugia = cirugia.idCirugia')\n ->join('material_osteosintesis','material_osteosintesis.idMaterial_Osteosintesis = cirugia_material_osteosintesis.idMaterial_Osteosintesis')\n ->where('cirugia.status = \"1\" AND cirugia.idCirugia = \"'.$id_cirugia.'\"')\n ->get('cirugia')\n ->result_array();\n }", "public function getAllClinicInfo(){\n $stmt = $this->adapter->conn->prepare(\"SELECT * FROM CLINIC\"); \n $result = null;\n try{\n $result = $this->adapter->executeFetchPrepared($stmt);\n }catch(PDOException $e){\n return null;\n }\n \n return $result;\n }", "function selectByIdac_consumos($consumo_id){\n\t\t\t$this->connection = Connection::getinstance()->getConn();\n\t\t\t$PreparedStatement = \"SELECT consumo_id, socio_id, nro_medidor, fecha_lectura, fecha_emision, periodo_mes, periodo_anio, consumo_total_lectura, consumo_por_pagar, costo_consumo_por_pagar, estado, fecha_hora_pago, usuario_pago, monto_pagado, pagado_por, ci_pagado_por,\n (SELECT CONCAT(nombres,' ',apellidos) FROM asapasc.ac_socios WHERE socio_id = asapasc.ac_consumos.socio_id) AS socio \n FROM asapasc.ac_consumos WHERE consumo_id = \".Connection::inject($consumo_id).\" ;\";\n\t\t\t$ResultSet = mysql_query($PreparedStatement,$this->connection);\n\t\t\tlogs::set_log(__FILE__,__CLASS__,__METHOD__, $PreparedStatement);\n\n\t\t\t$elem = new ac_consumosTO();\n\t\t\twhile($row = mysql_fetch_array($ResultSet)){\n\t\t\t\t$elem = new ac_consumosTO();\n\t\t\t\t$elem->setConsumo_id($row['consumo_id']);\n\t\t\t\t$elem->setSocio_id($row['socio_id']);\n\t\t\t\t$elem->setNro_medidor($row['nro_medidor']);\n\t\t\t\t$elem->setFecha_lectura($row['fecha_lectura']);\n\t\t\t\t$elem->setFecha_emision($row['fecha_emision']);\n\t\t\t\t$elem->setPeriodo_mes($row['periodo_mes']);\n\t\t\t\t$elem->setPeriodo_anio($row['periodo_anio']);\n\t\t\t\t$elem->setConsumo_total_lectura($row['consumo_total_lectura']);\n\t\t\t\t$elem->setConsumo_por_pagar($row['consumo_por_pagar']);\n\t\t\t\t$elem->setCosto_consumo_por_pagar($row['costo_consumo_por_pagar']);\n\t\t\t\t$elem->setEstado($row['estado']);\n\t\t\t\t$elem->setFecha_hora_pago($row['fecha_hora_pago']);\n\t\t\t\t$elem->setUsuario_pago($row['usuario_pago']);\n\t\t\t\t$elem->setMonto_pagado($row['monto_pagado']);\n\t\t\t\t$elem->setPagado_por($row['pagado_por']);\n\t\t\t\t$elem->setCi_pagado_por($row['ci_pagado_por']);\n $elem->setSocio($row['socio']);\n\n\t\t\t}\n\t\t\tmysql_free_result($ResultSet);\n\t\t\treturn $elem;\n\t\t}", "public function __construct(){\n \t\t// Criando Conexão\n \t\t$dsn = 'mysql:dbname=db_padrao;host=localhost;port=3336;';\n \t\t$user = 'root';\n \t\t$password = '';\n\t\t$this->connector = new PDO($dsn, $user, $password);\n\t\t$this->connector->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$this->connector->exec(\"SET CHARACTER SET utf8\");\n \t\t$retornos = [];\n \t}", "public function listaCategoria(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT * from tbcategorias order by idcategoria\";\n $sql = $this->conexao->query($sql);\n\n while ($row = $sql->fetch_assoc()) {\n $data[] = $row;\n }\n \n \n return $data;\n\n }", "public function ctlBuscaCompras(){\n\n\t\t$respuesta = Datos::mdlCompras(\"entradas\");\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"codProducto\"].'\">'.$item[\"noOperacion\"].' - '.$item[\"proveedor\"].' - '.$item[\"kg\"].' - '.$item[\"precio\"].'</option>';\n\t\t}\n\t}", "function cargar_data_libro_banco($c_a_cuenta_banco, $limit, $nombre_mes='' , $cc='') {\n\t//$nombre_mes='DICIEMBRE';\n $sql = \"SELECT\n prosic_comprobante.id_comprobante\n , prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.status_comprobante\n , prosic_anexo.codigo_anexo\n , prosic_subdiario.id_subdiario\n , prosic_subdiario.codigo_subdiario\n , prosic_subdiario.nombre_subdiario\n , prosic_anio.nombre_anio\n , prosic_mes.nombre_mes\n , prosic_tipo_comprobante.codigo_tipo_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n ,prosic_comprobante.nro_comprobante\n ,prosic_moneda.codigo_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo \tON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_mes \tON (prosic_comprobante.id_mes = prosic_mes.id_mes)\n INNER JOIN prosic_anio \tON (prosic_comprobante.id_anio = prosic_anio.id_anio)\n INNER JOIN prosic_subdiario \tON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n INNER JOIN prosic_tipo_comprobante\tON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_plan_contable ON (prosic_comprobante.cuenta_banco = prosic_plan_contable.id_plan_contable)\n INNER JOIN prosic_moneda\t ON (prosic_comprobante.id_moneda= prosic_moneda.id_moneda)\n WHERE prosic_comprobante.id_subdiario=8 AND prosic_comprobante.c_a_cuenta_banco='\" . $c_a_cuenta_banco . \"' \";\t\n\tif ($nombre_mes != '') $sql.= \" AND prosic_mes.nombre_mes = '\" . $nombre_mes . \"' \";\n\tif ($cc != '') $sql.=\" AND prosic_comprobante.codigo_comprobante = '\" . $cc . \"' \";\n\t$sql.=\" ORDER BY MONTH(prosic_comprobante.emision_comprobante) DESC , prosic_comprobante.codigo_comprobante*10000 DESC\";\n\t//$sql.=\" ORDER BY prosic_comprobante.status_comprobante DESC, MONTH(prosic_comprobante.emision_comprobante), prosic_comprobante.emision_comprobante\";\n\tif ($limit != '')$sql.=\" \" . $limit . \" \";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function getConsolas(){\n //Equivalente a un SELECT * FROM consolas\n $consolas = Consola::all();\n return $consolas;\n }", "public function getComercios(){\n\t\t$sql = \"SELECT ID_comercio, nombre, correo, telefono, responsable, FK_ID_estado_comercio FROM comercio ORDER BY nombre\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function obteterDatos($id_OrdenCompra){\n\t\t\techo '---'.$id_OrdenCompra.'---';\n\t\t\t$conexion = $this->conn;\n\t\t\t$sth = $conexion->prepare('SELECT id_OrdenCompra, nombre_OrdenCompra as nombre, fecha_registro ,prop.tipo_procedencia , rfc, telefono , email , direccion , tipop.tipo , nickname , password , url_image from '.$this->nombreTabla.' OrdenCompra , procendias_OrdenCompra prop, tipos tipop where estado = 1 and OrdenCompra.id_tipo_procedencia= prop.id_tipo_procedencia and OrdenCompra.id_tipo = tipop.id_tipo and id_OrdenCompra = :id_OrdenCompra', array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\t\n\t\t\t$sth->bindParam(':id_OrdenCompra', $id_OrdenCompra, PDO::PARAM_INT );\n\t\t\t$sth->execute();\n\t\t\t$row = $sth->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row;\n\t\t}", "public static function obtenerCondiciones()\n {\n $consulta = \"SELECT * FROM condiciones ORDER BY contador DESC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function CapturaCalificacionDescargar()\n {\n $dbmi = $this->get(\"db_manager\");\n $dbm = new DbmControlescolar($dbmi->getEntityManager());\n $content = trim(file_get_contents(\"php://input\"));\n $decoded = json_decode($content, true);\n //$dataRaw=json_decode('',true);\n //*\n $decoded[\"showAsistencias\"] = ($decoded[\"showAsistencias\"] == true ? \"true\" : \"false\");\n $dataRaw = self::CCCapturaCalificacionGrupoProcess($dbmi, $decoded);\n $dataarray = &$dataRaw[2];\n $dataarray[\"arraydato\"] = $dataarray[\"arraydato\"][0];\n\n $ultimoperiodo = $dataarray[\"ultimoperiodo\"];\n $conjuntope = $ultimoperiodo->getConjuntoperiodoevaluacionid();\n $ciclo = $conjuntope->getCicloid();\n\n $arraymateria = $dataarray[\"arraymateria\"];\n $planestudio = $arraymateria->getPlanestudioid();\n $grado = $planestudio->getGradoid();\n $nivel = $grado->getNivelid();\n\n $omateria = $arraymateria->getMateriaid();\n $omateriaid = $omateria->getMateriaid();\n $omaterianame = $omateria->getNombre();\n\n $arraydato = &$dataarray[\"arraydato\"];\n $arraydato[\"ciclo\"] = $ciclo->getNombre();\n $arraydato[\"nivel\"] = $nivel->getNombre();\n $arraydato[\"grado\"] = $grado->getGrado();\n $arraydato[\"planestudio\"] = $planestudio->getNombre();\n unset($dataarray[\"arraymateria\"]);\n unset($dataarray[\"ultimoperiodo\"]);\n //echo json_encode($dataRaw);exit;\n //*/\n list($status, $code, $data) = $dataRaw;\n $header = $data[\"arraydato\"];\n $alumnos = $data[\"arrayalumno\"];\n $jtable = [];\n\n foreach ($alumnos as $ialumno) {\n $ialumnonum = \"\" . $ialumno['numerolista'];\n $ialumnoname = $ialumno['nombre'];\n $irowname = $ialumnonum . \" - \" . $ialumnoname;\n $iacalperiodo = $ialumno['calificacionperiodo'][0];\n $iscoreperiodo = $iacalperiodo['calificacionperiodo'];\n $iscoreaperiodo = $iacalperiodo['calificacionantesredondeo'];\n $iscoreperiodof = $iacalperiodo['calificacionfinal'];\n $iponderacionraw = $iacalperiodo['opcionperiodo']; //Ponderacion periodo\n $iponderacionfraw = $iacalperiodo['opcionfinal']; //Ponderacion final\n\n $iaponderacionraw = (!$iponderacionraw || is_array($iponderacionraw) || empty($iponderacionraw)\n ? null : $dbm->getPonderacionopcionById($iponderacionraw));\n $iaponderacionfraw = (!$iponderacionfraw || is_array($iponderacionfraw) || empty($iponderacionfraw)\n ? null : $dbm->getPonderacionopcionById($iponderacionfraw));\n\n $iaponderacion = ($iaponderacionraw ? $iaponderacionraw['opcion'] : null);\n $iaponderacionf = ($iaponderacionfraw ? $iaponderacionfraw['opcion'] : null);\n\n $isubmaterias = (isset($ialumno['submaterias']) && !empty($ialumno['submaterias'])\n ? $ialumno['submaterias'] : null);\n $imaterias = $isubmaterias;\n if (!$isubmaterias) {\n $ialumno['materiaid'] = $omateriaid;\n $ialumno['nombre'] = $omaterianame;\n $imaterias = [$ialumno];\n }\n $imi = 0;\n foreach ($imaterias as $imateria) {\n $imaterianame = $imateria[\"nombre\"];\n $irow1name = $imaterianame; //($isubmaterias ? $imaterianame : \"\");\n $jtable[] = $this->buildJTableCell(\"Matrícula\", $irowname, $irow1name, $ialumno['matricula']);\n $icriterios = $imateria['criterios'];\n $imcalperiodo = $imateria['calificacionperiodo'][0];\n foreach ($icriterios as $icriterio) {\n $icapturas = $icriterio['calificacioncaptura'];\n $icriterioname = $icriterio['aspecto'];\n $icriteriodata = $icriterio['porcentajecalificacion'] . \"% 0 a \" . $icriterio['puntajemaximo'];\n $totalCapturas = 0;\n foreach ($icapturas as $icaptura) {\n $totalCapturas = $totalCapturas + $icaptura['calificacion'];\n $jtable[] = $this->buildJTableCell($icriterioname, $irowname, $irow1name, $icaptura['calificacion'], $icriteriodata, \"\" . $icaptura['numerocaptura']);\n }\n\n $jtable[] = $this->buildJTableCell(\"Promedio \" . $icriterioname, $irowname, $irow1name, ($totalCapturas/count($icapturas)), \"\", \"\");\n $jtable[] = $this->buildJTableCell(\"Porcentaje \" . $icriterioname, $irowname, $irow1name, ((($totalCapturas/count($icapturas))*$icriterio['porcentajecalificacion'])/$icriterio['puntajemaximo']), \"\", \"\");\n }\n $imponderacionraw = $imcalperiodo['opcionperiodo'];\n $imaponderacionraw = (!$imponderacionraw || is_array($imponderacionraw) || empty($imponderacionraw)\n ? null : $dbm->getPonderacionopcionById($imponderacionraw));\n $imaponderacion = ($imaponderacionraw ? $imaponderacionraw['opcion'] : null);\n $iobservacion = (!isset($imcalperiodo['observacion']) || empty(trim($imcalperiodo['observacion']))\n ? null : trim($imcalperiodo['observacion']));\n if ($iobservacion) {\n $jtable[] = $this->buildJTableCell(\"Observaciones\", $irowname, $irow1name, $iobservacion);\n }\n if ($imaponderacion && $isubmaterias) {\n $jtable[] = $this->buildJTableCell(\"Evaluacion\", $irowname, $irow1name, $imaponderacion);\n }\n if($iscoreaperiodo){\n $jtable[] = $this->buildJTableCell(\"Calificación antes de redondeo\", $irowname, $irow1name, $iscoreaperiodo);\n }\n if ($iscoreperiodo) {\n $jtable[] = $this->buildJTableCell(\"Calificación periodo\", $irowname, $irow1name, $iscoreperiodo);\n }\n if ($iaponderacion) {\n $jtable[] = $this->buildJTableCell(\"Ponderacion periodo\", $irowname, $irow1name, $iaponderacion);\n }\n if ($iscoreperiodof && ENTORNO == 1) {\n $jtable[] = $this->buildJTableCell(\"Calificación final\", $irowname, $irow1name, $iscoreperiodof);\n }\n if ($iaponderacionf) {\n $jtable[] = $this->buildJTableCell(\"Ponderacion final\", $irowname, $irow1name, $iaponderacionf);\n }\n \n if($imateria[\"totalfaltas\"]){\n $jtable[] = $this->buildJTableCell(\"Faltas\", $irowname, $irow1name, $imateria[\"totalfaltas\"]);\n }else{\n if($imi == 0){\n $jtable[] = $this->buildJTableCell(\"Faltas\", $irowname, $irow1name, $ialumno[\"totalfaltas\"]);\n }\n \n }\n $imi++;\n }\n\n }\n $result = [\n \"header\" => $header,\n \"score\" => $jtable\n ];\n //echo json_encode($result);exit;\n\n\n $done = false;\n $name = \"R\" . rand();\n $report = \"ReporteCalificacionesDetalle\";\n $input = $output = \"ReporteCalificacionesDetalle_$name\";\n\n $pdf = new LDPDF($this->container, $report, $output, array('driver' => 'jsonql', 'jsonql_query' => '\"\"', 'data_file' => $input), [], ['xlsx']);\n $inputPath = $pdf->fdb_r;\n $outputPath = $pdf->output_r;\n\n $resultenc = json_encode($result);\n $file = LDPDF::fileRead($inputPath);\n LDPDF::fileWrite($file, $resultenc);\n LDPDF::fileClose($file);\n $toremove = [$inputPath];\n\n if (!$pdf->execute()) {\n $toremove[] = $outputPath;\n $done = true;\n }\n\n $reporteSize = filesize($outputPath);\n $reporte = file_get_contents($outputPath);\n foreach ($toremove as $i) {\n LDPDF::fileDelete($i);\n }\n return ($done ? new Response($reporte, 200, array(\n 'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8',\n 'Content-Length' => $reporteSize\n )) : Api::Error(Response::HTTP_PARTIAL_CONTENT, \"La impresion no esta disponible.\"));\n }", "function cariICD()\n\t{\n\t\tif ($this->input->get() != NULL) {\n\t\t\t$dataForm = $this->input->get();\n\t\t\t$dataReturn = $this->Kesehatan_M->orLike('icd10',array('Diagnosa'=>$dataForm['term']['term'],'Diskripsi'=>$dataForm['term']['term']))->result();\n\t\t\t$data = array();\n\t\t\tforeach ($dataReturn as $key => $value) {\n\t\t\t\t$data[$key]['id'] = $value->Kode_ICD. \" / \".$value->Diskripsi;\n\t\t\t\t$data[$key]['text'] = $value->Kode_ICD.\" / \".$value->Diskripsi;\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t}else{\n\t\t\tredirect(base_url());\n\t\t}\n\t}", "public function obtenerViajesplus();", "static function cursadas(){\n\t\t\n\t\t$cs = array();\n\t\t\n\t\t$conn = new Conexion();\n\t\t\n\t\t$sql = 'SELECT id_carrera, materia, anio FROM cursada';\n\t\t\n\t\t$consulta = $conn->prepare($sql);\n\t\t\n\t\t$consulta->setFetchMode(PDO::FETCH_ASSOC);\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$consulta->execute();\n\t\t\t\n\t\t\t$results = $consulta->fetchall();\n\t\t\t\n\t\t\tforeach($results as $r){\n\t\t\t\t\n\t\t\t\t$c = Cursada::cursada($r['id_carrera'], $r['materia'], $r['anio']);\n\t\t\t\t\n\t\t\t\tarray_push($cs, $c);\n\t\t\t}\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $cs;\n\t}", "function arrayTurnosCola (){\n\t\t$host = \"localhost\";\n\t\t$usuario = \"root\";\n\t\t$password = \"\";\n\t\t$BaseDatos = \"pide_turno\";\n\n $link=mysql_connect($host,$usuario,$password);\n\n\t\tmysql_select_db($BaseDatos,$link);\n\n\t\t$consultaSQL= \"SELECT estado_programas.programa, estado_programas.Comentarios, estado_programas.turnos_atendidos, estado_programas.codigo, estado_programas.turnos_manana, estado_programas.turnos_tarde, estado_programas.segundos_espera, estado_programas.estado FROM estado_programas GROUP BY estado_programas.programa\";\n\t\t$retorno =\"\";\n\t\tmysql_query(\"SET NAMES utf8\");\n\t\t$result = mysql_query($consultaSQL);\n\t\tfor($i=0;$fila= mysql_fetch_assoc($result); $i++) {\n\t\t\tfor($a= 0;$a<mysql_num_fields($result);$a++){\n\t\t\t\t$campo = mysql_field_name($result,$a);\n\t\t\t\t$retorno[$i][$campo] = $fila[$campo];\n\t\t\t}\n\t\t};\n\t\tmysql_close($link);\n\n\t\treturn $retorno;\n\t}", "private function codDocumento(): array\n {\n $codigos = [];\n if ($this->ws === 'wsfe') {\n $codigos = (array) $this->FEParamGetTiposDoc();\n $codigos = array_map(function ($o) {\n return $o->Id;\n }, $codigos['DocTipo']);\n } elseif ($this->ws === 'wsmtxca') {\n /** @var array $authRequest */\n $authRequest = $this->service->authRequest;\n $codigos = (new WsParametros())->consultarTiposDocumento($this->service->client, $authRequest);\n $codigos = array_map(function ($o) {\n return $o->codigo;\n }, $codigos->arrayTiposDocumento->codigoDescripcion);\n }\n\n return $codigos;\n }", "static public function ctrRegistroBitacoraAgregar(){\r\n\r\n\r\n\t\t$tabla = \"bitacora\";\r\n\r\n\t\t$datos = array(\"usuario\" => $_SESSION['nombre'],\r\n\t\t\t\t\t\t\t \"perfil\" => $_SESSION['perfil'],\r\n\t\t\t\t\t\t\t \"accion\" => 'Importación de Datos Banco 0840',\r\n\t\t\t\t\t\t\t \"folio\" => 'Sin folio');\r\n\r\n\t\t$respuesta = ModeloBanco0840Diario::mdlRegistroBitacoraAgregar($tabla, $datos);\r\n\r\n\t\treturn $respuesta;\r\n\t\t\r\n\t\t\r\n\t}", "private function codOpcionales(): array\n {\n $codigos = [];\n if ($this->ws === 'wsfe') {\n $codigos = $this->FEParamGetTiposOpcional();\n $codigos = array_map(function ($o) {\n return $o->Id;\n }, $codigos->OpcionalTipo);\n }\n\n return $codigos;\n }", "static public function ctrRegistroBitacoraAgregar(){\r\n\r\n\r\n\t\t$tabla = \"bitacora\";\r\n\r\n\t\t$datos = array(\"usuario\" => $_SESSION['nombre'],\r\n\t\t\t\t\t\t\t \"perfil\" => $_SESSION['perfil'],\r\n\t\t\t\t\t\t\t \"accion\" => 'Importación de Datos Banco 6278',\r\n\t\t\t\t\t\t\t \"folio\" => 'Sin folio');\r\n\r\n\t\t$respuesta = ModeloBanco6278Diario::mdlRegistroBitacoraAgregar($tabla, $datos);\r\n\r\n\t\treturn $respuesta;\r\n\t\t\r\n\t\t\r\n\t}", "public function get_centroCosto(){\n\t\t\t\n\t\t\ttry { \n\t\t\t\tglobal $conn;\n\t\t\t\t$sql=\"SELECT distinct AREA.COD_CC2, AREA.NOM_CC2 \n\t\t\t\t\t\tFROM CENTROCOSTO2 AREA, EMPLEADOS_BASIC EPL, EMPLEADOS_GRAL GRAL\n\t\t\t\t\t\tWHERE EPL.COD_EPL = GRAL.COD_EPL\n\t\t\t\t\t\tAND EPL.COD_CC2=AREA.COD_CC2\n\t\t\t\t\t\tand AREA.estado='A'\n\t\t\t\t\t\tand EPL.estado='A'\n\t\t\t\t\t\torder by nom_cc2 asc\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\t\t\t$rs=$conn->Execute($sql);\n\t\t\t\twhile($fila=$rs->FetchRow()){\n\t\t\t\t\t$this->lista[]=array(\"codigo\" => $fila[\"COD_CC2\"],\n\t\t\t\t\t\t\t\t\t\t \"area\"\t => utf8_encode($fila[\"NOM_CC2\"]));\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn $this->lista;\n\t\t\t\t\n\t\t\t}catch (exception $e) { \n\n\t\t\t var_dump($e); \n\n\t\t\t adodb_backtrace($e->gettrace());\n\n\t\t\t} \n\t\t\t\n\t\t\t\n\t\t}" ]
[ "0.65490943", "0.6200421", "0.61428523", "0.61353755", "0.61047727", "0.6051246", "0.60508996", "0.60457075", "0.5940241", "0.5931405", "0.5920648", "0.58757555", "0.5866256", "0.5864305", "0.5861602", "0.5855509", "0.58455914", "0.5823642", "0.5816729", "0.58167154", "0.5775345", "0.5759236", "0.5754361", "0.5740178", "0.57325524", "0.5724145", "0.5717812", "0.5708741", "0.57052106", "0.57004684", "0.567979", "0.5678166", "0.5666367", "0.5664996", "0.56633866", "0.56591", "0.56356955", "0.5634969", "0.56322026", "0.56319237", "0.5621037", "0.56182337", "0.56115294", "0.56096387", "0.5608325", "0.5601884", "0.5601002", "0.5588769", "0.5583177", "0.55799264", "0.5573798", "0.55714726", "0.55664444", "0.5564554", "0.5548928", "0.55472004", "0.55439925", "0.55420583", "0.55313915", "0.5525009", "0.55223715", "0.55176324", "0.55176324", "0.5517404", "0.5505476", "0.5494616", "0.5489659", "0.54874915", "0.5484029", "0.54719955", "0.5464856", "0.5459604", "0.54579055", "0.5457302", "0.5457237", "0.54551584", "0.5453136", "0.5452393", "0.5450932", "0.5449291", "0.54489887", "0.54449683", "0.54433924", "0.5443308", "0.5443182", "0.5438507", "0.5437058", "0.5433936", "0.54275155", "0.54259723", "0.5421704", "0.5418354", "0.54153425", "0.5413176", "0.541046", "0.54049116", "0.54027563", "0.53998727", "0.53929704", "0.5392211" ]
0.61132395
4
recibo el id del evento
function email_evento_id($id){ $this->db->trans_start(); $query = $this->db->select('registrado_por') ->where('id_evento', $id) ->get('evento'); log_message('ERROR', 'llego a email_evento_id con id -->'.$id); if ($query->num_rows() > 0) { $row = $query->row(); $this->db->trans_complete(); $email = $this->email_evento($row->registrado_por); //llega el nombre de quien registra log_message('ERROR', 'se captura el correo -->'.$email); return $email; } else { $this->db->trans_complete(); return FALSE; } $this->db->trans_complete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdEvento()\n {\n return $this->id_evento;\n }", "public function getIdEvent(){\n\t\treturn $this->_idEvent;\n\t}", "public function getIdEvent(): int\r\n {\r\n return $this->idEvent;\r\n }", "public function getIdEvento()\n {\n return $this->IdEvento;\n }", "public function getEventID() {\n return \"dataevent-\".$this->getID();\n }", "function getEventID() \n {\n return $this->getValueByFieldName('event_id');\n }", "function obtenerIdEvento($entrada) {\n $evento = trim(filter_var($entrada, FILTER_SANITIZE_STRING));\n $con = crearConexion();\n\n $query = \"SELECT id FROM evento WHERE nombre = '$evento'\";\n $result = mysqli_query($con, $query);\n\n $row = mysqli_fetch_array($result);\n\n cerrarConexion($con);\n\n return $row['id'];\n}", "function getEventID() {\n\t\treturn $this->_EventID;\n\t}", "public function getIdCalendario(){\n return $this->idCalendario;\n }", "public function get_id();", "public function get_id();", "public function getID();", "public function getID();", "public function getID();", "function event_id() \n {\n $list = explode( ':', $this->rule->rule_key);\n if ( count( $list) == 4 && $list[2] == 'event') return $list[3];\n return NULL;\n }", "public function getIdEvento0()\n {\n return $this->hasOne(Evento::className(), ['idEvento' => 'idEvento']);\n }", "public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "public function getId() ;", "public function getIdDetalleEvento()\n {\n return $this->IdDetalleEvento;\n }", "function eventoni_get_events_by_id()\n{\n\t$event_ids = $_POST['event_ids'];\n\n\t// Aufsplitten des Strings in ein Array mit den Events\n\t$event_ids = explode('-',$event_ids);\n\n\t// Holen der Informationen zu den Events\n\t$data = eventoni_fetch('',true,$event_ids);\n\n\t// Rückgabe der Informationen zu den Events in XML\n\techo $data['xml'];\n\tdie();\n}", "abstract public function get_id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "function get_id()\r\n {\r\n return $this->id;\r\n }", "function get_id() {\n\t\treturn $this->id;\n\t}", "function get_id(){\n return $this -> id;\n }", "function get_id(){\n return $this -> id;\n }", "function get_id() {\n\t\treturn $this->id;\n\n\t}", "function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function obtenerId() {}", "function get_id()\n {\n return $this->id;\n }", "public function getid()\n {\n return $this->id;\n }", "public function getid()\n {\n return $this->id;\n }", "public function getid(){\n\t\t\treturn $this->id;\n\t\t}", "public function getId(){\n return $this->_data['id'];\n }", "public function setIdEvento($id_evento)\n {\n if (!empty($id_evento) && !is_null($id_evento))\n $this->id_evento = $id_evento;\n }", "public function getid(){\r\n return $this->_id;\r\n }", "public function get_id(){\n\t\treturn $this->id;\n\t}", "function getEventById()\n\t{\n\t\t//echo \" From ByID: \" . $this->_id;\n\t\t$eventId = 1;\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%d.%m.%Y')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%H:%i')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_end, '%H:%i')\");\n\t\t$query->select($db->nameQuote('t1.s_category'));\n\t\t$query->select($db->nameQuote('t1.s_place'));\n\t\t$query->select($db->nameQuote('t1.s_price'));\n\t\t$query->select($db->nameQuote('t1.idt_drivin_event'));\n\t\t$query->select($db->nameQuote('t1.n_num_part'));\n\t\t$query->select('t1.`n_num_part` - (SELECT COUNT(t2.`idt_drivin_event_apply`) ' .\n\t\t\t' FROM #__jevent_events_apply as t2 ' .\n\t\t\t' WHERE t2.`idt_drivin_event` = t1.`idt_drivin_event` AND t2.dt_cancel is null) as n_num_free');\n\t\t$query->from('#__jevent_events as t1');\n\t\t$query->where($db->nameQuote('idt_drivin_event') . '=' . $this->_id);\n\n\t\t$db->setQuery($query);\n\t\tif ($link = $db->loadRowList()) {\n\t\t}\n\t\t//echo \" From ByID: \" . count($link);\n\t\t//echo \" From ByID: \" . $query;\n\t\treturn $link;\n\t}", "function getId(){\n\n\t\t return $this->_id;\n\t}", "public function getid() {\n\t\treturn $this->id;\n\t}", "public function getId() { return $this->_id; }", "function getId();", "public function getId() {}", "public function getId() {}", "function get_id() {\n return $this->id;\n }", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();" ]
[ "0.7452529", "0.73604023", "0.7212178", "0.7211211", "0.6812034", "0.6687547", "0.64638865", "0.6409606", "0.6322491", "0.6268201", "0.6268201", "0.6256085", "0.6256085", "0.6256085", "0.6244425", "0.61870176", "0.6178031", "0.6174578", "0.61595553", "0.6117178", "0.6091651", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.60762084", "0.6065348", "0.60479635", "0.60479635", "0.60478014", "0.6047506", "0.6045901", "0.60452336", "0.60410935", "0.60410935", "0.60237473", "0.6021734", "0.6020353", "0.6018372", "0.6015555", "0.60127467", "0.60101765", "0.5999078", "0.59960896", "0.59910554", "0.5990861", "0.5990861", "0.59905446", "0.5989872", "0.5989872", "0.5989872", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294" ]
0.6038972
40
recibo el id del evento
function email_conferencia($id){ $this->db->trans_start(); $query = $this->db->select('email_user') //busco el email del user que registro el evento. ->where('id_evento', $id) ->get('evento'); log_message('ERROR', 'llego a email_conferencia con id -->'.$id); if ($query->num_rows() > 0) { $row = $query->row(); $this->db->trans_complete(); //$email = $this->email_evento($row->registrado_por); //llega el nombre de quien registra log_message('ERROR', 'email_conferencia envio link a correo -->'.$email); return $row->email_user; } else { $this->db->trans_complete(); log_message('ERROR', 'momv->email_conferencia eno encuentra correo '); return FALSE; } $this->db->trans_complete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdEvento()\n {\n return $this->id_evento;\n }", "public function getIdEvent(){\n\t\treturn $this->_idEvent;\n\t}", "public function getIdEvent(): int\r\n {\r\n return $this->idEvent;\r\n }", "public function getIdEvento()\n {\n return $this->IdEvento;\n }", "public function getEventID() {\n return \"dataevent-\".$this->getID();\n }", "function getEventID() \n {\n return $this->getValueByFieldName('event_id');\n }", "function obtenerIdEvento($entrada) {\n $evento = trim(filter_var($entrada, FILTER_SANITIZE_STRING));\n $con = crearConexion();\n\n $query = \"SELECT id FROM evento WHERE nombre = '$evento'\";\n $result = mysqli_query($con, $query);\n\n $row = mysqli_fetch_array($result);\n\n cerrarConexion($con);\n\n return $row['id'];\n}", "function getEventID() {\n\t\treturn $this->_EventID;\n\t}", "public function getIdCalendario(){\n return $this->idCalendario;\n }", "public function get_id();", "public function get_id();", "public function getID();", "public function getID();", "public function getID();", "function event_id() \n {\n $list = explode( ':', $this->rule->rule_key);\n if ( count( $list) == 4 && $list[2] == 'event') return $list[3];\n return NULL;\n }", "public function getIdEvento0()\n {\n return $this->hasOne(Evento::className(), ['idEvento' => 'idEvento']);\n }", "public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "public function getId() ;", "public function getIdDetalleEvento()\n {\n return $this->IdDetalleEvento;\n }", "function eventoni_get_events_by_id()\n{\n\t$event_ids = $_POST['event_ids'];\n\n\t// Aufsplitten des Strings in ein Array mit den Events\n\t$event_ids = explode('-',$event_ids);\n\n\t// Holen der Informationen zu den Events\n\t$data = eventoni_fetch('',true,$event_ids);\n\n\t// Rückgabe der Informationen zu den Events in XML\n\techo $data['xml'];\n\tdie();\n}", "abstract public function get_id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "function get_id()\r\n {\r\n return $this->id;\r\n }", "function get_id() {\n\t\treturn $this->id;\n\t}", "function get_id(){\n return $this -> id;\n }", "function get_id(){\n return $this -> id;\n }", "function get_id() {\n\t\treturn $this->id;\n\n\t}", "function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function obtenerId() {}", "function get_id()\n {\n return $this->id;\n }", "public function getid()\n {\n return $this->id;\n }", "public function getid()\n {\n return $this->id;\n }", "function email_evento_id($id){\r\n $this->db->trans_start();\r\n\r\n $query = $this->db->select('registrado_por')\r\n ->where('id_evento', $id)\r\n ->get('evento');\r\n \r\n log_message('ERROR', 'llego a email_evento_id con id -->'.$id);\r\n \r\n if ($query->num_rows() > 0) \r\n {\r\n $row = $query->row(); \r\n $this->db->trans_complete(); \r\n \r\n $email = $this->email_evento($row->registrado_por); //llega el nombre de quien registra\r\n log_message('ERROR', 'se captura el correo -->'.$email);\r\n \r\n return $email;\r\n } \r\n else \r\n {\r\n $this->db->trans_complete();\r\n return FALSE;\r\n }\r\n\r\n $this->db->trans_complete();\r\n }", "public function getid(){\n\t\t\treturn $this->id;\n\t\t}", "public function getId(){\n return $this->_data['id'];\n }", "public function setIdEvento($id_evento)\n {\n if (!empty($id_evento) && !is_null($id_evento))\n $this->id_evento = $id_evento;\n }", "public function getid(){\r\n return $this->_id;\r\n }", "public function get_id(){\n\t\treturn $this->id;\n\t}", "function getEventById()\n\t{\n\t\t//echo \" From ByID: \" . $this->_id;\n\t\t$eventId = 1;\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%d.%m.%Y')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%H:%i')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_end, '%H:%i')\");\n\t\t$query->select($db->nameQuote('t1.s_category'));\n\t\t$query->select($db->nameQuote('t1.s_place'));\n\t\t$query->select($db->nameQuote('t1.s_price'));\n\t\t$query->select($db->nameQuote('t1.idt_drivin_event'));\n\t\t$query->select($db->nameQuote('t1.n_num_part'));\n\t\t$query->select('t1.`n_num_part` - (SELECT COUNT(t2.`idt_drivin_event_apply`) ' .\n\t\t\t' FROM #__jevent_events_apply as t2 ' .\n\t\t\t' WHERE t2.`idt_drivin_event` = t1.`idt_drivin_event` AND t2.dt_cancel is null) as n_num_free');\n\t\t$query->from('#__jevent_events as t1');\n\t\t$query->where($db->nameQuote('idt_drivin_event') . '=' . $this->_id);\n\n\t\t$db->setQuery($query);\n\t\tif ($link = $db->loadRowList()) {\n\t\t}\n\t\t//echo \" From ByID: \" . count($link);\n\t\t//echo \" From ByID: \" . $query;\n\t\treturn $link;\n\t}", "function getId(){\n\n\t\t return $this->_id;\n\t}", "public function getid() {\n\t\treturn $this->id;\n\t}", "public function getId() { return $this->_id; }", "function getId();", "public function getId() {}", "public function getId() {}", "function get_id() {\n return $this->id;\n }", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();" ]
[ "0.7452529", "0.73604023", "0.7212178", "0.7211211", "0.6812034", "0.6687547", "0.64638865", "0.6409606", "0.6322491", "0.6268201", "0.6268201", "0.6256085", "0.6256085", "0.6256085", "0.6244425", "0.61870176", "0.6178031", "0.6174578", "0.61595553", "0.6117178", "0.6091651", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.6077937", "0.60762084", "0.6065348", "0.60479635", "0.60479635", "0.60478014", "0.6047506", "0.6045901", "0.60452336", "0.60410935", "0.60410935", "0.6038972", "0.60237473", "0.6021734", "0.6020353", "0.6018372", "0.6015555", "0.60127467", "0.60101765", "0.5999078", "0.59960896", "0.59910554", "0.5990861", "0.5990861", "0.59905446", "0.5989872", "0.5989872", "0.5989872", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294", "0.5982294" ]
0.0
-1
Return BD conection from Registry or create new one
public static function get($connectionAlias = self::MCO_DB) { if (!Registry::get($connectionAlias)) { try { $instance = new self($connectionAlias); } catch (\PDOException $e) { die('Connection failed: ' . $e->getMessage()); } return $instance; } return Registry::get($connectionAlias); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function establish_connection() {\n\t \t\tself::$db = Registry()->db = SqlFactory::factory(Config()->DSN);\n\t \t\tself::$has_update_blob = method_exists(self::$db, 'UpdateBlob');\n\t\t\treturn self::$db;\n\t\t}", "function getBd(){\n $cnx = connexion();\n return $cnx;\n}", "public static function getDBO() {\n\t\t/*\n\t\t * Check for the required DB configuration parameters\n\t\t */\n\t\tif(!defined('ETH_CONF_DB_HOST')) {\n\t\t\tthrow new Exception('ETH_CONF_DB_HOST configuration not set');\n\t\t}\n\t\tif(!defined('ETH_CONF_DB_USERNAME')) {\n\t\t\tthrow new Exception('ETH_CONF_DB_USERNAME configuration not set');\n\t\t}\n\t\tif(!defined('ETH_CONF_DB_PASSWORD')) {\n\t\t\tthrow new Exception('ETH_CONF_DB_PASSWORD configuration not set');\n\t\t}\n\t\tif(!defined('ETH_CONF_DB_DBNAME')) {\n\t\t\tthrow new Exception('ETH_CONF_DB_DBNAME configuration not set');\n\t\t}\n\n\t\t$db = new mysqli(ETH_CONF_DB_HOST, ETH_CONF_DB_USERNAME,\n\t\t\t\tETH_CONF_DB_PASSWORD, ETH_CONF_DB_DBNAME);\n\t\t\t\t\n\t\tif($db->connect_error){\n\t\t\tthrow new Exception(\n\t\t\t\t\tsprintf('DB Connect Error %d: %s',\n\t\t\t\t\t\t\t$db->connect_errno, $db->connect_error));\n\t\t}\n\n\t\tself::$db = $db;\n\t\treturn self::$db;\n\t}", "public function getConnect()\n {\n $this->conn = Registry::get('db');\n }", "public function getConnection()\n {\n $this->connection = db($this->connectionName);\n\n return $this->connection;\n }", "public function _get_db_connection() {\n if (!$this->connection) {\n $target = $key = '';\n $parts = explode(':', $this->get_id());\n // One of the predefined databases (set in settings.php)\n if ($parts[0] == 'db') {\n $key = empty($parts[1]) ? 'default' : $parts[1];\n $target = empty($parts[2]) ? 'default' : $parts[2];\n }\n // Another db url.\n else {\n // If the url is specified build it into a connection info array.\n if (!empty($this->dest_url)) {\n $info = array(\n 'driver' => empty($this->dest_url['scheme']) ? NULL : $this->dest_url['scheme'],\n 'host' => empty($this->dest_url['host']) ? NULL : $this->dest_url['host'],\n 'port' => empty($this->dest_url['port']) ? NULL : $this->dest_url['port'],\n 'username' => empty($this->dest_url['user']) ? NULL : $this->dest_url['user'],\n 'password' => empty($this->dest_url['pass']) ? NULL : $this->dest_url['pass'],\n 'database' => empty($this->dest_url['path']) ? NULL : $this->dest_url['path'],\n );\n $key = uniqid('backup_migrate_tmp_');\n $target = 'default';\n Database::addConnectionInfo($key, $target, $info);\n }\n // No database selected. Assume the default.\n else {\n $key = $target = 'default';\n }\n }\n if ($target && $key) {\n $this->connection = Database::getConnection($target, $key);\n }\n }\n return $this->connection;\n }", "public function getDbConnection()\n {\n $this->conn = Registry::get('db');\n }", "protected function db()\n\t\t{\n\t\t\tif( !$this->_db ) {\n\t\t\t\t$this->_db = \\Kalibri::db()->getConnection( $this->connectName );\n\t\t\t}\n\n\t\t\treturn $this->_db;\n\t\t}", "public static function getDefaultConnection(){\n return self::get_dba('default');\n\t}", "public static function getUniqueInstance(){\r\n if(self::$UniqueInstance == null){\r\n return new connectionBD();\r\n }else{\r\n return self::$UniqueInstance;\r\n }\r\n }", "static function get_dbase($dbname){\n //\n //Test if there are databases already created so as to check if the requested \n //database is among them \n if(\\count(sql::$dbase)>0){\n //\n //Check if we have a ready dbase\n foreach (sql::$dbase as $key=>$value){\n //\n //\n if ($dbname===$key){\n //\n //We do, return it. \n return sql::$dbase[$dbname];\n }\n } \n }\n //\n //\n //create the database from first principle ie from the information schema \n sql::$dbase[$dbname] = new \\database($dbname);\n //\n //popilate the database with the entites\n sql::$dbase[$dbname]->export_structure();\n //\n //Set the dbase\n return sql::$dbase[$dbname];\n }", "function create_db_connection($host, $user, $password, $dbname, $new_connection = FALSE, $persistency = FALSE)\n{\n\tglobal $phpraid_config;\n\t\n\t// If you are using PHP 4 and need to be instanciating objects by reference, uncomment the second \"$connection\" string below and\n\t// comment the first one.\n\t$connection = new sql_db($host , $user, $password, $dbname, $new_connection, $persistency);\t\t\n\t//$connection = &new sql_db($host, $user, $password, $dbname, $new_connection, $persistency);\t\t\n\t\n\treturn $connection;\n}", "public function createConnection()\n {\n $client = DatabaseDriver::create($this->getConfig());\n\n return $client;\n }", "public function getConnection() {\n\t\t$db = Config::get('librarydirectory::database.default');\n return static::resolveConnection($db);\n }", "function startDBConnection() {\n $connectionObject = new DatabaseFactory();\n return $connectionObject->getConnection();\n}", "public function getConnection(): \\codename\\core\\database\r\n {\r\n return $this->db;\r\n }", "private function dbConnect(){\n $database=new \\Database();\n return $database->getConnection();\n }", "protected function getDatabase()\r\n\t{\r\n\t\tif (!$this->registry->has('database'))\r\n\t\t{\r\n\t\t\tif (!$this->config->app->has('database'))\r\n\t\t\t{\r\n\t\t\t\tthrow new \\Exception('Failed to find config for database connection');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$connData = new \\System\\Core\\Database\\ConnectionData();\r\n\t\t\t$connData->username = $this->config->app->database->username;\r\n\t\t\t$connData->password = $this->config->app->database->password;\r\n\t\t\t$connData->database = $this->config->app->database->name;\r\n\t\t\t\r\n\t\t\t$this->registry->database = new Database($connData);\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->registry->database;\r\n\t}", "private function getDB() {\n if ($this->link === false) {\n $connection = $this->connect($this->config[\"host\"], $this->config[\"user\"], $this->config[\"pass\"], $this->config[\"name\"], $this->config[\"port\"]);\n if ($this->isMysqli($connection) AND $connection->errno === 0) {\n $connection->query(\"SET CHARACTER SET \" . $this->config[\"charset\"] . \";\");\n $this->link = $connection;\n }\n }\n\n return $this->link;\n }", "static function getDB()\n\t{\n\t\tif( self::$cached_db !== NULL )\n\t\t\treturn self::$cached_db;\n\t\ttry {\n\t\t\t// Regular direct access to existing database:\n\t\t\tself::$cached_db = new \\it\\icosaedro\\sql\\mysql\\Driver(array(\"localhost\", \"root\", \"\", \"icodb\"));\n\t\t}\n\t\tcatch(SQLException $e){\n\t\t\t// Try again checking and possibly creating the database:\n\t\t\tself::$cached_db = DBManagement::checkAll();\n\t\t}\n\t\treturn self::$cached_db;\n\t}", "public static function conn()\n {\n return (static::inst())::$_db;\n }", "function dbConectionf () {\r\n $conexion = null; // Se inicializa variable a nul\r\n\r\n try {\r\n $conexion = new PDO(\"firebird:dbname=localhost:C:\\\\Program Files\\\\Firebird\\\\Firebird_2_5\\\\extintores_del_norte\\\\SERGIOBRAVOGAS.fdb\", \"SYSDBA\", \"masterkey\");\r\n }\r\n catch(PDOException $e){\r\n echo \"Failed to get DB handle: \" . $e->getMessage();\r\n exit; \r\n }\r\n return $conexion;\r\n }", "public function db () : Connection {\n return Manager::connection($this->connection());\n }", "function getConnection($db,$custom);", "public static function get_dba($dba_id='default') {\n\t if (isset(self::$_dba_pool[$dba_id])) {\n return self::$_dba_pool[$dba_id];\n\t }\n\t \n $key = isset(Doggy_Config::$vars['app.dba.'.$dba_id])? 'app.dba.'.$dba_id: 'app.dba.default';\n $dsn = Doggy_Config::get($key);\n if (empty($dsn)) {\n throw new Doggy_Dba_Exception(\"factroy dba failed,unknown dba_id < $dba_id >\");\n }\n \n $driver = false !== ($i = strpos($dsn, ':')) ? substr($dsn, 0, $i) : $dsn;\n $class = Doggy_Util_Inflector::doggyClassify('Doggy_Dba_Adapter_'.$driver);\n if(!class_exists($class) ){\n throw new Doggy_Dba_Exception('factroy dba failed.<unknow database adpater:'.$driver);\n }\n return self::$_dba_pool[$dba_id] = new $class($dsn);\n\t}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "public static function get($db_type='')\n {\n if ($db_type == \"master\")\n {\n static $mdb = null;\n if ( $mdb == null )\n $mdb = new DBConnection($db_type);\n return $mdb;\n }\n else\n {\n static $sdb = null;\n if ( $sdb == null )\n $sdb = new DBConnection($db_type);\n return $sdb;\n }\n\n }", "protected static function getDatabaseConnection() {}", "protected static function getDatabaseConnection() {}", "protected static function getDatabaseConnection() {}", "public static function getInstancia() {\n\t\tif (empty(self::$instancia)) {\n\t\t\tself::$instancia = new BD();\n\t\t}\n\t\n\t\treturn self::$instancia;\n\t}", "function selectConexion($database){\n \n return $conexion = conexionlocal();\n \n \n }", "protected static function getConn() {\n return self::Conectar();\n }", "function &atkGetDb($conn='default', $reset=false, $mode=\"r\")\n{\n\tatkimport(\"atk.db.atkdb\");\n\t$db = &atkDb::getInstance($conn, $reset, $mode);\n\treturn $db;\n}", "function connexionDb()\n{\n $confDb = getConfigFile()['DATABASE'];\n\n\n $type = $confDb['type'];\n $host = $confDb['host'];\n $servername = \"$type:host=$host\";\n $username = $confDb['username'];\n $password = $confDb['password'];\n $dbname = $confDb['dbname'];\n\n $db = new PDO(\"$servername;dbname=$dbname\", $username, $password);\n return $db;\n}", "function get_gdb_resource()\n {\n\treturn DatabaseManager::getInstance();\n }", "static function getConnect()\r\n {\r\n /**\r\n * VERIFICA SE A VARIAVEL ESTATICA QUE SEGURA A CONEXAO ESTA NULA, CASO\r\n * NAO SEJA NULA, ISSO EQUIVALE À UMA VARIAVEL QUE JA POSSUI UM OBJETO COM\r\n * CONEXAO COM O BANCO\r\n */\r\n if (self::$con == null) {\r\n /**\r\n * FAZ INSTANCIA DA CLASSE DATABASE\r\n */\r\n $data = new Database();\r\n /**\r\n * CHAMA O METODO QUE ATRIBUI À VARIAVEL ESTATICA UM OBJETO DE\r\n * CONEXAO COM O BANCO\r\n */\r\n $data->connect();\r\n }\r\n\r\n /**\r\n * RETORNA O OBJETO DE CONEXAO COM O BANCO\r\n */\r\n return self::$con;\r\n }", "public static function getConnection(){\n return static::$db;\n }", "public function db()\n {\n return $this->getConnection();\n }", "function getDBConnection() {\n\t\n\t\tglobal $dbh;\n\n\t\tif(!$dbh) {\n\t\t\t$dbh = mysqli_connect(\"localhost\", \"sa\", \"sa\", \"travelexperts\");\n\t\t\tif(!$dbh) {\n\t\t\t\tprint(\"Connection failed: \" . mysqli_connect_errno($dbh) . \"--\" . mysqli_connect_error($dbh) . \"<br/>\");\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\t//db connection exists, do not need to create again.\n\t\t}\n\t\t\n\t}", "public function getConnection(){\n \n \n $this->db_conn = OCILogon($this->username, $this->password,$this->db_name); \n \n return $this->db_conn;\n }", "public static function obtenerint(){\n if (self::$db === null){\n \tself::$db = new self();\n }\n return self::$db;\n }", "public function getDb();", "protected function getConnection()\n\t{\n\t\treturn $this->createDefaultDBConnection(TEST_DB_PDO(), TEST_GET_DB_INFO()->ldb_name);\n\t}", "public static function getConnection() {\n if (!self::$db) {\n //new connection object\n new dbConn();\n }\n //return connection\n return self::$db;\n }", "function get_database() {\n $db = new Database();\n return ($db->connect());\n}", "public static function getMysqlConnexion(){\n\t\ttry{\n\t\t\t\n\t\t\t$db = new \\PDO('mysql:host=' . \\Library\\Application::appConfig()->getConst(\"BDD_HOST\")\n\t\t\t\t\t\t\t. ';dbname=' . \\Library\\Application::appConfig()->getConst(\"BDD_NAME\"). ''\n\t\t\t\t\t\t\t, \\Library\\Application::appConfig()->getConst(\"BDD_USER\")\n\t\t\t\t\t\t\t, \\Library\\Application::appConfig()->getConst(\"BDD_PASSWORD\"));\n\t\t\t\n\t\t\t$db->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t} catch(\\Exception $e) {\n\t\t\tif (\\Library\\Application::appConfig()->getConst(\"LOG\"))\n\t\t\t\tthrow new \\RuntimeException(\"Error ID: \" . \\Library\\Application::logger()->log(\"Error\", \"Page\", \"Error on BDD connection\", __FILE__, __LINE__));\n\t\t\telse\n\t\t\t\tthrow new \\RuntimeException(\"Error on BDD connection\");\n\t\t\texit();\n\t\t}\n\t\treturn $db;\n\t}", "protected function getConnection()\n {\n return $this->createDefaultDBConnection($this->createPdo(), static::NAME);\n }", "private function connection()\n {\n return Database::connection($this->connectionName);\n }", "function comicjet_db() {\n\treturn new Redis_DB();\n}", "public function getDb(int $key = 0) : ?DboInterface\n {\n return $this->getDbFactory()->getConnection($key);\n }", "public static function getConnection() {\r\n //Guarantees single instance, if no connection object exists then create one.\r\n if (!self::$db) {\r\n //new connection object.\r\n new dbConn();\r\n }\r\n //return connection.\r\n return self::$db;\r\n }", "public static function crearConexion(){\n if(!isset( self::$conexion)){\n\n //Si no esta creada pasamos a crearla\n self::$conexion = mysqli_connect(\"localhost\",\"root\", \"\", \"productos\");\n\n // Chequea la coneccion\n if (!self::$conexion) {\n die(\"La conexion fallo: \" . mysqli_connect_error());\n }\n }\n\n return self::$conexion;\n }", "public static function getInstance(){\n if(empty(static::$default_database))\n static::initDB();\n \n return static::$default_database;\n }", "public function getDbalConnection();", "protected static function resolve_connection() {\n global $DB;\n\n switch ($DB->get_dbfamily()) {\n case 'mysql':\n return new mysql_connection($DB);\n default:\n throw new \\Exception('Unsupported database family: ' . $DB->get_dbfamily());\n }\n }", "private function __construct()\n \n {\n $config = Config::getConfig(); // set singleton config object\n $host = $this->host = Config::getKeys('host');\n $user = $this->username = Config::getKeys('username');\n $password = $this->password = Config::getKeys('password');\n $database = $this->db = Config::getKeys('db');\n $this->newConnection($host, $user, $password, $database);\n // return $dbid; //dbid to the registrey\n \n }", "static function getDbConnection() {\n\n if (empty(static::$db)) {\n $pdo = Service::get('pdo');\n static::$db = new \\PDO($pdo['dns'], $pdo['user'], $pdo['password']);\n }\n return static::$db;\n }", "function blightDB()\n{\n\tstatic $db;\n\tif (!isset($db))\n\t{\n\t\tif (false === ($db = gdo_db_instance('localhost', BLIGHT_USER, BLIGHT_PASS, BLIGHT_DB)))\n\t\t{\n\t\t\tdie('Cannot connect to db!');\n\t\t}\n\t\t$db->setVerbose(false);\n\t\t$db->setLogging(false);\n\t\t$db->setDieOnError(false);\n\t\t$db->setEMailOnError(false);\n\t}\n\treturn $db;\n}", "function iniciaBD() {\n try {\n $db = new PDO(DB_INFO, DB_USER, DB_PASS);\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n echo(\"Erro BD: \" . $e->getMessage() . \"\\n\");\n echo(\"Código Erro BD: \" . $e->getCode() . \"\\n\");\n }\n return $db;\n}", "public function updraftplus_get_database_handle() {\n\t\treturn $this->dbh;\n\t}", "public static function getConnection()\n {\n if (!isset(self::$_primary))\n {\n self::$_primary = self::_getConnection('primary');\n }\n\n return self::$_primary;\n }", "static public function getDatabaseObject()\n {\n if (getenv(\"OPENSHIFT_MYSQL_DB_HOST\") === false) {\n $_host = \"localhost\";\n $_username = \"root\";\n $_password = \"mantis5c\";\n $_database = \"startbwtracker\";\n } else {\n $_host = getenv(\"OPENSHIFT_MYSQL_DB_HOST\");\n $_username = getenv(\"OPENSHIFT_MYSQL_DB_USERNAME\");\n $_password = getenv(\"OPENSHIFT_MYSQL_DB_PASSWORD\");\n $_database = \"startbwtracker\";\n }\n\n $db = new \\PDO(\n \"mysql:host=$_host;dbname=$_database;\", $_username, $_password\n );\n // set the PDO error mode to exception\n $db->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n return $db;\n }", "function getDefaultConnection()\n{\n\tglobal $cman;\n\treturn $cman->getDefault();\n}", "public function conn(): DB\n {\n return new DB();\n }", "protected function getDbal_ConnService()\n {\n return $this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this);\n }" ]
[ "0.69283664", "0.63503814", "0.6309286", "0.6282236", "0.624002", "0.6196657", "0.6185039", "0.61784035", "0.61752325", "0.6171665", "0.61546844", "0.6138624", "0.6124105", "0.6121127", "0.61151725", "0.61047834", "0.60743976", "0.60412705", "0.60393983", "0.6033679", "0.602619", "0.6020142", "0.5988622", "0.59846485", "0.5972202", "0.59716046", "0.59716046", "0.59716046", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5970219", "0.5969747", "0.5969747", "0.59688807", "0.59688807", "0.59688807", "0.59688807", "0.59688807", "0.59688807", "0.59688807", "0.59688807", "0.59688807", "0.59688807", "0.59688807", "0.59688807", "0.59559315", "0.59484875", "0.5947721", "0.5947721", "0.59465295", "0.5942756", "0.5938026", "0.59375733", "0.59355116", "0.59340966", "0.5932774", "0.5921955", "0.5920778", "0.5919089", "0.5915954", "0.59068334", "0.59053004", "0.5873171", "0.5855242", "0.585107", "0.5845463", "0.58372766", "0.582898", "0.5821907", "0.5808611", "0.5801879", "0.57914245", "0.57889247", "0.57627153", "0.57606703", "0.5760343", "0.5759802", "0.5758654", "0.5756528", "0.5748879", "0.5748005", "0.5747056", "0.57455", "0.5740732", "0.5739243" ]
0.0
-1
Rolls back a transaction
public function rollBack() { if ($done = $this->_pdo->rollBack()) { $this->hasActiveTransaction = false; } return $done; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rollBackTransaction()\r\n\t{\r\n\t\t$this->query(\"ROLLBACK TRANSACTION\");\r\n\t}", "public static function RollBackTrans() {\n try {\n if(DB::transactionLevel() > 0) {\n DB::rollBack();\n }\n }\n catch(Exception $e) {\n }\n }", "function RollbackTrans() {}", "public function rollBack()\n {\n if ($this->transactionCount < 1) {\n return;\n }\n $transaction = $this->unprepared(\"ROLLBACK;\");\n if (false !== $transaction) {\n $this->transactionCount--;\n }\n }", "private function rollBack()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->rollBack();\n\t\t}\n\t}", "public function rollbackTransaction();", "public function rollbackTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('ROLLBACK TRANSACTION');\r\n\t}", "public function rollBack()\n {\n if ($this->store->transactions == 1) {\n $this->store->transactions = 0;\n\n $this->store->rollBack();\n } else {\n --$this->transactions;\n }\n }", "function RollBackTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->rollBack();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}", "public function rollback()\n {\n if (self::$_transactionLevel == 1) {\n $this->getConnection()->rollBack();\n }\n \n if (self::$_transactionLevel > 0) {\n self::$_transactionLevel--;\n }\n }", "public function rollback();", "public function rollback();", "public function rollback();", "public function rollback();", "public function rollBack()\n {\n if ($this->transactions == 1) {\n $this->transactions = 0;\n\n $this->getPdo()->rollBack();\n } else {\n $this->transactions--;\n }\n }", "protected function rollBackTransaction()\n {\n $this->container->make('db')->rollBack();\n }", "protected function rollback() {\n $this->objDbConn->rollBack();\n }", "public function rollback() {\n\t\t$this->execute(\"ROLLBACK; SET autocommit = 1;\");\n\t}", "public function rollbackTransaction()\n {\n mysqli_query($this->databaseLink,\"ROLLBACK;\");\n }", "public function rollback()\n{\n\t$this->query('ROLLBACK');\n}", "public function rollBack()\r\n {\r\n if ($this->_txns == 1) {\r\n $this->getMaster()->rollBack();\r\n $this->_txns = 0;\r\n } else {\r\n --$this->_txns;\r\n }\r\n }", "function rollback(){\n\t\ttry {\n\t\t\t$this->dbconn->rollBack();\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function rollback() {\n parent::rollback();\n $this->activeTransaction = false;\n }", "public function rollBack()\n {\n if ($this->hasActiveTransaction) {\n parent::rollback();\n $this->hasActiveTransaction = false;\n }\n }", "public function rollBack()\n\t{\n\t\t$this->c->rollBack();\n\t}", "public function rollBack() {\r\n\r\n mysql_query(\"ROLLBACK\");\r\n mysql_query(\"SET AUTOCOMMIT=1\");\r\n\r\n }", "public abstract function rollback();", "public function rollbackTransaction() {\n\t\t//noop\n\t}", "public function transactionRollback()\n\t{\n\t\treturn;\n\t}", "function rollback();", "public static function rollbackTransaction()\n\t{\n\t\tif (self::$currentTransaction !== null)\n\t\t{\n\t\t\tself::$currentTransaction->rollback();\n\t\t\tself::$currentTransaction = null;\n\t\t}\n\t}", "public function transactionRollback()\n {\n self::$_transactionActive = false;\n return $this->_db->rollBack();\n }", "public function rollback()\n\t{\n\t}", "public function rollback()\n\t{\n\t}", "public function rollbackTransaction(): void;", "public function rollBack()\n {\n if ($this->transactionLevel === 0)\n {\n throw new DatabaseException('transaction-nothing-to-roll-back');\n }\n \n --$this->transactionLevel;\n \n if ($this->transactionLevel === 0)\n {\n if (!$this->pdo->rollBack())\n {\n throw new DatabaseException('transaction-rollback');\n }\n }\n else\n {\n // Rollback to savepoint.\n $this->pdo->exec('ROLLBACK TO SAVEPOINT LEVEL' . $this->transactionLevel);\n }\n }", "function rollback(): void;", "public function rollBack();", "public function rollBack(){\r\n $this->db->rollBack();\r\n }", "public function rollback()\n {\n }", "public function rollback()\n {\n }", "public function rollback(){\n $this->db->exec('ROLLBACK TO xyz;');\n }", "function rollback() {\n\t\t\tself::$db->rollback();\n\t\t}", "public function rolltrans(){\n\t\t$this->query(\"ROLLBACK\");\n\t\treturn $this->transaction;\n\t}", "protected function rollback()\n\t{\n\t\t$this->db->rollback();\n\t}", "public function rollback() {\r\n\t\t\tif($this->mysqli) {\r\n\t\t\t\treturn $this->db->rollback();\r\n\t\t\t} else {\r\n\t\t\t\t//no transaction support in mysql module...\n\t\t\t\tmysql_query('ROLLBACK;', $db);\r\n\t\t\t}\n\t\t\t$this->stopTransaction(); \r\n\t\t}", "public function rollBack()\n {\n $this->getActivePdo()->rollBack();\n }", "function roll_back()\n\t{\n\t\t//return $this->db->rollBack();\n\t}", "protected static function rollbackTransaction()\n\t{\n\t\tAbstractUnit::rollbackTransaction();\n\t}", "public function rollBack() {\n\t\ttry {\n\t\t\treturn $this->getPdo()->rollBack();\n\t\t} catch (\\PDOException $e) {\n\t\t\t$this->logError($e->getMessage());\n\t\t\tthrow new TransactionException($e->getMessage());\n\t\t}\n\t}", "abstract protected function doRollback();", "public function testTransactionRollback()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function rollback($id);", "function trans_rollback()\r\n\t{\r\n\t\treturn $this->db->trans_rollback();\r\n\t}", "public static function rollBackTransaction($stmt){\n self::getPdoCon()->rollBack();\n }", "public function transactionRollback($toSavepoint = false)\n\t{\n\t\t$this->connect();\n\n\t\tif (!$toSavepoint || $this->transactionDepth <= 1)\n\t\t{\n\t\t\tparent::transactionRollback($toSavepoint);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$savepoint = 'SP_' . ($this->transactionDepth - 1);\n\t\t\t$this->setQuery('ROLLBACK TO ' . $this->quoteName($savepoint));\n\n\t\t\tif ($this->execute())\n\t\t\t{\n\t\t\t\t$this->transactionDepth--;\n\t\t\t}\n\t\t}\n\t}", "public function rollback() {\n if ($this->tx_active) {\n $this->x('ROLLBACK');\n $this->tx_active = false;\n } else {\n throw new GDBException(\"can't commit, no active transaction\");\n }\n }", "public static function rollback($savepoint = NULL)\n\t{\n\t\tself::getConnection()->rollback($savepoint);\n\t}", "public function rollback() {\n //rolling back and storing the response\n $rollback = $this->mysqli->rollback();\n\n //setting autocommit to on again\n $this->mysqli->autocommit(true);\n\n //now returning the rollback result\n return $rollback;\n }", "public function handleTransactionRollback(TransactionRolledBack $event)\n {\n Log::debug('rollback');\n }", "public function transactionRollback($toSavepoint = false)\n {\n $this->connect();\n\n if (!$toSavepoint || $this->transactionDepth == 1) {\n $this->connection->rollBack();\n }\n\n $this->transactionDepth--;\n }", "public function rollback() {\n\t\tif ($this->transaction_counter == 0) {\n\t\t\t// transaction has not begun\n\t\t\t$this->error('Rollback called without active transaction.');\n\t\t}\n\n\t\tif ($this->debug_enabled) {\n\t\t\t$this->debug_log['transactions']['rollback'] = array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS),0,4);\n\t\t}\n\n\t\t// clear counter and make rollback, any error in embedded transaction must cancel operation\n\t\t$this->transaction_counter = 0;\n\n\t\tif ($this->adapter) {\n\t\t\tif (!$this->adapter->rollBack()) {\n\t\t\t\t$this->error('Failed to rollback a transaction');\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function rollBack()\n {\n unset($this->messages[$this->lastMessageId]);\n }", "function db_rollback($dbh) {\ndb_query(\"ROLLBACK;\",$dbh,\"\",\"\",\"\",\"Rolling back transaction\");\ndb_query(\"SET autocommit=1;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 1\");\n}", "public static function rollBack() {\n\t\treturn self::getConexao()->rollBack();\n\t}", "public function rollback()\n {\n // my code\n $by = 'id';\n $order = 'desc';\n $eventMessages = CEventMessage::GetList($by, $order, ['TYPE' => self::EVENT_TYPE]);\n $eventMessage = new CEventMessage;\n while ($template = $eventMessages->Fetch()) {\n $eventMessage->Delete((int)$template['ID']);\n }\n CEventType::Delete(self::EVENT_TYPE);\n }", "public function rollBack(): void\n {\n try {\n $this->getConnection()->rollBack();\n } catch (DbalConnectionException $e) {\n throw new Exception('Rollback failed', 0, $e);\n }\n }", "public function rollBack($toLevel = null)\n {\n if ($this->transactions == 1) {\n $this->transactions = 0;\n\n $this->transaction->rollBack();\n } else {\n $this->transactions--;\n }\n\n $this->fireConnectionEvent('rollingBack');\n }", "public function rollback() {\n if (!$this->changed())\n return;\n\n $this->tags = array('new' => array(), 'del' => array());\n $this->inited = false;\n }", "public function rollBack() {\r\n $this->checkConn();\r\n return $this->conn->rollBack();\r\n }", "abstract protected function doRollback($savepoint = null);", "public function cancelTransaction() {\n return $this->conn->rollBack();\n }", "public function RollbackTransaction()\r\n\t{\r\n\t\tif ($this->IsConnected())\r\n\t\t{\r\n\t\t\tif (!$this->_db->real_query(\"ROLLBACK\"))\r\n\t\t\t{\r\n\t\t\t\tthrow new Exception(\"There was an error rolling back the database transaction<p>: \" . $this->GetLastError() . \"</p>\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new Exception(\"There was an error rolling back the database transaction: Database not connected\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function rollback(): void\n {\n $ret = $this->mysqli->rollback();\n if (!$ret) $this->mySqlError('mysqli::rollback');\n }", "public function rollBack()\n {\n return $this->conn->rollBack();\n }", "public function rollBack()\n{\n\treturn db2_rollback($this->dbh) && (($this->transaction = FALSE) || TRUE);\n}", "protected function _rollback() {\n $this->dataSource->rollback($this);\n }", "public function rollBack()\n {\n return $this->connection->rollBack();\n }", "public function rollBack()\n {\n return $this->pdo->rollBack();\n }", "public function TransactionRollback()\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\tif( !$this->IsConnected() )\r\n\t\t{\r\n\t\t\t$this->SetError( 'No connection' );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif( !mysql_query( 'ROLLBACK', $this->db_link ) )\r\n\t\t\t{\r\n\t\t\t\t$this->SetError( 'Could not rollback transaction' );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$this->in_transaction = false;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function rollBack()\n {\n if ($this->transactionNestingLevel === 0) {\n throw ConnectionException::noActiveTransaction();\n }\n\n $connection = $this->getWrappedConnection();\n\n $logger = $this->_config->getSQLLogger();\n\n if ($this->transactionNestingLevel === 1) {\n if ($logger !== null) {\n $logger->startQuery('\"ROLLBACK\"');\n }\n\n $this->transactionNestingLevel = 0;\n $connection->rollBack();\n $this->isRollbackOnly = false;\n if ($logger !== null) {\n $logger->stopQuery();\n }\n\n if ($this->autoCommit === false) {\n $this->beginTransaction();\n }\n } elseif ($this->nestTransactionsWithSavepoints) {\n if ($logger !== null) {\n $logger->startQuery('\"ROLLBACK TO SAVEPOINT\"');\n }\n\n $this->rollbackSavepoint($this->_getNestedTransactionSavePointName());\n --$this->transactionNestingLevel;\n if ($logger !== null) {\n $logger->stopQuery();\n }\n } else {\n $this->isRollbackOnly = true;\n --$this->transactionNestingLevel;\n }\n\n $eventManager = $this->getEventManager();\n\n if ($eventManager->hasListeners(Events::onTransactionRollBack)) {\n Deprecation::trigger(\n 'doctrine/dbal',\n 'https://github.com/doctrine/dbal/issues/5784',\n 'Subscribing to %s events is deprecated.',\n Events::onTransactionRollBack,\n );\n\n $eventManager->dispatchEvent(Events::onTransactionRollBack, new TransactionRollBackEventArgs($this));\n }\n\n return true;\n }", "public function rollBack() {\n return self::$PDOInstance->rollBack();\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function rollBack(): bool\n {\n --$this->currentTransactionLevel;\n if ($this->currentTransactionLevel == 0) {\n return parent::rollBack();\n }\n $this->exec(\"ROLLBACK TO SAVEPOINT LEVEL\" . $this->currentTransactionLevel);\n return true;\n }", "public function rollback()\n\t{\n\t\tif ( $this->active_transactions == 0 ) {\n\t\t\tthrow new \\RuntimeException('Rollback failed, no active transaction.');\n\t\t}\n\n\t\t$this->active_transactions -= 1;\n\n\t\tif ( $this->active_transactions == 0 ) {\n\t\t\treturn $this->pdo->rollback();\n\t\t}\n\t\telse {\n\t\t\t$this->pdo->exec(sprintf('ROLLBACK TO SAVEPOINT T%d', $this->active_transactions));\n\t\t\treturn true;\n\t\t}\n\t}", "public function rollback()\n\t{\n\t\t$this->commit_stack = 0;\n\t\t$this->query('ROLLBACK');\n\t\treturn true;\n\t}", "protected function rollbackToSavePoint(): void\n {\n foreach ($this->getActiveConnections() as $connection) {\n try {\n while ($connection->isTransactionActive()) {\n $connection->rollBack();\n }\n } catch (\\Exception $e) {\n }\n }\n }", "public function refundTransaction() {\n //not implemented\n }", "public function rollback()\n\t{\n\t\tforeach($this->subformArr as $key => $sf) $sf->rollback();\n\t}", "function cancel_transaction()\n{\n\tglobal $transaction_level;\n\n\tif ($transaction_level) {\n\t\tdb_query(\"ROLLBACK\", \"could not cancel a transaction\");\t\n\t}\n}", "#[ReturnTypeWillChange]\n\tpublic function rollBack ()\n\t{\n\t\t$this->exec('ROLLBACK TRANSACTION');\n\t\treturn true;\n\t}", "function ibase_rollback($link_or_trans_identifier = null): void\n{\n error_clear_last();\n if ($link_or_trans_identifier !== null) {\n $safeResult = \\ibase_rollback($link_or_trans_identifier);\n } else {\n $safeResult = \\ibase_rollback();\n }\n if ($safeResult === false) {\n throw IbaseException::createFromPhpError();\n }\n}", "public function rollback(){\n return $this->forge->table('users')->ifExists()->drop();\n }", "private function rollback() {\n\t\tEE::warning( 'Exiting gracefully after rolling back. This may take some time.' );\n\t\tif ( $this->level > 0 ) {\n\t\t\t$this->delete_site();\n\t\t}\n\t\tEE::success( 'Rollback complete. Exiting now.' );\n\t\texit;\n\t}", "public function rolback($id)\n {\n try {\n $this->_affRespository->rolback($id);\n return redirect()->route('admin.affs.trash.list')->with('success', 'You have successfully rolback!');\n } catch (Exception $e) {\n throw $e;\n }\n //\n }", "public function rollBack()\n {\n try {\n $this->connection->rollBack();;\n } catch (\\Exception $e) {\n throw $this->connection->reconnectIfNeeded($e);\n }\n }", "public function rollback()\n\t{\n\t\t// Make sure the database is connected\n\t\t$this->_connection or $this->connect();\n\n\t\treturn (bool) $this->_connection->query('ROLLBACK');\n\t}", "protected function doRollback( $fname ) {\n\t\tif ( $this->mTrxLevel ) {\n\t\t\t$this->query( 'ROLLBACK', $fname, true );\n\t\t\t$this->mTrxLevel = 0;\n\t\t}\n\t}" ]
[ "0.8359945", "0.82521224", "0.822535", "0.8192503", "0.8168962", "0.81255066", "0.8080264", "0.8074395", "0.8073392", "0.8073023", "0.80342495", "0.80342495", "0.80342495", "0.80342495", "0.80146915", "0.8003288", "0.78538", "0.7832819", "0.7825087", "0.78167", "0.7797866", "0.7752096", "0.773196", "0.7726393", "0.76874185", "0.7662226", "0.76560587", "0.76460505", "0.76238865", "0.7616289", "0.760813", "0.75881284", "0.75835365", "0.75835365", "0.7579859", "0.757802", "0.75662714", "0.7560006", "0.75317043", "0.7509217", "0.7509217", "0.74621415", "0.74513763", "0.7439903", "0.7393556", "0.73841876", "0.7348529", "0.7330315", "0.7223849", "0.72064364", "0.71657926", "0.70791996", "0.7062624", "0.7035526", "0.6960079", "0.69598097", "0.6955736", "0.69473296", "0.6941968", "0.6930192", "0.6921005", "0.6918278", "0.68730277", "0.68669236", "0.6804936", "0.67637485", "0.67595094", "0.67523533", "0.6727621", "0.6725637", "0.67229587", "0.670865", "0.6704338", "0.6687137", "0.6684193", "0.6679315", "0.6665012", "0.66519654", "0.6651634", "0.66462934", "0.66396296", "0.66194385", "0.6591304", "0.6591304", "0.6591304", "0.6591304", "0.65613794", "0.6558774", "0.65466833", "0.6544084", "0.6510155", "0.6460995", "0.64106005", "0.63876057", "0.6365924", "0.63620675", "0.6329072", "0.63247126", "0.63138324", "0.6308949", "0.62949586" ]
0.0
-1
This filter is documented in wpincludes/defaultwidgets.php
public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? esc_html__( 'Categories','noo-landmark' ) : $instance['title'], $instance, $this->id_base ); $c = ! empty( $instance['count'] ) ? '1' : '0'; $h = ! empty( $instance['hierarchical'] ) ? '1' : '0'; $p = ! empty( $instance['parent'] ) ? 0 : ''; echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } $cat_args = array('orderby' => 'name', 'show_count' => $c, 'parent' => $p, 'hierarchical' => $h); ?> <ul> <?php $cat_args['title_li'] = ''; /** * Filter the arguments for the Categories widget. * * @since 2.8.0 * * @param array $cat_args An array of Categories widget options. */ wp_list_categories( apply_filters( 'widget_noo_categories_args', $cat_args ) ); ?> </ul> <?php echo $args['after_widget']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hocwp_theme_custom_widgets_init() {\r\n\r\n}", "function wp_widget_control($sidebar_args)\n {\n }", "function wp_list_widgets()\n {\n }", "public function off_canvas_applied_filters() {\n\t\t\tthe_widget( 'WC_Widget_Layered_Nav_Filters' );\n\t\t}", "function itstar_widget() {\n register_widget( 'last_video_widget' );\n register_widget( 'last_posts_by_cat_widget' );\n register_widget( 'simple_button_widget' );\n}", "function itstar_widget() {\n// register_widget( 'last_products_widget' );\n// register_widget( 'last_projects_widget' );\n register_widget( 'last_posts_by_cat_widget' );\n register_widget( 'contact_info_widget' );\n// register_widget( 'social_widget' );\n}", "function genesisawesome_custom_widgets() {\n\n\t/* Unregister Header Right widget area */\n\tunregister_sidebar( 'header-right' );\n\n\t/* Register Custom Widgets */\n\tregister_widget( 'GA_Facebook_Likebox_Widget' );\n\tregister_widget( 'GA_Flickr_Widget' );\n\n}", "protected function get_widgets()\n {\n }", "function wp_list_widget_controls($sidebar, $sidebar_name = '')\n {\n }", "function __construct(){\n add_filter( 'widget_wrangler_find_all_page_widgets', array( $this, 'ww_find_taxonomy_term_widgets' ) );\n }", "function wp_get_widget_defaults()\n {\n }", "function unregister_default_widgets() {\n\t\\add_action( 'widgets_init', 'WPS\\_unregister_default_widgets' );\n}", "function dentalimplants_extra_widgets() {\t\n\tgenesis_register_sidebar( array(\n\t'id' => 'search',\n\t'name' => __( 'Search', 'dentalimplants-infini-pro' ),\n\t'description' => __( 'This is the Search toggle area', 'dentalimplants-infini-pro' ),\n\t'before_widget' => '<div class=\"search\">',\n\t'after_widget' => '</div>',\n\t) );\n}", "function wpwl_load_widget() {\n register_widget( 'wpwl_widget' );\n}", "function wpb_widgets_init()\n{\n\n register_sidebar(array(\n 'name' => 'Custom Header Widget Area',\n 'id' => 'custom-header-widget',\n 'before_widget' => '<div class=\"chw-widget\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"chw-title\">',\n 'after_title' => '</h2>',\n ));\n}", "function wp_maybe_load_widgets()\n {\n }", "function wp_widgets_add_menu()\n {\n }", "function mythemepost_widgets(){ \n register_sidebar( array(\n 'name' => 'Lavel Up New Widget Area',\n 'id' => 'level_up_new_widget_area',\n 'before_widget' => '<aside>',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n \n ));\n}", "public function default_filters() {\n\t\tadd_filter( 'upload_mimes', array( $this, 'more_mimes' ) );\n\n\t\t// Live update when add new layouts (also their sidebars)\n\t\t// or add new positions into existed layouts\n\t\tadd_filter( 'kopa_get_option_layout_manager', array( $this, 'live_update_layout_manager' ), 10, 2 );\n\n\t\t/**\n\t\t * Disable help tab by default, determine its content later\n\t\t *\n\t\t * @see admin/class-kopa-admin.php\n\t\t * @since 1.0.0\n\t\t */\n\t\tadd_filter( 'kopa_enable_admin_help_tab', '__return_false' );\n\t}", "function gigx_dashboard_widget_function(){\n ?>\n <p>Enjoy your new website. If you've got any questions or encounter any bugs, please contact me at <a href=\"mailto:[email protected]\">[email protected]</a>.\n I will add a list of useful links and tutorials below, as well as any messages about updates.<br/><a href=\"http://axwax.de\" target=\"_blank\">Axel</a></p> \n <?php wp_widget_rss_output('http://www.axwax.de/category/support/history/feed/', array('items' => 5, 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1));\n}", "function add_widget_specific_settings() {\n\t\treturn false;\n\t}", "function wpb_load_widget()\n{\n register_widget('wpb_widget');\n}", "function wp_use_widgets_block_editor()\n {\n }", "function themes_name_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Copyright', 'themes_name' ),\n\t\t'id' => 'copyright',\n\t\t'container' \t\t=> false,\n\t\t'before_widget' => '',\n\t\t'after_widget' => ''\n\t) );\n}", "function tw_blog_widget() {\n parent::__construct(false, $name = 'Wunder Blog Widget');\n }", "public function _register_widgets()\n {\n }", "function avhamazon_widgets_init ()\n{\n\tregister_widget( 'WP_Widget_AVHAmazon_Wishlist' );\n}", "function fr_s_Blog_Widget() {\n\t\t$widget_ops = array( 'classname' => 'fr_s_blog_widget', 'description' => __('Sidebar or Footer widget that displays your latest posts with a thumbnail and a short excerpt.', 'twok') );\n\t\t$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'fr_s_blog_widget' );\n\t\tparent::__construct( 'fr_s_blog_widget', __('TWOK - Recent Posts Widget (Sidebar)', 'twok'), $widget_ops, $control_ops );\n}", "function retrieve_widgets($theme_changed = \\false)\n {\n }", "function custom_dashboard_widgets() {\n\twp_add_dashboard_widget('rss_dashboard_widget', __('Recently on Themble (Customize on admin.php)', 'tabula_rasa'), 'rss_dashboard_widget');\n\t// Be sure to drop any other created Dashboard Widgets in this function and they will all load.\n}", "function ssl_widget() {\r\n $widget_ops = array('classname' => 'ssl_widget', 'description' => __('widget that display a slideshow from all attachments','ssl-plugin') ); \r\n $this->WP_Widget('ssl_widget', __('Siteshow Widget','ssl-plugin'), $widget_ops);\r\n }", "function _preview_theme_template_filter()\n {\n }", "function wpb_load_widget() {\n register_widget( 'recent_post_widget' );\n }", "function theme_widgets_init() {\n\n register_sidebar( array(\n 'name' => 'Home Page Widget Area',\n 'description' => 'Widgets are full-width and appear below the title and above the shows list.',\n 'before_widget' => '<div class=\"row\"><div class=\"large-12 columns widget panel\">',\n 'after_widget' => '</div></div>',\n 'before_title' => '<h3>',\n 'after_title' => '</h3>',\n ) );\n\n // register_sidebar( array(\n // 'name' => 'Sidebar Widget Area',\n // 'description' => 'Sidebar widgets appear on episode pages',\n // 'before_widget' => '<div class=\"widget panel\">',\n // 'after_widget' => '</div>',\n // 'before_title' => '<h3>',\n // 'after_title' => '</h3>',\n // ) );\n\n}", "function ourWidgetsInit(){\n\n register_sidebar(array(\n 'name' => 'Sidebar',\n 'id' => 'sidebar1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"my-special-class\">',\n 'after_title' => '</h4>'\n\n ));\n}", "public function get_available_widgets()\n {\n }", "function bones_custom_dashboard_widgets() {\n\twp_add_dashboard_widget('bones_rss_dashboard_widget', 'Recientemente en Themble (Personalizar en admin.php)', 'bones_rss_dashboard_widget');\n\t/*\n\tAsegurate de incluir cualquier otro widget del Dashboard creado\n\ten esta función y todos serán cargados.\n\t*/\n}", "function bp_widgets_init() {\n // register_sidebar( array(\n // 'name' => __( 'Footer Widget Area', 'holstein' ),\n // 'id' => 'footer-widget',\n // 'description' => __( 'Appears on the bottom of every page.', 'holstein' ),\n // 'before_widget' => '<div class=\"col\">',\n // 'after_widget' => '</div>',\n // 'before_title' => '<h2>',\n // 'after_title' => '</h2>'\n // ) );\n\n register_sidebar( array(\n 'name' => __( 'Right Sidebar Widget Area', 'bp' ),\n 'id' => 'right-sidebar',\n 'description' => __( 'Appears on the right side of the blog index.', 'bp' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>'\n ) );\n\n // register_sidebar( array(\n // 'name' => __( 'Left Sidebar Widget Area', 'holstein' ),\n // 'id' => 'left-sidebar',\n // 'description' => __( 'Appears on the left side of pages', 'holstein' ),\n // 'before_widget' => '<div id=\"%1$s\" class=\"area %2$s\">',\n // 'after_widget' => '</div>',\n // 'before_title' => '<h3>',\n // 'after_title' => '</h3>'\n // ) ); \n}", "function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}", "function bp_media_register_widgets() {\n\tadd_action('widgets_init', create_function('', 'return register_widget(\"BP_Media_Widget\");') );\n}", "function pb18_article_also_widget() {\n register_widget( 'pb18_article_also_widget' );\n}", "protected function retrieve_widgets()\n {\n }", "protected function retrieve_widgets()\n {\n }", "function zanblog_widgets_init() {\r\n register_sidebar(array(\r\n 'name' => '幻灯片',\r\n 'before_widget' => '<figure class=\"slide hidden-xs\">',\r\n 'after_widget' => '</figure>'\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '搜索框',\r\n 'before_widget' => '<div class=\"search visible-lg\">',\r\n 'after_widget' => '</div>'\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '最热文章',\r\n 'before_widget' => '',\r\n 'after_widget' => ''\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '最新评论',\r\n 'before_widget' => '',\r\n 'after_widget' => ''\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '最新文章',\r\n 'before_widget' => '',\r\n 'after_widget' => ''\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '分类、标签、友链',\r\n 'before_widget' => '',\r\n 'after_widget' => ''\r\n ));\r\n}", "function wp_render_widget_control($id)\n {\n }", "public function testOnlyThemeWidgetFilter() {\n $this->drupalGet('/listjs-theme-test');\n $page = $this->getSession()->getPage();\n\n /* --- Start: Check whether theme widget filter is working --- */\n $page->fillField('mykittens-are-unique-filter', 'sin');\n\n $this->assertCount(1, $page->findAll('css', '.mykittens li'));\n $this->assertEquals($page->find('css', '.mykittens li .value_name-house')->getText(), \"Singh's\");\n /* --- End: Check whether theme widget filter is working --- */\n\n // Check whether views widget is not affected.\n $this->assertCount(count($this->contents), $page->findAll('css', '#listjs_test_views_block-block_1-wrapper li'));\n }", "function FoodByNight_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer Right',\n\t\t'id' => 'footer_right',\n\t\t'before_widget' => '<ul class=\"list-inline\">',\n\t\t'after_widget' => '</ul>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Social_Link_Widget' );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Popups',\n\t\t'id' => 'popups',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Contact_Popup_Widget' );\n\n}", "function registerWidgets( ) {\r\n\t\t\twp_register_sidebar_widget( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetOutput' ) );\r\n\t\t\twp_register_widget_control( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetControlOutput' ) );\r\n\t\t}", "function gymfitness_widgets(){\n register_sidebar( array(\n 'name'=>'Sidebar 1',\n 'id' => 'sidebar_1',\n 'before-widget' => '<div class=\"widget\">', \n 'after-widget' => '</div>', \n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n\n\n ));\n register_sidebar( array(\n 'name'=>'Sidebar 2',\n 'id' => 'sidebar_2',\n 'before-widget' => '<div class=\"widget\">', \n 'after-widget' => '</div>', \n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n\n\n ));\n}", "function custom_unregister_default_widgets() {\n\n unregister_widget( 'WP_Widget_Archives' );\n unregister_widget( 'WP_Widget_Calendar' );\n unregister_widget( 'WP_Widget_Categories' );\n unregister_widget( 'WP_Widget_Meta' );\n unregister_widget( 'WP_Widget_Pages' );\n unregister_widget( 'WP_Widget_Recent_Comments' );\n unregister_widget( 'WP_Widget_Recent_Posts' );\n unregister_widget( 'WP_Widget_RSS' );\n unregister_widget( 'WP_Widget_Search' );\n unregister_widget( 'WP_Nav_Menu_Widget' );\n unregister_widget( 'WP_Widget_Tag_Cloud' );\n unregister_widget( 'Akismet_Widget' );\n\n}", "function custom_widgets_register() {\n register_post_type('custom_widgets', array(\n 'labels' => array(\n 'name' => __('Custom Widgets'),\n 'singular_name' => __('Custom Widget'),\n ),\n 'public' => false,\n 'show_ui' => true,\n 'has_archive' => false,\n 'exclude_from_search' => true,\n ));\n}", "function whichet_load_widget() {\n\tregister_widget( 'WHICHet_widget' );\n\tadd_action( 'wp_enqueue_script', 'WHICHet_scripts' );\n}", "function YWR_2020_widgets_init()\n{\n register_sidebar(array(\n 'name' => __('General Page Sidebar', 'YWR_2020'),\n 'id' => 'sidebar-1',\n 'description' => __('Add widgets here to appear in your sidebar on standard pages.', 'YWR_2020'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget clearfix %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"fancy-title title-bottom-border\"><h2>',\n 'after_title' => '</h2></div>',\n ));\n\n}", "function add_widget_Support() {\n register_sidebar( array(\n 'name' => 'Sidebar',\n 'id' => 'sidebar',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ) );\n}", "function acf_disable_filters()\n{\n}", "function gp_get_default_widget_params() {\n return array(\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n //'before_title' => '<div class=\"decoration\"></div><h1 class=\"widget-title\">',\n 'before_title' => '<h1 class=\"widget-title\">',\n 'after_title' => '</h1>'\n );\n}", "function widget_wrap()\n{\n\tregister_widget('ag_pag_familie_w');\n\tregister_widget('ag_social_widget_container');\n\tregister_widget('ag_agenda_widget');\n}", "function wpzh_load_widget() {\n register_widget( 'sliderHTML2' ); \n}", "function as_standard_widgets() {\n//\n\tglobal $sequoia_woo_is_active;\n\t$icons = apply_filters( 'sequoia_options', 'default_widget_icons', true );\n\t\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> __( 'Sidebar', 'sequoia' ),\n\t\t'id'\t\t\t=> 'sidebar',\n\t\t'description'\t=> 'default Wordpress widget area - for blog, pages and archives sidebar',\n\t\t'before_widget'\t=> '<aside class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></aside>',\n\t\t'before_title'\t=> '<h4 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t'after_title'\t=> '</h4>',\n\t) );\n//\n//\t\n//\tIF WOOCOMMERCE PLUGIN IS ACTIVATED, TURN ON THESE WIDGET AREAS:\n\tif( $sequoia_woo_is_active ) {\n\t\n\t\tregister_sidebar( array(\n\t\t\t'name'\t\t\t=> __( 'Shop sidebar', 'sequoia' ),\n\t\t\t'id'\t\t\t=> 'sidebar-shop',\n\t\t\t'description'\t=> 'for usage with sidebar on WooCommerce shop pages - catalog, single product, cart, checkout, account ...',\n\t\t\t'before_widget' => '<aside class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></aside>',\n\t\t\t'before_title'\t=> '<h4 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t\t'after_title'\t=> '</h4>',\n\t\t) );\n\t//\n\t//\t\n\t\tregister_sidebar( array(\n\t\t\t'name'\t\t\t=> __( 'Products page filter widgets', 'sequoia' ),\n\t\t\t'id'\t\t\t=> 'product-filters-widgets',\n\t\t\t'description' => 'special widgets area, only visible in products catalog (archives) page, created for usage with products filters.',\n\t\t\t'before_widget'\t=> '<aside class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></aside>',\n\t\t\t'before_title'\t=> '<h4 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t\t'after_title'\t=> '</h4>',\n\t\t) );\n\t//\t\n\t//\t\n\t\tregister_sidebar( array(\n\t\t\t'name'\t\t\t=> __( 'Filter reset widget', 'sequoia' ),\n\t\t\t'id'\t\t\t=> 'layered-nav-filter-widgets',\n\t\t\t'description' => 'for usage with \"WooCommerce Layered Nav Filters\" widget ONLY - if Layered Nav is used, place here the \"WooCommerce Layered Nav Filters\" widget to remove filters',\n\t\t\t'before_widget'\t=> '<aside class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></aside>',\n\t\t\t'before_title'\t=> '<h4 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t\t'after_title'\t=> '</h4>',\n\t\t) );\n\n\t}\t\n//\n//\t\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> __( 'Header widgets', 'sequoia' ),\n\t\t'id'\t\t\t=> 'sidebar-header',\n\t\t'description'\t=> 'to be used in side menu or header menu - remember to set header widget block in Theme options.',\n\t\t'before_widget'\t=> '<aside class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></aside>',\n\t\t'before_title'\t=> '<h4 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t'after_title'\t=> '</h4>',\n\t) );\n//\n//\t\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> __( 'Header widgets 2', 'sequoia' ),\n\t\t'id'\t\t\t=> 'sidebar-header-2',\n\t\t'description'\t=> 'to be used in side menu or header menu - remember to set header widget block in Theme options.',\n\t\t'before_widget'\t=> '<aside class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></aside>',\n\t\t'before_title'\t=> '<h4 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t'after_title'\t=> '</h4>',\n\t) );\n//\n//\t\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> __( 'Header widgets 3', 'sequoia' ),\n\t\t'id'\t\t\t=> 'sidebar-header-3',\n\t\t'description'\t=> 'to be used in side menu or header menu - remember to set header widget block in Theme options.',\n\t\t'before_widget'\t=> '<aside class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></aside>',\n\t\t'before_title'\t=> '<h4 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t'after_title'\t=> '</h4>',\n\t) );\n//\n//\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> __( 'Footer widgets 1', 'sequoia' ),\n\t\t'id'\t\t\t=> 'footer-widgets-1',\n\t\t'description'\t=> 'widget area for usage in site footer.',\n\t\t'before_widget'\t=> '<section class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></section>',\n\t\t'before_title'\t=> '<h5 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t'after_title'\t=> '</h5>',\n\t) );\n//\n//\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> __( 'Footer widgets 2', 'sequoia' ),\n\t\t'id'\t\t\t=> 'footer-widgets-2',\n\t\t'description'\t=> 'widget area for usage in site footer.',\n\t\t'before_widget'\t=> '<section class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></section>',\n\t\t'before_title'\t=> '<h5 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t'after_title'\t=> '</h5>',\n\t) );\n//\n//\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> __( 'Footer widgets 3', 'sequoia' ),\n\t\t'id'\t\t\t=> 'footer-widgets-3',\n\t\t'description'\t=> 'widget area for usage in site footer.',\n\t\t'before_widget'\t=> '<section class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></section>',\n\t\t'before_title'\t=> '<h5 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t'after_title'\t=> '</h5>',\n\t) );\n//\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> __( 'Footer widgets 4', 'sequoia' ),\n\t\t'id'\t\t\t=> 'footer-widgets-4',\n\t\t'description'\t=> 'widget area for usage in site footer.',\n\t\t'before_widget'\t=> '<section class=\"widget %2$s\" id=\"%1$s\"><div class=\"widget-wrap\">',\n\t\t'after_widget'\t=> '</div><div class=\"clearfix\"></div></section>',\n\t\t'before_title'\t=> '<h5 class=\"widget-title'. ($icons ? '' : ' no-icon') .'\">',\n\t\t'after_title'\t=> '</h5>',\n\t) );\n//\t\t\n}", "function widget_my_widgets_init() {\r\n\tif ( !function_exists('register_sidebar_widget') )\r\n\t\treturn;\r\n\r\n\tfunction widget_my_widget_get_html( $pname, $loop_counter ) {\r\n\t\t$options = get_option('widget_my_widgets');\r\n\t\t$display_description = $options['widget_my_widgets_display_description'];\r\n\t\t$display_version = $options['widget_my_widgets_display_version'];\r\n\t\t$display_update = $options['widget_my_widgets_display_update'];\r\n\r\n\t\t$filedata = false;\r\n\t\t$workstr = 'http://wordpress.org/extend/plugins/profile/' . $pname . '/page/' . $loop_counter;\r\n\t\t$filedata = @file_get_contents( $workstr );\r\n\t\t$_output = '';\r\n\t\t$_ismore = false;\r\n\r\n\t\tif( $filedata ) {\r\n\t\t\t$w_datas = array();\r\n\t\t\t$spos = strpos( $filedata, '<div class=\"plugin-block\">' );\r\n\t\t\tdo {\r\n\t\t\t\tif( $spos !== false ) {\r\n\t\t\t\t\t$one_widget = array();\r\n\t\t\t\t\t$filedata = substr( $filedata, $spos );\r\n\r\n\t\t\t\t\t$spos = strpos( $filedata, '</h3>' );\r\n\t\t\t\t\t$workstr = substr( $filedata, 0, $spos );\r\n\t\t\t\t\t$retv = strip_tags( $workstr );\r\n\t\t\t\t\t$one_widget[ 'title' ] = $retv;\r\n\t\t\t\t\t$workstr = substr( $workstr, strpos( $workstr, '<h3>' ) );\r\n\t\t\t\t\t$workstr = substr( $workstr, strpos( $workstr, '\"' ) + 1 );\r\n\t\t\t\t\t$workstr = substr( $workstr, 0, strpos( $workstr, '\"' ) );\r\n\t\t\t\t\t$one_widget[ 'pgurl' ] = $workstr;\r\n\t\t\t\t\t$filedata = substr( $filedata, $spos );\r\n\r\n\t\t\t\t\t$spos = strpos( $filedata, '<ul class=\"plugin-meta\">' );\r\n\t\t\t\t\t$retv = strip_tags( substr( $filedata, 0, $spos ) );\r\n\t\t\t\t\t$one_widget[ 'desc' ] = $retv;\r\n\t\t\t\t\t$filedata = substr( $filedata, $spos );\r\n\r\n\t\t\t\t\t$spos = strpos( $filedata, '</li>' );\r\n\t\t\t\t\t$retv = strip_tags( substr( $filedata, 0, $spos ) );\r\n\t\t\t\t\t$retv = str_replace( \"Version \", \"\", $retv );\r\n\t\t\t\t\t$one_widget[ 'ver' ] = $retv;\r\n\t\t\t\t\t$filedata = substr( $filedata, $spos );\r\n\r\n\t\t\t\t\t$spos = strpos( $filedata, '</li>', 5 );\r\n\t\t\t\t\t$retv = strip_tags( substr( $filedata, 0, $spos ) );\r\n\t\t\t\t\t$retv = str_replace( \"Updated \", \"\", $retv ) ;\r\n\t\t\t\t\t$one_widget[ 'update' ] = $retv;\r\n\t\t\t\t\t$filedata = substr( $filedata, $spos );\r\n\r\n\t\t\t\t\t$spos = strpos( $filedata, '</li>', 5 );\r\n\t\t\t\t\t$retv = strip_tags( substr( $filedata, 0, $spos ) );\r\n\t\t\t\t\t$retv = str_replace( \"Downloads \", \"\", $retv ) ;\r\n\t\t\t\t\t$one_widget[ 'down' ] = $retv;\r\n\t\t\t\t\t$filedata = substr( $filedata, $spos );\r\n\r\n\t\t\t\t\t$w_datas[] = $one_widget;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} /* if else */\r\n\t\t\t\t$spos = strpos( $filedata, '<div class=\"plugin-block\">' );\r\n\t\t\t} while( $spos !== false );\r\n\r\n\t\t\t$_ismore = strpos( $filedata, \"<a class='next page-numbers'\" );\r\n\r\n\t\t\tfor( $i=0; $i<count($w_datas); $i++) {\r\n\t\t\t\t$workstr = $w_datas[$i][pgurl];\r\n\t\t\t\tif( $workstr && strlen( $workstr ) > 0 ) {\r\n\t\t\t\t\t$filedata = @file_get_contents( $workstr );\r\n\t\t\t\t\tif( $filedata ) {\r\n\t\t\t\t\t\t$spos = strpos( $filedata, '<div id=\"fyi\" class=\"block\">' );\r\n\t\t\t\t\t\t$filedata = substr( $filedata, $spos );\r\n\t\t\t\t\t\t$spos = strpos( $filedata, 'Author Homepage' );\r\n\t\t\t\t\t\t$filedata = substr( $filedata, $spos );\r\n\t\t\t\t\t\t$spos = strpos( $filedata, '<a href=' );\r\n\t\t\t\t\t\t$filedata = substr( $filedata, $spos );\r\n\t\t\t\t\t\t$filedata = substr( $filedata, 0, strpos( $filedata, '>' ) + 1 );\r\n\t\t\t\t\t\t$w_datas[$i]['plginpage_atag'] = $filedata;\r\n\t\t\t\t\t} /* if */\r\n\t\t\t\t} /* if */\r\n\t\t\t} /* for */\r\n\r\n\t\t\tforeach( $w_datas as $wdata ) {\r\n\t\t\t\t$_output .= '<li class=\"my_widget_title\" >' . $wdata[ 'plginpage_atag' ] . $wdata[ 'title' ] . '</a></li>';\r\n\r\n\t\t\t\tif( $display_description ) {\r\n\t\t\t\t\t$_output .= '<div class=\"my_widget_description\" style=\"margin-left: 10px; margin-right: 10px; text-align:left; text-align: justify; text-justify: auto; margin-bottom: 0.4em; font-size:7pt; color:#888;\">';\r\n\t\t\t\t\t$_output .= $wdata[ 'desc' ];\r\n\t\t\t\t\t$_output .= '</div>';\r\n\t\t\t\t} /* if */\r\n\r\n\t\t\t\tif( $display_version || $display_update ) {\r\n\t\t\t\t\t$_output .= '<div class=\"my_widget_version_date\" style=\"margin-left: 10px; margin-right: 10px; text-align:right; margin-bottom: 0.4em; font-size:7pt; color:#888;\">';\r\n\t\t\t\t\tif( $display_version ) { $_output .= 'ver' . $wdata[ 'ver' ] ; }\r\n\t\t\t\t\tif( $display_update ) { $_output .= ' ' . $wdata[ 'update' ]; }\r\n\t\t\t\t\t$_output .= '</div>';\r\n\t\t\t\t} /* if */\r\n\t\t\t} /* foreach */\r\n\t\t} /* if */\r\n\r\n\t\t$retv = array( 'the_html' => $_output, 'is_more_page' => $_ismore );\r\n\r\n\t\treturn( $retv );\r\n\t} /* widget_my_widget_get_html */\r\n\r\n\tfunction widget_my_widgets( $args ) {\r\n\t\textract($args);\r\n\r\n\t\t$options = get_option('widget_my_widgets');\r\n\t\t$title = $options['widget_my_widgets_title'];\r\n\t\t$wp_repository_pageid = $options['widget_my_widgets_repository_pageid'];\r\n\t\t$thecache = $options[ 'widget_my_widgets_cache' ];\r\n\t\t$cached_time = $options['widget_my_widgets_cached_time'];\r\n\r\n\t\t$output = '<div id=\"widget_my_widgets\"><ul>';\r\n\r\n\t\t// section main logic from here \r\n\t\t$wp_org_profile_name = $wp_repository_pageid;\r\n\t\t$page_loop_counter = 1;\r\n\t\t$cache_timeout = 60 * 60;\t// 60 sec x 60 min = 1 hour\r\n\r\n\t\tif( $cached_time + $cache_timeout < time() ) {\r\n\t\t\t$retv = '<div class= \"my_widget_section_title\" style=\"font-size:7pt; color:#888;text-align:center;\" >- released to repository -</div>';\r\n\r\n\t\t\tdo {\r\n\t\t\t\t$retData = widget_my_widget_get_html( $wp_org_profile_name, $page_loop_counter++ );\r\n\t\t\t\t$retv .= $retData[ 'the_html' ];\r\n\t\t\t} while( $retData[ 'is_more_page' ] );\r\n\r\n\t\t\t$options['widget_my_widgets_cached_time'] = time();\r\n\t\t\t$options[ 'widget_my_widgets_cache' ] = $retv . '<!-- cached -->';\r\n\t\t\tupdate_option('widget_my_widgets', $options);\r\n\t\t}else{\r\n\t\t\t$retv = $thecache;\r\n\t\t} /* if else */\r\n\r\n\t\t$output .= $retv;\r\n// --\r\n\r\n\r\n// if you want to add fixed entry, add here\r\n// section title looks like this\r\n// $output .= '<div class=\"my_widget_section_title\" style=\"margin-top:1em; font-size:7pt; color:#888;text-align:center;\" >- not on repository but released -</div>';\r\n//\r\n// first, put widget name\r\n// $output .= '<li class=\"my_widget_title\" ><a href=\"http://www.yourdomain.com/yourpage.html\">' . \"Your widget title here\" . '</a></li>';\r\n//\r\n// then description and version-date with optionable switch\r\n//\tif( $display_description ) {\r\n//\t\t$output .= '<div class=\"my_widget_description\" style=\"margin-left: 10px; margin-right: 10px; text-align:left; text-align: justify; text-justify: auto; margin-bottom: 0.4em; font-size:7pt; color:#888;\">';\r\n//\t\t$output .= 'description text here';\r\n//\t\t$output .= '</div>';\r\n//\t}\r\n//\r\n//\tif( $display_version || $display_update ) {\r\n//\t\t$output .= '<div class=\"my_widget_version_date\" style=\"margin-left: 10px; margin-right: 10px; text-align:right; margin-bottom: 0.4em; font-size:7pt; color:#888;\">';\r\n//\t\tif( $display_version ) { $output .= 'ver' . '0.0.0'; }\r\n//\t\tif( $display_update ) { $output .= ' ' . '2009-12-25'; }\r\n//\t\t$output .= '</div>';\r\n//\t}\r\n//\r\n// and so on.\r\n\r\n// --\r\n\t\t$output .= '<div style=\"text-align:left;\"></div>'; // this is dummy for IE\r\n\t\t// These lines generate the output\r\n\t\t$output .= '</ul></div>';\r\n\r\n\t\techo $before_widget . $before_title . $title . $after_title;\r\n\t\techo $output;\r\n\t\techo $after_widget;\r\n\t} /* widget_my_widgets() */\r\n\r\n\tfunction widget_my_widgets_control() {\r\n\t\t$options = $newoptions = get_option('widget_my_widgets');\r\n\t\tif ( $_POST[\"widget_my_widgets_submit\"] ) {\r\n\t\t\t$newoptions['widget_my_widgets_title'] = strip_tags(stripslashes($_POST[\"widget_my_widgets_title\"]));\r\n\t\t\t$newoptions['widget_my_widgets_repository_pageid'] = strip_tags(stripslashes($_POST[\"widget_my_widgets_repository_pageid\"]));\r\n\r\n\t\t\t$newoptions['widget_my_widgets_display_description'] = (boolean)$_POST[\"widget_my_widgets_display_description\"];\r\n\t\t\t$newoptions['widget_my_widgets_display_version'] = (boolean)$_POST[\"widget_my_widgets_display_version\"];\r\n\t\t\t$newoptions['widget_my_widgets_display_update'] = (boolean)$_POST[\"widget_my_widgets_display_update\"];\r\n\r\n\t\t\t$newoptions['widget_my_widgets_cached_time'] = 0;\r\n\t\t\t$newoptions['widget_my_widgets_cache'] = \"\";\r\n\t\t}\r\n\t\tif ( $options != $newoptions ) {\r\n\t\t\t$options = $newoptions;\r\n\t\t\tupdate_option('widget_my_widgets', $options);\r\n\t\t}\r\n\r\n\t\t// those are default value\r\n\r\n\t\t$title = htmlspecialchars($options['widget_my_widgets_title'], ENT_QUOTES);\r\n\t\t$wp_repository_pageid = $options['widget_my_widgets_repository_pageid'];\r\n\t\t$display_description = $options['widget_my_widgets_display_description'];\r\n\t\t$display_version = $options['widget_my_widgets_display_version'];\r\n\t\t$display_update = $options['widget_my_widgets_display_update'];\r\n\r\n?>\r\n\t <?php _e('Title:'); ?> <input style=\"width: 170px;\" id=\"widget_my_widgets_title\" name=\"widget_my_widgets_title\" type=\"text\" value=\"<?php echo $title; ?>\" /><br />\r\n\r\n\t <?php _e('PageID:'); ?> <input style=\"width: 170px;\" id=\"widget_my_widgets_repository_pageid\" name=\"widget_my_widgets_repository_pageid\" type=\"text\" value=\"<?php echo $wp_repository_pageid; ?>\" /><br /><div style=\"font-size:7pt; color: #888;text-align:center;\" >copy pageid from wordpress.org</div>\r\n\r\n <input id=\"widget_my_widgets_display_description\" name=\"widget_my_widgets_display_description\" type=\"checkbox\" value=\"1\" <?php if( $display_description ) echo 'checked';?>/> <?php _e('Description'); ?><br />\r\n <input id=\"widget_my_widgets_display_version\" name=\"widget_my_widgets_display_version\" type=\"checkbox\" value=\"1\" <?php if( $display_version ) echo 'checked';?>/> <?php _e('Version'); ?><br />\r\n <input id=\"widget_my_widgets_display_update\" name=\"widget_my_widgets_display_update\" type=\"checkbox\" value=\"1\" <?php if( $display_update ) echo 'checked';?>/> <?php _e('Date'); ?><br />\r\n\r\n \t <input type=\"hidden\" id=\"template_src_submit\" name=\"widget_my_widgets_submit\" value=\"1\" />\r\n<?php\r\n\t} /* widget_my_widgets_control() */\r\n\r\n\tregister_sidebar_widget('My Widgets', 'widget_my_widgets');\r\n\tregister_widget_control('My Widgets', 'widget_my_widgets_control' );\r\n}", "function urbanfitness_widgets()\n{\n //registering widget must write php code to show it\n register_sidebar([\n 'name' => 'Sidebar', //widget name on wordpress panel\n 'id' => 'sidebar', //we are passing this id to dynamic_widget('sidebar') must be unique for wordpress to identify\n 'before_widget' => '<div class=\"widget\">', //html before widget\n 'after_widget' => '</div>', //html after widget\n 'before_title' => '<h3 class=\"text-primary\">', //html before title\n 'after_title' => '</h3>', //html after title\n ]);\n}", "function recent_post_widget() {\r\n\tregister_widget( 'recent_posts' );\r\n}", "function mytheme_load_widget() {\n register_widget( 'mytheme_widget_text' );\n \n // Allow to execute shortcodes on mytheme_widget_text\n add_filter('mytheme_widget_text', 'do_shortcode');\n}", "public function custom_widgets() {\n\n\t\t// Define array of custom widgets for the theme\n\t\t$widgets = array(\n\t\t\t'social-fontawesome',\n\t\t\t'social',\n\t\t\t'simple-menu',\n\t\t\t'modern-menu',\n\t\t\t'flickr',\n\t\t\t'video',\n\t\t\t'posts-thumbnails',\n\t\t\t'posts-grid',\n\t\t\t'posts-icons',\n\t\t\t'comments-avatar',\n\t\t);\n\n\t\t// Apply filters so you can remove custom widgets via a child theme if wanted\n\t\t$widgets = apply_filters( 'wpex_custom_widgets', $widgets );\n\n\t\t// Loop through widgets and load their files\n\t\tforeach ( $widgets as $widget ) {\n\t\t\t$widget_file = WPEX_FRAMEWORK_DIR .'classes/widgets/'. $widget .'.php';\n\t\t\tif ( file_exists( $widget_file ) ) {\n\t\t\t\trequire_once( $widget_file );\n\t\t\t}\n\t\t}\n\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "function exclude_widget_categories($args){\r\n $exclude = \"1\";\r\n $args[\"exclude\"] = $exclude;\r\n return $args;\r\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function disable_all_widgets($sidebars_widgets) {\n //if (is_home())\n $sidebars_widgets = array(false);\n return $sidebars_widgets;\n}", "function aidtransparency_widgets_init() {\r\n\r\n $widgetDefaults = array(\r\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n 'after_widget' => \"</aside>\",\r\n 'before_title' => '<h3 class=\"widget-title\">',\r\n 'after_title' => '</h3>'\r\n );\r\n\r\n\r\n register_sidebar(\r\n array_merge(\r\n $widgetDefaults,\r\n array(\r\n 'name' => __( 'Home Page Sidebar', 'aidtransparency' ),\r\n 'id' => 'sidebar-3',\r\n 'description' => __( 'The Home Page widgetized area', 'aidtransparency')\r\n )\r\n )\r\n );\r\n\r\n register_sidebar(\r\n array_merge(\r\n $widgetDefaults,\r\n array(\r\n 'name' => __( 'Page Sidebar', 'aidtransparency' ),\r\n 'id' => 'sidebar-1',\r\n 'description' => __( 'The Sidebar widgetized area', 'aidtransparency')\r\n )\r\n )\r\n );\r\n\r\n register_sidebar(\r\n array_merge(\r\n $widgetDefaults,\r\n array(\r\n 'name' => __( 'Blog Sidebar', 'aidtransparency' ),\r\n 'id' => 'sidebar-2',\r\n 'description' => __( 'The Blog Sidebar widgetized area', 'aidtransparency')\r\n )\r\n )\r\n );\r\n\r\n register_sidebar(\r\n array_merge(\r\n $widgetDefaults,\r\n array(\r\n 'name' => __( 'Footer', 'aidtransparency' ),\r\n 'id' => 'footer-1',\r\n 'description' => __( 'The Footer widgetized area', 'aidtransparency' )\r\n )\r\n )\r\n );\r\n}", "function ourWidgetsInit(){\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Sidebar',\n\t\t\t'id' => 'sidebar1',\n\t\t\t'before_widget' => '<div class=\"widget-item\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h4 class=\"my-special-class\">',\n\t\t\t'after_title' => '</h4>'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 1',\n\t\t\t'id' => 'footer1'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 2',\n\t\t\t'id' => 'footer2'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 3',\n\t\t\t'id' => 'footer3'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 4',\n\t\t\t'id' => 'footer4'\n\t\t));\n\t}", "function twentyten_widgets_init() {\n\t// Area 1, located at the top of the sidebar.\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'pp' ),\n\t\t'id' => 'sidebar-principal',\n\t\t'description' => __( 'Arraste os itens desejados até aqui. ', 'pp' ),\n\t\t'before_widget' => '<div class=\"widget %2$s\" id=\"%1$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 style=\"display:none;\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}", "function boiler_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'boiler' ),\n\t\t'id' => 'sidebar-1',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n}", "function acf_disable_filter($name = '')\n{\n}", "function register_page_bpposts_widget() {\n\tadd_action('widgets_init', create_function('', 'return register_widget(\"BP_Paginated_Posts_Widget\");') );\n}", "function gymfitness_widgets(){\n\n register_sidebar(array(\n 'name' => 'Sidebar 1', \n 'id' => 'sidebar_1',\n 'before_widget' => '<div class=\"\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"widget-title\">',\n 'after_title' => '</h2>'\n ));\n register_sidebar(array(\n 'name' => 'Sidebar 2', \n 'id' => 'sidebar_2',\n 'before_widget' => '<div class=\"\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"widget-title\">',\n 'after_title' => '</h2>'\n ));\n\n}", "function render_block_core_legacy_widget($attributes)\n {\n }", "function theme_widgets_init() {\n\t // Area 1\n\t register_sidebar( array (\n\t 'name' => 'Primary Widget Area',\n\t 'id' => 'primary_widget_area',\n\t 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t 'after_widget' => \"</li>\",\n\t 'before_title' => '<h3 class=\"widget-title\">',\n\t 'after_title' => '</h3>',\n\t ) );\n\n\t // Area 2\n\t register_sidebar( array (\n\t 'name' => 'Secondary Widget Area',\n\t 'id' => 'secondary_widget_area',\n\t 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t 'after_widget' => \"</li>\",\n\t 'before_title' => '<h3 class=\"widget-title\">',\n\t 'after_title' => '</h3>',\n\t ) );\n\t}", "function theme_widgets_init() {\n\t // Area 1\n\t register_sidebar( array (\n\t 'name' => 'Primary Widget Area',\n\t 'id' => 'primary_widget_area',\n\t 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t 'after_widget' => \"</li>\",\n\t 'before_title' => '<h3 class=\"widget-title\">',\n\t 'after_title' => '</h3>',\n\t ) );\n\n\t // Area 2\n\t register_sidebar( array (\n\t 'name' => 'Secondary Widget Area',\n\t 'id' => 'secondary_widget_area',\n\t 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t 'after_widget' => \"</li>\",\n\t 'before_title' => '<h3 class=\"widget-title\">',\n\t 'after_title' => '</h3>',\n\t ) );\n\t}", "function darksnow_widgets_init() {\n\n\t\n\t\n\t\n}", "function wp_hooks() \n {\n // Wordpress actions & filters \n add_action( 'admin_menu', array(&$this,'admin_menu_link') );\n add_action( 'admin_head', array(&$this, 'remove_mediabuttons') );\n add_action( 'init', array(&$this, 'add_custom_post_type') );\n add_action( 'admin_init', array(&$this, 'add_metaboxes') );\n add_action( 'save_post', array(&$this, 'save_source_metabox'), 10, 2 );\n add_action( 'manage_posts_custom_column', array(&$this, 'add_custom_columns') ); // sets the row value\n \n $filter = 'manage_edit-' . $this->custom_post_type_name . '_columns';\n add_filter( $filter, array(&$this, 'add_header_columns') );\n add_filter( 'body_class', array(&$this, 'body_classes') );\n add_action('wp_print_styles', array(&$this, 'add_css') );\n\n add_filter( 'enter_title_here', array(&$this, 'change_title_text'), 10, 1 );\n add_filter( 'post_row_actions', array(&$this, 'remove_row_actions'), 10, 1 );\n add_filter( 'post_updated_messages', array(&$this, 'bbquotations_updated_messages') );\n\n add_action( 'admin_print_footer_scripts', array(&$this, 'remove_preview_button') );\n\n // add shortcode\n add_shortcode( 'bbquote', array(&$this, 'shortcode') );\n }", "function wpc_load_widget()\n{\n register_widget('expat_category_widget');\n}", "function harbour_city_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Footer Widgets', 'harbour-city' ),\n 'id' => 'widgets-footer',\n 'description' => __( 'Appears on the front page', 'harbour-city' ),\n 'before_widget' => '<li id=\"%1$s\" class=\"widget span4 %2$s\">',\n 'after_widget' => '</li>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n}", "function iiess_widgets(){\n register_sidebar(array(\n 'name' => 'Sidebar Eventos',\n 'id' => 'sidebar',\n 'before_widget' => '<div class=\"widget\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n ));\n}", "function widget_ara_randomposts_init() {\n if ( ! function_exists( 'register_sidebar_widget' ) || ! function_exists( 'register_widget_control' ) )\n return;\n\n // This prints the widget\n function widget_ara_randomposts( $args ) {\n extract( $args );\n $options = get_option( 'widget_ara_randomposts' );\n echo $before_widget;\n if ( $options['title'] )\n echo $before_title . $options['title'] . $after_title;\n echo ara_random_posts( $options );\n echo $after_widget;\n }\n\n // Tell Dynamic Sidebar about our new widget and its control\n register_sidebar_widget( array( 'Random Posts Widget', 'widgets' ), 'widget_ara_randomposts' );\n register_widget_control( array( 'Random Posts Widget', 'widgets' ), 'widget_ara_randomposts_control' );\n }", "function yz_is_custom_widget( $widget_name ) {\n if ( false !== strpos( $widget_name, 'yz_custom_widget_' ) ) {\n return true;\n }\n return false;\n}", "function FM_WebCam_Widget(){\r\n $widget_ops = array('classname' => 'FM_WebCam_Widget', 'description' => __( \"Show WebCam in Sidebar\") );\r\n $control_ops = array('width' => 300, 'height' => 300);\r\n $this->WP_Widget('FM_WebCam', __('FM_WebCam'), $widget_ops, $control_ops);\r\n }", "function widgets_init_now() {\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Текст вверху шапки'\n\t\t\t,'id' => 'header_top'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Несколько виджетов будут расположены в строчку. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок для виджета рассылки в подвале'\n\t\t\t,'id' => 'footer_mailings'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок контактов в подвале'\n\t\t\t,'id' => 'footer_contacts'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Подробнее о системе обучения в Linguamore'\n\t\t\t,'id' => 'homepage_education-feats'\n\t\t\t,'description' => 'Блок, расположенный на странице \"Преимущества\". Добавьте сюда виджет \"Rich Text\" из левой части страницы. Иконки можно добавить кнопкой \"Add Media\". Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t}", "function thefold_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Main Sidebar', 'thefold' ),\n 'id' => 'sidebar-1',\n 'description' => __( 'Default sidebar that will appear on most pages', 'thefold' ),\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => __( 'Footer', 'thefold' ),\n 'id' => 'footer',\n 'description' => __( 'Global Footer area', 'thefold' ),\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n}", "function gs_widgets_init() {\r\n\tregister_sidebar(\r\n\t array(\r\n\t 'name' => 'Homepage Widgets',\r\n\t 'id' => 'homepage-widgets',\r\n\t 'description' => '',\r\n\t 'before_widget' => '<div id=\"%1$s\" class=\"home-widget %2$s four columns\"><div class=\"widget-container\">',\r\n\t 'after_widget' => '</div></div>',\r\n\t 'before_title' => '<h4>',\r\n\t 'after_title' => '</h4>', \r\n\t ));\r\n\r\n\tregister_sidebar(\r\n\t array(\r\n\t 'name' => 'Page Sidebar',\r\n\t 'id' => 'page-sidebar',\r\n\t 'description' => '',\r\n\t 'before_widget' => '<div id=\"%1$s\" class=\"%2$s side-widget\">',\r\n\t 'after_widget' => '</div>',\r\n\t 'before_title' => '<h4>',\r\n\t 'after_title' => '</h4>', \r\n\t ));\r\n\r\n\tregister_sidebar(\r\n\t array(\r\n\t 'name' => 'Blog Sidebar',\r\n\t 'id' => 'blog-sidebar',\r\n\t 'description' => '',\r\n\t 'before_widget' => '<div id=\"%1$s\" class=\"%2$s side-widget\">',\r\n\t 'after_widget' => '</div>',\r\n\t 'before_title' => '<h4>',\r\n\t 'after_title' => '</h4>', \r\n\t ));\r\n}", "function wpb_load_widget() {\r\n\tregister_widget( 'wpb_widget' );\r\n}", "public function widgets() {\r\n\t\t// Make sure the user has capability.\r\n\t\tif ( Permission::user_can( 'analytics' ) || ! is_admin() ) {\r\n\t\t\t// Most popular contents.\r\n\t\t\tregister_widget( Widgets\\Popular::instance() );\r\n\t\t}\r\n\t}", "function jn_widgets_init() {\n register_sidebar( array(\n 'name' => __('Main Sidebar', 'jn'),\n 'id' => 'sidebar-1',\n 'description' => __('The default sidebar to be used on pages','jn'),\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>'\n ));\n}", "function widget_init() {\r\n if ( !function_exists('wp_register_sidebar_widget') || !function_exists('register_widget_control') ) return;\r\n function widget($args) {\r\n extract($args);\r\n $wpca_settings = get_option('wpcareers');\r\n echo $before_widget;\r\n echo $before_title . $wpca_settings['widget_title'] . $after_title;\r\n\r\n $fieldsPre=\"wpc_\";\r\n $before_tag=stripslashes(get_option($fieldsPre.'before_Tag'));\r\n $after_tag=stripslashes(get_option($fieldsPre.'after_Tag'));\r\n echo '<p><ul>' . widget_display($wpca_settings['widget_format']) . '</ul></p>'; \r\n }\r\n\r\n function widget_control() {\r\n $wpca_settings = $newoptions = get_option('wpcareers');\r\n if ( $_POST[\"wpCareers-submit\"] ) {\r\n $newoptions['widget_title'] = strip_tags(stripslashes($_POST['widget_title']));\r\n $newoptions['widget_format'] = $_POST['widget_format'];\r\n if ( empty($newoptions['widget_title']) ) $newoptions['widget_title'] = 'Last Classifieds Ads';\r\n }\r\n if ( $wpca_settings != $newoptions ) {\r\n $wpca_settings = $newoptions;\r\n update_option('wpcareers', $wpca_settings);\r\n }\r\n $title = htmlspecialchars($wpca_settings['widget_title'], ENT_QUOTES);\r\n if ( empty($newoptions['widget_title']) ) $newoptions['widget_title'] = 'Last Careers Posts';\r\n if ( empty($newoptions['widget_format']) ) $newoptions['widget_format'] = 'y';\r\n ?>\r\n <label for=\"wpCareers-widget_title\"><?php _e('Title:'); ?><input style=\"width: 200px;\" id=\"widget_title\" name=\"widget_title\" type=\"text\" value=\"<?php echo htmlspecialchars($wpca_settings['widget_title']); ?>\" /></label></p>\r\n <br />\r\n <label for=\"wpCareers-widget_format\">\r\n <input class=\"checkbox\" id=\"widget_format\" name=\"widget_format\" type=\"checkbox\" value=\"y\"<?php echo ($wpca_settings['widget_format']=='y')?\" checked\":\"\";?>>Small Format Output</label><br />\r\n <input type=\"hidden\" id=\"wpCareers-submit\" name=\"wpCareers-submit\" value=\"1\" />\r\n <?php\r\n }\r\n \r\n function widget_display() {\r\n $wpca_settings = get_option('wpcareers');\r\n //$out = wpcaLastPosts($wpca_settings['widget_format']);\r\n return $out;\r\n }\r\n \r\n wp_register_sidebar_widget('wpCareers', 'widget', null, 'wpCareers');\r\n register_widget_control('wpCareers', 'widget_control');\r\n }", "function kcsite_widgets_init() {\t\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Left sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-l',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Right sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-r',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\n/*\n\t\tregister_sidebar( array(\n\t\t\t'name' => __('Banners Before Footer', 'kcsite'),\n\t\t\t'id' => 'sidebar-banners-before-footer',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s help-inline\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t//'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t//'after_title' => '</h3>',\n\t\t) );*/\n\t}", "function portfolio_recent_register_widgets() {\n\tregister_widget( 'blog_recent_post' );\n}", "function wpdocs_theme_slug_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Main Sidebar', 'webino' ),\n 'id' => 'sidebar-1',\n 'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'webino' ),\n 'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</li>',\n 'before_title' => '<h2 class=\"widgettitle\">',\n 'after_title' => '</h2>',\n ) );\n}", "function theme_widgets_init() {\n register_sidebar(array(\n 'name' => __('Main Widget Area', 'theme'),\n 'id' => 'sidebar-1',\n 'description' => __('Appears in the footer section of the site.', 'law-firm'),\n 'before_widget' => '',\n 'after_widget' => '',\n 'before_title' => '',\n 'after_title' => '<',\n ));\n\n register_sidebar(array(\n 'name' => __('Secondary Widget Area', 'theme'),\n 'id' => 'sidebar-2',\n 'description' => __('Appears on posts and pages in the sidebar.', 'law-firm'),\n 'before_widget' => '',\n 'after_widget' => '',\n 'before_title' => '',\n 'after_title' => '',\n ));\n}", "public function override_sidebars_widgets_for_theme_switch()\n {\n }", "function pre_load_widget() {\n register_widget( 'events_widget' );\n register_widget( 'fundys_widget' );\n}" ]
[ "0.72189915", "0.709181", "0.7019306", "0.68088347", "0.6708269", "0.6706655", "0.6678823", "0.66565096", "0.6646908", "0.6627346", "0.66086507", "0.6577388", "0.64979607", "0.6459598", "0.64573926", "0.64550704", "0.6451702", "0.6444807", "0.64435893", "0.6394204", "0.6383393", "0.6382159", "0.6371534", "0.63543165", "0.6353528", "0.634337", "0.63293934", "0.63090944", "0.6308459", "0.63081145", "0.6304269", "0.6291392", "0.62752336", "0.6267591", "0.6266987", "0.62649655", "0.6257278", "0.62339675", "0.62330264", "0.6228948", "0.6225724", "0.62251663", "0.62251663", "0.6222751", "0.6219489", "0.6219435", "0.620983", "0.6203906", "0.62030673", "0.62000805", "0.6198938", "0.61957985", "0.61952007", "0.6191652", "0.619007", "0.6185407", "0.61809677", "0.617863", "0.61671275", "0.61655474", "0.61567277", "0.615397", "0.6152486", "0.6143059", "0.61417836", "0.61417836", "0.61415696", "0.6127501", "0.6127501", "0.6126994", "0.6123568", "0.6121094", "0.61188704", "0.6117745", "0.6114935", "0.6114761", "0.6106152", "0.61028653", "0.6101869", "0.6101869", "0.61018467", "0.6097532", "0.60969806", "0.6094796", "0.60946614", "0.60941386", "0.6091605", "0.6091317", "0.6090623", "0.60886717", "0.60882145", "0.60859543", "0.60852146", "0.60796064", "0.6078882", "0.6076467", "0.60740477", "0.60726315", "0.60671425", "0.6061424", "0.60589117" ]
0.0
-1
/ Register widget with WordPress. parent user function class father
function __construct() { parent::__construct( 'noo_social', // Base Id esc_html__('Noo Social', 'noo-landmark' ), // NAME array('description' => esc_html__('Display social network', 'noo-landmark' )) // args ) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function register_widget() {\n\t\t\t$classname = get_called_class();\n\t\t\tregister_widget( $classname );\n\t\t}", "public function register_widget() {\n register_widget( 'WPP_Widget' );\n }", "function wpb_load_widget()\n{\n register_widget('wpb_widget');\n}", "function register_widget($widget)\n {\n }", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function wpb_load_widget() {\r\n\tregister_widget( 'wpb_widget' );\r\n}", "function abc_load_widget()\n{\n register_widget('awesome_bmi_widget');\n}", "function widget_wrap()\n{\n\tregister_widget('ag_pag_familie_w');\n\tregister_widget('ag_social_widget_container');\n\tregister_widget('ag_agenda_widget');\n}", "function whichet_load_widget() {\n\tregister_widget( 'WHICHet_widget' );\n\tadd_action( 'wp_enqueue_script', 'WHICHet_scripts' );\n}", "function wpwl_load_widget() {\n register_widget( 'wpwl_widget' );\n}", "static function init() {\n\t\t\t$classname = get_called_class();\n\t\t\tadd_action( 'widgets_init', $classname . '::register_widget' );\n\t\t\tadd_shortcode( $classname, $classname . '::register_shortcode' );\n\t\t}", "function montheme_register_widget() {\n register_widget(YoutubeWidget::class);\n register_sidebar([\n 'id' => 'homepage',\n 'name' => __('Sidebar Accueil', 'montheme'),\n 'before_widget' => '<div class=\"p-4 %2$s\" id=\"%1$s\"',\n 'after_widget' => '</div>',\n 'before_title' => ' <h4 class=\"fst-italic\">',\n 'after_title' => '</h4>'\n ]);\n}", "function SetWidget() {\n\t\t\n\t\t\tif ( !function_exists('register_sidebar_widget') ) \n\t\t\treturn;\n\t\t\t\n\t\t\t// This registers our widget so it appears with the other available\n\t\t\t// widgets and can be dragged and dropped into any active sidebars.\n\t\t\tregister_sidebar_widget(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteo'));\n\t\t\n\t\t\t// This registers our optional widget control form.\n\t\t\tregister_widget_control(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteoControl'), 450, 325);\n\t\t}", "function custom_register_widget()\n{\n register_widget('oferta_widget');\n register_widget('events_widget');\n register_widget('group_list_widget');\n}", "function load_widget() {\n\n\t\tregister_widget( 'WordpressConnectWidgetActivityFeed' );\n\t\tregister_widget( 'WordpressConnectWidgetComments' );\n\t\tregister_widget( 'WordpressConnectWidgetFacepile' );\n\t\tregister_widget( 'WordpressConnectWidgetLikeBox' );\n\t\tregister_widget( 'WordpressConnectWidgetLikeButton' );\n\t\tregister_widget( 'WordpressConnectWidgetLiveStream' );\n\t\tregister_widget( 'WordpressConnectWidgetLoginButton' );\n\t\tregister_widget( 'WordpressConnectWidgetRecommendations' );\n\t\tregister_widget( 'WordpressConnectWidgetSendButton' );\n\n\t}", "public static function a_widget_init() {\n\t\t\treturn register_widget(__CLASS__);\n\t\t}", "public function _register_widgets()\n {\n }", "function register_ib_act_widget() {\n\tregister_widget( 'IB_Act_Widget_Widget' );\n}", "public static function register() {\n\t register_widget( __CLASS__ );\n\t}", "function wpzh_load_widget() {\n register_widget( 'sliderHTML2' ); \n}", "function wpb_load_widget()\n{\n register_widget( 'WC_External_API_Widget' );\n}", "function register()\n {\n // Incluimos el widget en el panel control de Widgets\n wp_register_sidebar_widget( 'widget_ultimosp', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'widget' ) );\n\n // Formulario para editar las propiedades de nuestro Widget\n wp_register_widget_control('widget_ultimos_autor', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'control' ) );\n }", "function duende_load_widget() {\n\tregister_widget( 'duende_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'recent_post_widget' );\n }", "function sbc_connect_widget() {\n\n class connect_widget extends WP_Widget {\n\n function __construct() {\n parent::__construct(\n\n // Base ID of your widget\n 'connect_widget',\n\n // Widget name will appear in UI\n __('Connect', 'connect_widget_domain'),\n\n // Widget description\n array( 'description' => __( 'Insert your connect links with this widget', 'connect_widget_domain' ), )\n );\n }\n\n // Creating widget output\n public function widget( $args, $instance ) {\n $title = apply_filters( 'widget_title', $instance['title'] );\n\n // echo Title if Title\n echo $args['before_widget'];\n echo '<div class=\"connect-widget\">';\n if ( ! empty( $title ) ):\n echo $args['before_title'] . $title . $args['after_title'];\n endif;\n\n // echo social links if social links available in theme options\n if( have_rows('_about', 'option') ):\n while( have_rows('_about', 'option') ): the_row();\n if( have_rows('connect_media') ):\n// echo 'Follow Us: ';\n while( have_rows('connect_media') ): the_row();\n $link = get_sub_field('link');\n $platform = get_sub_field('platform');\n $icon = '<a href=\"' . $link . '\">' .\n '<i class=\"' . $platform . '\"></i>' .\n '</a>';\n echo $icon;\n endwhile;\n endif;\n endwhile;\n endif;\n\n // This is where you run the code and display the output\n// echo __( 'Hello, World!', 'connect_widget_domain' );\n echo $args['after_widget'];\n echo '</div>';\n }\n\n // Widget Backend\n public function form( $instance ) {\n if ( isset( $instance[ 'title' ] ) ) {\n $title = $instance[ 'title' ];\n }\n else {\n $title = __( 'New title', 'connect_widget_domain' );\n }\n // Widget admin form\n ?>\n <p>\n <label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" />\n </p>\n <?php\n }\n\n // Updating widget replacing old instances with new\n public function update( $new_instance, $old_instance ) {\n $instance = array();\n $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';\n return $instance;\n }\n\n } // close class\n\n // Register the widget\n register_widget( 'connect_widget' );\n\n}", "function hw_load_widget() {\n\tregister_widget( 'hw_cal_widget' );\n\tregister_widget( 'hw_custom_post_list_widget' );\n}", "function itstar_widget() {\n register_widget( 'last_video_widget' );\n register_widget( 'last_posts_by_cat_widget' );\n register_widget( 'simple_button_widget' );\n}", "function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}", "function itstar_widget() {\n// register_widget( 'last_products_widget' );\n// register_widget( 'last_projects_widget' );\n register_widget( 'last_posts_by_cat_widget' );\n register_widget( 'contact_info_widget' );\n// register_widget( 'social_widget' );\n}", "function gardenia_load_widget() {\n\tregister_widget( 'gardenia_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'lrq_widget' );\n }", "function load_widget_plugin_name() {\n register_widget( 'widget_plugin_name' );\n}", "function pb18_article_also_widget() {\n register_widget( 'pb18_article_also_widget' );\n}", "function registerWidgets( ) {\r\n\t\t\twp_register_sidebar_widget( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetOutput' ) );\r\n\t\t\twp_register_widget_control( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetControlOutput' ) );\r\n\t\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "function wpb_load_widget() {\n\t\tregister_widget( 'dmv_widget' );\n\t}", "function load_postmeta_widget(){\n register_widget( 'postmeta_widget' );\n}", "function pre_load_widget() {\n register_widget( 'events_widget' );\n register_widget( 'fundys_widget' );\n}", "function ds_social_load_widget() {\n\tregister_widget( 'ds_social_widget' );\n}", "function example_load_widgets()\n{\n\tregister_widget('GuildNews_Widget');\n}", "function wpc_load_widget()\n{\n register_widget('expat_category_widget');\n}", "function WeblizarTwitterWidget() {\r\n\tregister_widget( 'WeblizarTwitter' );\r\n}", "function dl_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Página de Contacto',\n\t\t'id'\t\t\t=> 'contact-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Barra Lateral',\n\t\t'id'\t\t\t=> 'sidebar-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Search Menu',\n\t\t'id'\t\t\t=> 'menu-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\n}", "function parquesWidgets()\n{\n\t//add classes\n\tinclude_once(TEMPLATEPATH.'/widgets/widgettexto.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-social.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-home.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-progreso.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-categorias.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-banner.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-timelines.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-flickr.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/nav-menu-narrativas.php');\n\n\t//add widget\n \tregister_widget( 'Widget_Texto' );\n \tregister_widget( 'Widget_Social' );\n \tregister_widget( 'Widget_Home' );\n \tregister_widget( 'Widget_Progreso' );\n \tregister_widget( 'Widget_Categorias' );\n \tregister_widget( 'Widget_Banner' );\n \tregister_widget( 'Widget_Timelines' );\n \tregister_widget( 'Widget_Flickr' );\n \tregister_widget( 'Widget_Narrativas' );\n\n\n}", "public function addWidget()\r\n {\r\n }", "function aw_add_load_widget() {\r\n\t\tregister_widget( 'AW_AddFeed' );\r\n\t}", "public function __construct() {\n parent::__construct(\n 'an_catlinks_widget', // ID of the widget\n esc_html__('Categories Links Widget', 'an_catlinks_wiget'), // Widget title\n array(\n 'description' => esc_html__('The widget allow to insert a block of the iconic links for 3 categories', 'an_catlinks_wiget'),\n )\n );\n\n // enqueue scripts for media library\n add_action( 'admin_enqueue_scripts', array( $this, 'allow_media_upload' ) );\n // enqueue enqueue styles\n add_action('wp_enqueue_scripts', array($this, 'enqueue_styles'));\n // customize styles\n if (!is_admin()) {\n add_action('wp_head',array($this, 'customize_css'));\n }\n }", "public static function init()\n {\n add_action( 'widgets_init', array(__CLASS__, 'register') );\n }", "function register_service_widget() {\n register_widget( 'Services_Widget' );\n}", "function load_type_widget() {\n register_widget( 'custom_type_widget' );\n}", "function widget_load() {\n\t\tregister_widget('ilgelo_wSocial');\n\t\tregister_widget('ilgelo_wTwitter');\n\t\tregister_widget('ilgelo_banner');\n\t}", "public function __construct() {\n\n // load plugin text domain\n add_action( 'init', array( $this, 'widget_textdomain' ) );\n\n // Hooks fired when the Widget is activated and deactivated\n register_activation_hook( __FILE__, array( $this, 'activate' ) );\n register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );\n\n parent::__construct(\n $this->get_widget_slug(),\n __( 'Tandem Calendar Feed', $this->get_widget_slug() ),\n array(\n 'classname' => $this->get_widget_slug().'-class',\n 'description' => __( 'Constructs XML calendar feed url based on options and parses to display in widget areas.', $this->get_widget_slug() )\n )\n );\n\n // Register site styles and scripts\n add_action( 'wp_enqueue_scripts', array( $this, 'register_widget_styles' ) );\n add_action( 'wp_enqueue_scripts', array( $this, 'register_widget_scripts' ) );\n\n // Refreshing the widget's cached output with each new post\n add_action( 'save_post', array( $this, 'flush_widget_cache' ) );\n add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );\n add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );\n\n add_shortcode( 'calendar', array($this, 'tandem_cal_shortcode') );\n\n }", "function register_Zappy_Feed_Burner_Widget() {\n register_widget('Zappy_Feed_Burner_Widget');\n}", "function widget_init() {\n if ( function_exists('register_sidebar') )\n \n register_sidebar(\n array(\n 'name' => 'Footer',\n 'before_widget' => '<div class = \"footer\">',\n 'after_widget' => '</div>',\n 'before_title' => '',\n 'after_title' => '',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Event Navigation',\n 'before_widget' => '<div class=\"custom-widget top-round card slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Frontpage News',\n 'before_widget' => '<div class=\"custom-widget card top-round slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n }", "function cm_load_widget_r() {\n\tregister_widget( 'cm_widget_r' );\n}", "function ILuvWalkingWidget( ) {\r\n\t\t\tadd_action( 'widgets_init', array( &$this, 'registerWidgets' ) );\r\n\t\t\tadd_action( 'init', array( &$this, 'enqueueNecessaryFiles' ) );\r\n\t\t\t\r\n\t\t\t$this->site = 'http://iluvwalking.com/';\r\n\t\t}", "function load_tag_widget() {\n register_widget( 'custom_tag_widget' );\n}", "function featured_news_load_widget() {register_widget( 'featured_news_widget' );}", "function __construct() {\n add_action('init', array($this,'widget_Oldsinks_textdomain'));\n parent::__construct(\n 'widget-Oldsinks',\n __('Oldsinks Widgets', 'widget-Oldsinks'),\n array(\n 'classname' => 'widget-Oldsinks',\n 'description' => __('Oldsinks Widget is a Wordpress widget designed to demostrate how to build a widget\n from the ground up using Wordpress best practices.','widget-Oldsinks')\n )\n );\n // Register stylesheets (don't forget to replace the widget Oldsinks for your widget purpose).\n add_action('admin_print_styles', array($this,'register_Oldsinks_admin_styles'));\n add_action('wp_enqueue_scripts', array($this, 'register_Oldsinks_widget_styles'));\n // Register javascript (don't forget to replace the widget Oldsinks for your widget purpose).\n add_action('admin_Oldsinks_enqueue_scripts', array($this,'register_Oldsinks_admin_scripts'));\n //add_action('wp_Oldsinks_enqueue_scripts', array($this, 'register_Oldsinks_widget_scripts'));\n register_nav_menu('Oldsinks-main-menu',__( 'Oldsinks Main Menu' ));\n}", "function oa_social_login_init_widget ()\r\n{\r\n return register_widget('Widget_Login');\r\n}", "function fr_s_Blog_Widget() {\n\t\t$widget_ops = array( 'classname' => 'fr_s_blog_widget', 'description' => __('Sidebar or Footer widget that displays your latest posts with a thumbnail and a short excerpt.', 'twok') );\n\t\t$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'fr_s_blog_widget' );\n\t\tparent::__construct( 'fr_s_blog_widget', __('TWOK - Recent Posts Widget (Sidebar)', 'twok'), $widget_ops, $control_ops );\n}", "function widget_registration($name, $id, $description, $beforeWidget, $afterWidget, $beforeTitle, $afterTitle) {\n register_sidebar(\n array(\n 'name' => $name,\n 'id' => $id,\n 'description' => $description,\n 'before_widget' => $beforeWidget,\n 'after_widget' => $afterWidget,\n 'before_title' => $beforeTitle,\n 'after_title' => $afterTitle,\n )\n );\n}", "function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}", "function register_broker_widget() {\n register_widget( 'Broker_Widget' );\n}", "function pts_widget_init() {\n\n register_sidebar( array(\n\t\t'name' => 'Top Widget',\n\t\t'id' => 'top_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"%2$s top-widgs\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Sidebar Widget',\n\t\t'id' => 'sidebar_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"%2$s sidebar-widgs\">',\n\t\t'after_widget' => '</div></div>',\n\t\t'before_title' => '<div class=\"widget_title_wrapper\"><h5 class=\"widgets_titles_sidebar\">',\n\t\t'after_title' => '</h5></div><div class=\"wca\">',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Single Post Widget',\n\t\t'id' => 'single_post_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"%2$s sidebar-widgs\">',\n\t\t'after_widget' => '</div></div>',\n\t\t'before_title' => '<div class=\"widget_title_wrapper\"><h5 class=\"widgets_titles_sidebar\">',\n\t\t'after_title' => '</h5></div><div class=\"wca\">',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'First Footer Widget',\n\t\t'id' => 'first_footer_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"footer-widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h5 class=\"widgets_titles\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Second Footer Widget',\n\t\t'id' => 'second_footer_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"footer-widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h5 class=\"widgets_titles\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Third Footer Widget',\n\t\t'id' => 'third_footer_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"footer-widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h5 class=\"widgets_titles\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Fourth Footer Widget',\n\t\t'id' => 'fourth_footer_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"footer-widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h5 class=\"widgets_titles\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Footer Right',\n\t\t'id' => 'footer_right',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"%2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t) );\n}", "function widget_init() {\r\n if ( !function_exists('wp_register_sidebar_widget') || !function_exists('register_widget_control') ) return;\r\n function widget($args) {\r\n extract($args);\r\n $wpca_settings = get_option('wpcareers');\r\n echo $before_widget;\r\n echo $before_title . $wpca_settings['widget_title'] . $after_title;\r\n\r\n $fieldsPre=\"wpc_\";\r\n $before_tag=stripslashes(get_option($fieldsPre.'before_Tag'));\r\n $after_tag=stripslashes(get_option($fieldsPre.'after_Tag'));\r\n echo '<p><ul>' . widget_display($wpca_settings['widget_format']) . '</ul></p>'; \r\n }\r\n\r\n function widget_control() {\r\n $wpca_settings = $newoptions = get_option('wpcareers');\r\n if ( $_POST[\"wpCareers-submit\"] ) {\r\n $newoptions['widget_title'] = strip_tags(stripslashes($_POST['widget_title']));\r\n $newoptions['widget_format'] = $_POST['widget_format'];\r\n if ( empty($newoptions['widget_title']) ) $newoptions['widget_title'] = 'Last Classifieds Ads';\r\n }\r\n if ( $wpca_settings != $newoptions ) {\r\n $wpca_settings = $newoptions;\r\n update_option('wpcareers', $wpca_settings);\r\n }\r\n $title = htmlspecialchars($wpca_settings['widget_title'], ENT_QUOTES);\r\n if ( empty($newoptions['widget_title']) ) $newoptions['widget_title'] = 'Last Careers Posts';\r\n if ( empty($newoptions['widget_format']) ) $newoptions['widget_format'] = 'y';\r\n ?>\r\n <label for=\"wpCareers-widget_title\"><?php _e('Title:'); ?><input style=\"width: 200px;\" id=\"widget_title\" name=\"widget_title\" type=\"text\" value=\"<?php echo htmlspecialchars($wpca_settings['widget_title']); ?>\" /></label></p>\r\n <br />\r\n <label for=\"wpCareers-widget_format\">\r\n <input class=\"checkbox\" id=\"widget_format\" name=\"widget_format\" type=\"checkbox\" value=\"y\"<?php echo ($wpca_settings['widget_format']=='y')?\" checked\":\"\";?>>Small Format Output</label><br />\r\n <input type=\"hidden\" id=\"wpCareers-submit\" name=\"wpCareers-submit\" value=\"1\" />\r\n <?php\r\n }\r\n \r\n function widget_display() {\r\n $wpca_settings = get_option('wpcareers');\r\n //$out = wpcaLastPosts($wpca_settings['widget_format']);\r\n return $out;\r\n }\r\n \r\n wp_register_sidebar_widget('wpCareers', 'widget', null, 'wpCareers');\r\n register_widget_control('wpCareers', 'widget_control');\r\n }", "public function register($widget)\n {\n }", "function hocwp_theme_custom_widgets_init() {\r\n\r\n}", "function parques_widget_init()\n{\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'progress-bar',\n\t\t\t'name'\t\t\t=> 'Barra de progreso',\n\t\t\t'description'\t=> 'Barra de progreso que indica el avance del proyecto',\n\t\t\t'before_widget' => '<div>',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-footer',\n\t\t\t'name'\t\t\t=> \"footer\",\n\t\t\t'description'\t=> 'footer con la infomacion del contacto en todas las pag',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"col-sm-4\">',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-social',\n\t\t\t'name'\t\t\t=> \"widget-social\",\n\t\t\t'description'\t=> 'Contenido para las redes sociales',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget-social\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-gallery',\n\t\t\t'name'\t\t\t=> \"widget-gallery\",\n\t\t\t'description'\t=> 'widget para el plugin de galerias',\n\t\t\t'before_widget' => '<div class=\"widget-gallery\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-banner',\n\t\t\t'name'\t\t\t=> \"widget-banner\",\n\t\t\t'description'\t=> 'Banner para parques del rio.',\n\t\t\t'before_widget' => '<div id=\"widget-banner\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-home',\n\t\t\t'name'\t\t\t=> \"widget-home\",\n\t\t\t'description'\t=> 'Contenido relacionado con articulos del sitio.',\n\t\t\t'before_widget' => '<div id=\"widget-home\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-progreso',\n\t\t\t'name'\t\t\t=> \"widget-progreso\",\n\t\t\t'description'\t=> 'Widget con barra de progreso del proyecto.',\n\t\t\t'before_widget' => '<div id=\"widget-progreso\" class=\"hidden-xs\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-categorias',\n\t\t\t'name'\t\t\t=> \"widget-categorias\",\n\t\t\t'description'\t=> 'Widget con categorías del proyecto.',\n\t\t\t'before_widget' => '<div id=\"widget-categorias\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'sidebar',\n\t\t\t'name'\t\t\t=> \"sidebar\",\n\t\t\t'description'\t=> 'Sidebar',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget-%1$s\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'nav-menu-narrativa',\n\t\t\t'name'\t\t\t=> \"nav-menu-narrativa\",\n\t\t\t'description'\t=> 'Sidebar',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget-%1$s\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n}", "function register_dc_widget() {\n\t\tregister_widget( 'dc_linked_image' );\n\t\tregister_widget( 'dc_widget_link_text' );\n\t}", "function register_zijcareebuilderjobswidget() {\n register_widget( 'ZijCareerBuilderJobs' );\n}", "function tw_blog_widget() {\n parent::__construct(false, $name = 'Wunder Blog Widget');\n }", "public function widgets_init() {\n\t\t// Set widgets_init action function.\n\t\tadd_action( 'widgets_init', array( $this, 'register_sidebars' ) );\n\t\tregister_widget( 'DX\\MOP\\Student_Widget' );\n\t}", "function arphabet_widgets_init() {\n\n register_sidebar( array(\n 'name' => 'Widget oben rechts',\n 'id' => 'widget_top_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget mitte rechts',\n 'id' => 'widget_center_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget unten rechts',\n 'id' => 'widget_bottom_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Newsletter Widget',\n 'id' => 'newsletter_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Custom Footer Widget',\n 'id' => 'footer_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n\n}", "function bp_media_register_widgets() {\n\tadd_action('widgets_init', create_function('', 'return register_widget(\"BP_Media_Widget\");') );\n}", "public function action_widgets_init() {\n\n // Our widgets\n register_widget( '\\Pedestal\\Widgets\\Recent_Content_Widget' );\n register_widget( '\\Pedestal\\Widgets\\Recent_Video_Widget' );\n\n if ( PEDESTAL_ENABLE_INSTAGRAM_OF_THE_DAY ) {\n register_widget( '\\Pedestal\\Widgets\\Daily_Insta_Widget' );\n }\n\n // Unregister core widgets we won't be using\n unregister_widget( 'WP_Widget_Archives' );\n unregister_widget( 'WP_Widget_Calendar' );\n unregister_widget( 'WP_Widget_Categories' );\n unregister_widget( 'WP_Widget_Custom_HTML' );\n unregister_widget( 'WP_Widget_Links' );\n unregister_widget( 'WP_Widget_Media_Audio' );\n unregister_widget( 'WP_Widget_Media_Gallery' );\n unregister_widget( 'WP_Widget_Media_Image' );\n unregister_widget( 'WP_Widget_Media_Video' );\n unregister_widget( 'WP_Widget_Meta' );\n unregister_widget( 'WP_Widget_Pages' );\n unregister_widget( 'WP_Widget_Recent_Comments' );\n unregister_widget( 'WP_Widget_Recent_Posts' );\n unregister_widget( 'WP_Widget_RSS' );\n unregister_widget( 'WP_Widget_Search' );\n unregister_widget( 'WP_Widget_Tag_Cloud' );\n unregister_widget( 'WP_Widget_Text' );\n\n // Unregister widgets added by plugins\n unregister_widget( 'P2P_Widget' );\n }", "public static function init() {\n //Register widget settings...\n self::update_dashboard_widget_options(\n self::wid, //The widget id\n array( //Associative array of options & default values\n 'username' => '',\n\t\t\t\t'apikey' => '',\n\t\t\t\t'project_id' => '',\n ),\n true //Add only (will not update existing options)\n );\n\n //Register the widget...\n wp_add_dashboard_widget(\n self::wid, //A unique slug/ID\n __( 'Rankalyst Statistik', 'affiliatetheme-backend' ),//Visible name for the widget\n array('AT_Rankalyst_Widget','widget'), //Callback for the main widget content\n array('AT_Rankalyst_Widget','config') //Optional callback for widget configuration content\n );\n }", "function FoodByNight_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer Right',\n\t\t'id' => 'footer_right',\n\t\t'before_widget' => '<ul class=\"list-inline\">',\n\t\t'after_widget' => '</ul>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Social_Link_Widget' );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Popups',\n\t\t'id' => 'popups',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Contact_Popup_Widget' );\n\n}", "function wp_add_dashboard_widget($widget_id, $widget_name, $callback, $control_callback = \\null, $callback_args = \\null, $context = 'normal', $priority = 'core')\n {\n }", "function __construct() {\n\n //Call the parent constructor with the required arguments.\n parent::__construct(\n // The unique id for your widget.\n 'jlb-logo-hover',\n\n // The name of the widget for display purposes.\n __('JLB Logo Hover', 'jlb-logo-hover-text-domain'),\n\n // The $widget_options array, which is passed through to WP_Widget.\n // It has a couple of extras like the optional help URL, which should link to your sites help or support page.\n array(\n 'description' => __('JLB Logo Hover', 'jlb-logo-hover-text-domain'),\n ),\n\n //The $control_options array, which is passed through to WP_Widget\n array(\n ),\n\n //The $form_options array, which describes the form fields used to configure SiteOrigin widgets. We'll explain these in more detail later.\n $form_options = array(\n 'logo_repeater' => array(\n 'type' => 'repeater',\n 'label' => __( 'Logos' , 'widget-form-fields-text-domain' ),\n 'item_name' => __( 'Logo', 'siteorigin-widgets' ),\n 'fields' => array(\n\n 'logo_media' => array(\n 'type' => 'media',\n 'label' => __( 'Image', 'widget-form-fields-text-domain' ),\n 'choose' => __( 'Choose image', 'widget-form-fields-text-domain' ),\n 'update' => __( 'Set image', 'widget-form-fields-text-domain' ),\n 'library' => 'image',\n 'fallback' => true,\n ),\n\n 'link_text' => array(\n 'type' => 'text',\n 'label' => __( 'Link Text', 'widget-form-fields-text-domain' )\n ),\n\n 'link' => array(\n 'type' => 'text',\n 'label' => __( 'Link', 'widget-form-fields-text-domain' )\n ),\n )\n )\n ),\n\n\n\n //The $base_folder path string.\n plugin_dir_path(__FILE__)\n );\n }", "function register_Zappy_Lates_Comment_Widget() {\n register_widget('Zappy_Lates_Comment_Widget');\n}", "function wpb_carousel_widget() {\n\t register_widget( 'wpb_widget' );\n\t}", "function ebay_feeds_for_wordpress_Widget() {\n // curl need to be installed\n\tregister_widget( 'ebay_feeds_for_wordpress_Widget_class' );\n}", "public function widget( $args, $instance ){}", "function mythemepost_widgets(){ \n register_sidebar( array(\n 'name' => 'Lavel Up New Widget Area',\n 'id' => 'level_up_new_widget_area',\n 'before_widget' => '<aside>',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n \n ));\n}", "function wp_render_widget_control($id)\n {\n }", "function urbanfitness_widgets()\n{\n //registering widget must write php code to show it\n register_sidebar([\n 'name' => 'Sidebar', //widget name on wordpress panel\n 'id' => 'sidebar', //we are passing this id to dynamic_widget('sidebar') must be unique for wordpress to identify\n 'before_widget' => '<div class=\"widget\">', //html before widget\n 'after_widget' => '</div>', //html after widget\n 'before_title' => '<h3 class=\"text-primary\">', //html before title\n 'after_title' => '</h3>', //html after title\n ]);\n}", "function __construct() {\n\n //Call the parent constructor with the required arguments.\n parent::__construct(\n // The unique id for your widget.\n 'madang_partner_widget',\n\n // The name of the widget for display purposes.\n esc_html__('Madang Partner', 'madang'),\n\n // The $widget_options array, which is passed through to WP_Widget.\n // It has a couple of extras like the optional help URL, which should link to your sites help or support page.\n array(\n 'description' => esc_html__('Create Partner Section', 'madang'),\n 'panels_groups' => array('madang'),\n 'help' => 'http://madang_docs.kenzap.com',\n ),\n\n //The $control_options array, which is passed through to WP_Widget\n array(\n ),\n\n //The $form_options array, which describes the form fields used to configure SiteOrigin widgets. We'll explain these in more detail later.\n array(\n 'partner1_txt' => array(\n 'type' => 'text',\n 'label' => esc_html__('Partner 1 title', 'madang'),\n 'default' => ''\n ),\n 'partner1_img' => array(\n 'type' => 'media',\n 'label' => esc_html__( 'Choose 1 image', 'madang' ),\n 'choose' => esc_html__( 'Choose image', 'madang' ),\n 'update' => esc_html__( 'Set image', 'madang' ),\n 'library' => 'image',\n 'fallback' => true\n ), \n\n 'partner2_txt' => array(\n 'type' => 'text',\n 'label' => esc_html__('Partner 2 title', 'madang'),\n 'default' => ''\n ),\n 'partner2_img' => array(\n 'type' => 'media',\n 'label' => esc_html__( 'Choose 2 image', 'madang' ),\n 'choose' => esc_html__( 'Choose image', 'madang' ),\n 'update' => esc_html__( 'Set image', 'madang' ),\n 'library' => 'image',\n 'fallback' => true\n ), \n\n 'partner3_txt' => array(\n 'type' => 'text',\n 'label' => esc_html__('Partner 3 title', 'madang'),\n 'default' => ''\n ),\n 'partner3_img' => array(\n 'type' => 'media',\n 'label' => esc_html__( 'Choose 3 image', 'madang' ),\n 'choose' => esc_html__( 'Choose image', 'madang' ),\n 'update' => esc_html__( 'Set image', 'madang' ),\n 'library' => 'image',\n 'fallback' => true\n ), \n\n 'partner4_txt' => array(\n 'type' => 'text',\n 'label' => esc_html__('Partner 4 title', 'madang'),\n 'default' => ''\n ),\n 'partner4_img' => array(\n 'type' => 'media',\n 'label' => esc_html__( 'Choose 4 image', 'madang' ),\n 'choose' => esc_html__( 'Choose image', 'madang' ),\n 'update' => esc_html__( 'Set image', 'madang' ),\n 'library' => 'image',\n 'fallback' => true\n ),\n ),\n\n //The $base_folder path string.\n plugin_dir_path(__FILE__)\n );\n }", "function green_widget_twitter_load() {\n\tregister_widget( 'green_widget_twitter' );\n}", "function instagram_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Instagram',\n\t\t'id' => 'instagram',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t) );\n\n}", "function __construct() {\n parent::__construct(\n // The unique id for your widget.\n 'embed-video',\n\n // The name of the widget for display purposes.\n __('Embed Video', 'embed-video-text-domain'),\n\n // The $widget_options array, which is passed through to WP_Widget.\n // It has a couple of extras like the optional help URL, which should link to your sites help or support page.\n array(\n 'description' => __('A single image widget.', 'embed-video-text-domain'),\n 'help' => 'http://laternastudio.com',\n ),\n\n //The $control_options array, which is passed through to WP_Widget\n array(\n ),\n\n //The $form_options array, which describes the form fields used to configure SiteOrigin widgets. We'll explain these in more detail later.\n array(\n 'video_url' => array(\n 'type' => 'link',\n 'label' => __( 'Video Url', 'widget-form-fields-text-domain' )\n ),\n 'host' => array(\n 'type' => 'select',\n 'label' => 'Select Host',\n 'default' => 'YouTube',\n 'options' => array(\n 'youtube' => 'YouTube',\n 'vimeo' => 'Vimeo'\n )\n )\n ),\n\n //The $base_folder path string.\n plugin_dir_path(__FILE__)\n );\n }", "function genesisawesome_custom_widgets() {\n\n\t/* Unregister Header Right widget area */\n\tunregister_sidebar( 'header-right' );\n\n\t/* Register Custom Widgets */\n\tregister_widget( 'GA_Facebook_Likebox_Widget' );\n\tregister_widget( 'GA_Flickr_Widget' );\n\n}", "function mytheme_load_widget() {\n register_widget( 'mytheme_widget_text' );\n \n // Allow to execute shortcodes on mytheme_widget_text\n add_filter('mytheme_widget_text', 'do_shortcode');\n}", "public function widget($args, $instance)\r\n {\r\n $picture = esc_attr(get_option('profile_picture'));\r\n $firstName = esc_attr(get_option('first_name'));\r\n $lastName = esc_attr(get_option('last_name'));\r\n $full_name = $firstName . ' ' . $lastName;\r\n $description = esc_attr(get_option('description'));\r\n\r\n $facebook = esc_attr(get_option('face_book'));\r\n $twitter = esc_attr(get_option('twitter'));\r\n $instagram = esc_attr(get_option('insta_gram'));\r\n\r\n echo $args['before_widget'];\r\n ?>\r\n <!-- <div class=\"preview-wrapper\"> -->\r\n <!-- <p style=\"text-align: center;\"><i>Preview</i></p> -->\r\n <!-- <div class=\"sunset-sidebar-preview\"> -->\r\n <div class=\"text-center\">\r\n <div class=\"image-container\">\r\n <div id=\"profile-picture-prev\" class=\"profile-picture\" style=\"background-image: url('<?php echo $picture; ?>');\"></div>\r\n </div>\r\n <h1 class=\"sunset-username\"><?php echo $full_name; ?></h1>\r\n <h2 class=\"sunset-description\"><?php echo $description; ?></h2>\r\n <div class=\"icons-wrapper\">\r\n\r\n <?php\r\n\r\n wp_nav_menu(array(\r\n 'menu' => 'sidebar',\r\n 'container' =>false,\r\n 'theme_location' => 'sidebar',\r\n 'menu_class' => 'social-media'\r\n\r\n ))\r\n\r\n\r\n\r\n ?>\r\n\r\n\r\n\r\n <!-- <ul class=\"social-media\"> -->\r\n <?php\r\n // if(!empty($facebook)){ ?>\r\n <!-- <li><a target=\"_blank\" href=\"https://www.facebook.com/ --><?php //echo $facebook ;?><!-- \"><i class=\"fab fa-facebook\"></i></a></li> -->\r\n <?php //} ?>\r\n <!-- <li><a href=\"#\" ><i class=\"fab fa-twitter\"></i></a></li>\r\n <li><a href=\"#\" ><i class=\"fab fa-instagram\"></i></a></li>\r\n </ul>\r\n </div> -->\r\n </div>\r\n <!-- </div>\r\n </div> -->\r\n\r\n <?php\r\n echo $args['after_widget'];\r\n }", "function register_block_core_legacy_widget()\n {\n }", "function rs_load_widget()\n{\n\tregister_widget('rs_Widget_Agenda');\n}", "function bootstrap_side_nav_widget_load_widget() {\n\t\tregister_widget( 'bootstrap_side_nav_widget' );\n\t}", "function register_service_box()\n{\n register_widget( 'CtaWidget' );\n}", "public function widgets_init() {\n\t\t\t\n\t\t// init default widgets\n\t\twpu_widgets_init();\n\t\t\n\t\t// register any sub-plugin widget\n\t\tif($this->is_working() && is_object($this->extras)) {\n\t\t\t$this->extras->widgets_init();\n\t\t}\n\t}" ]
[ "0.85185015", "0.815563", "0.8126246", "0.8057008", "0.7996642", "0.7996642", "0.79482293", "0.7928225", "0.7871422", "0.7730925", "0.76806253", "0.7647383", "0.7613204", "0.7606207", "0.7593592", "0.75750387", "0.7570291", "0.7569808", "0.7531154", "0.7526672", "0.74828017", "0.7481807", "0.7475414", "0.7472882", "0.74689204", "0.74627113", "0.7453993", "0.74535805", "0.7397482", "0.7387555", "0.7384831", "0.73640937", "0.73584193", "0.73451924", "0.7342536", "0.73410964", "0.73410964", "0.7303033", "0.7299619", "0.7272606", "0.7270786", "0.724759", "0.7211265", "0.72104794", "0.7180327", "0.7179404", "0.7141003", "0.7140323", "0.7135917", "0.71278566", "0.71271884", "0.71271116", "0.71231675", "0.71216047", "0.709555", "0.7089902", "0.70870316", "0.7084111", "0.7082181", "0.708135", "0.70677274", "0.70513386", "0.7042874", "0.70418", "0.70209527", "0.7018833", "0.7016456", "0.7006388", "0.69996417", "0.6985055", "0.69818753", "0.6979407", "0.6976294", "0.69520247", "0.6950795", "0.69478303", "0.6945272", "0.6944423", "0.69381905", "0.6915225", "0.69151366", "0.68959486", "0.6891649", "0.68907064", "0.688957", "0.688668", "0.6883199", "0.68812555", "0.6878454", "0.68754554", "0.6874063", "0.68735653", "0.6865777", "0.68654275", "0.6860568", "0.6859682", "0.6856951", "0.68542033", "0.68463725", "0.6842525", "0.68421733" ]
0.0
-1
Frontend display of widget
public function widget( $args, $instance ) { extract($args); $title = apply_filters('widget_title', $instance['title']); echo $before_widget ; if ( $title ) : echo $before_title.$title.$after_title ; endif; $arg_social = array( array('id' => 'facebook'), array('id' => 'google'), array('id' => 'twitter'), array('id' => 'youtube'), array('id' => 'skype'), array('id' => 'linkedin'), array('id' => 'dribbble'), array('id' => 'pinterest'), array('id' => 'flickr'), array('id' => 'instagram') ) ; ?> <div class="noo_social"> <div class="social-all"> <?php foreach($arg_social as $social): if (!empty($instance[$social['id']])): ?> <a href="<?php echo ($instance[$social['id']]); ?>" target="_blank" class="<?php echo esc_attr($social['id']); ?>"><i class="fa fa-<?php echo esc_attr($social['id']); ?>"></i></a> <?php endif; endforeach; ?> </div> </div> <?php echo $after_widget ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render_widget() {\n\t\t$this->get_db_values();\n\t\tif ( wponion_is_callable( $this->option( 'callback' ) ) ) {\n\t\t\techo wponion_callback( $this->option( 'callback' ), array( $this->get_db_values(), $this ) );\n\t\t}\n\t}", "public function render_widget() {\n\n return Widget::render($this->settings);\n\n }", "public static function widget() {\n \n\t\t$start = self::get_dashboard_widget_option(self::wid, 'starting_conversion');\n\t\t$remaining_days = self::get_dashboard_widget_option(self::wid, 'starting_conversion');\n\t\t\n\t\t// Display Dashboard widget\n\t\trequire_once( 'red-flag-parking-display.php' );\n }", "public static function widget() {\n\t\t$username = self::get_dashboard_widget_option(self::wid, 'username');\n\t\t$apikey = self::get_dashboard_widget_option(self::wid, 'apikey');\n\t\t$project_id = self::get_dashboard_widget_option(self::wid, 'project_id');\n\t\t$ref_url = 'http://go.endcore.64905.digistore24.com/';\n\t\t$check = ($username && $apikey && $project_id ? true : false);\n \n\t\tif(!$check) {\n\t\t\techo '<h4 style=\"text-align:right; padding-right: 40px; padding-top: 10px\">' . __( 'Bitte prüfe die Einstellungen &and;', 'affiliatetheme-backend' ) . '</h4>&nbsp;';\n ?>\n <div class=\"rankalyst-text\">\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\"><img src=\"<?php echo get_template_directory_uri(); ?>/_/img/rankalyst.png\"></a>\n <p><?php printf(__('Mit <a href=\"%s\" target=\"_blank\">Rankalyst</a> kannst du 10 Keywords kostenlos tracken!', 'affiliatetheme-backend'), $ref_url); ?></p>\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\" class=\"button button-primary\"><?php _e('Kostenlos starten', 'affiliatetheme-backend'); ?></a>\n </div>\n <?php\n\t\t}\n\t\t\n\t\t/* @TODO Rankingchange <span class=\"plus\">+</span> bzw Minus ausgeben, jenachdem ob Change positiv oder negativ. */\n\n ?>\n <div class=\"rankalyst-data\">\n <ul class=\"rankalyst-tabs\">\n <li><a href=\"#\" data-type=\"organic\" class=\"active\"><?php _e('Organic', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"mobile\"><?php _e('Mobile', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"local\"><?php _e('Local', 'affiliatetheme-backend'); ?></a></li>\n </ul>\n\n <div class=\"rankalyst-tab active\" data-type=\"organic\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 1);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"mobile\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 2);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"local\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 3);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n </div>\n <?php\n }", "public function frontend_render()\n {\n $user_selected_language = get_user_lang();\n $widget_saved_values = $this->get_settings();\n\n $widget_title = $widget_saved_values['widget_title_' . $user_selected_language] ?? '';\n\n $output = $this->widget_before(); //render widget before content\n\n if (!empty($widget_title)) {\n $output .= '<h4 class=\"widget-title\">' . purify_html($widget_title) . '</h4>';\n }\n $output .='<div class=\"widget widget_search\">\n <form action=\"'.route('frontend.blog.search').'\" method=\"get\" class=\"search-form\">\n <div class=\"form-group\">\n <input type=\"text\" class=\"form-control\" name=\"search\" placeholder=\"'.__('Write your keyword...').'\">\n </div>\n <button class=\"submit-btn\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\n </form>\n </div>';\n\n $output .= $this->widget_after(); // render widget after content\n\n return $output;\n }", "public function getWidget();", "public static function widget() {\n require_once( 'includes/widget.php' );\n }", "public function dashboard_widget_content() {\n\t\t$is_authed = ( MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed() );\n\n\t\tif ( ! $is_authed ) {\n\t\t\t$this->widget_content_no_auth();\n\t\t} else {\n\t\t\tmonsterinsights_settings_error_page( 'monsterinsights-dashboard-widget', '', '0' );\n\t\t\tmonsterinsights_settings_inline_js();\n\t\t}\n\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "abstract public function getWidget() : string;", "public function run() {\r\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\r\n\t\t$contents=ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\tif($this->activeDataProvider === null) {\r\n\t\t\techo $contents;\r\n\t\t} else {\r\n\t\t\tif(($this->hideOnEmpty === true) && ($this->activeDataProvider->totalItemCount == 0)) {\r\n\t\t\t\techo $contents;\r\n\t\t\t} else {\r\n\t\t\t\t$this->render('TableWidget', array(\r\n\t\t\t\t\t'activeDataProvider' => $this->activeDataProvider,\r\n\t\t\t\t\t'fields' => $this->getFields(),\r\n\t\t\t\t\t'title' => $this->title,\r\n\t\t\t\t\t'pagination' => $this->enablePagination,\r\n\t\t\t\t\t'catalog' => $this->getCatalog(),\r\n\t\t\t\t\t'htmlOptions' => $this->htmlOptions,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function retrieve_widgets()\n {\n }", "protected function retrieve_widgets()\n {\n }", "function getDisplay() {\n\t\t$content = \"<h3>\" . $this->widgetTitle . \"</h3>\";\n\n\t\tif (!empty($this->facebookUrl) && \n\t\t\ttrim($this->facebookUrl) !== '') {\n\t\t\t$content .= '<span class=\"social-pages-icon social-page-facebook\"><a href=\"' . $this->facebookUrl . '\" ><i class=\"fa fa-facebook\"></i></a></span>';\n\t\t}\n\t\tif (!empty($this->twitterUrl) && \n\t\t\t\ttrim($this->twitterUrl) !== '') {\n\t\t\t$content .= '<span class=\"social-pages-icon social-page-twitter\"><a href=\"' . $this->twitterUrl . '\" ><i class=\"fa fa-twitter\"></i></a></span>';\n\t\t}\n\t\tif (!empty($this->googleplusUrl) && \n\t\t\ttrim($this->googleplusUrl) !== '') {\n\t\t\t$content .= '<span class=\"social-pages-icon social-page-google\"><a href=\"' . $this->googleplusUrl . '\" ><i class=\"fa fa-google\"></i></a></span>';\n\t\t}\n\n\t\treturn $content;\n\t}", "public function renderWidget()\n {\n $id = $this->attr['id'];\n $name = $this->attr['name'];\n $contents = '';\n $values = $this->getValue();\n foreach ( $this->params['choices'] as $key => $label )\n {\n $options = $this->params;\n $options['attr'] = $this->attr;\n $options['attr']['id'] = $id . \"_$key\";\n $options['attr']['name'] = $name . \"[$key]\";\n $options['attr']['value'] = $key;\n if ( isset( $values[$key] ) && $values[$key] )\n {\n $options['attr']['checked'] = 'checked';\n }\n $widget = new InputCheckboxWidget( $options );\n $contents .= HtmlToolkit::buildTag( 'label', array(), false, $widget->render() . ' ' . $label );\n }\n\n return $contents;\n }", "public function renderWidgets()\r\n {\r\n foreach ($this->_widgets as $widget)\r\n {\r\n echo current($widget);\r\n }\r\n\r\n }", "public function render_content() {\n\t\t?>\n\t\t\t<input\n\t\t\t\tid=\"_customize-input-gutenberg_widget_blocks\"\n\t\t\t\ttype=\"hidden\"\n\t\t\t\tvalue=\"<?php echo esc_attr( $this->value() ); ?>\"\n\t\t\t\t<?php $this->link(); ?>\n\t\t\t/>\n\t\t<?php\n\t\tthe_gutenberg_widgets( 'gutenberg_customizer' );\n\t}", "function ssl_widget() {\r\n $widget_ops = array('classname' => 'ssl_widget', 'description' => __('widget that display a slideshow from all attachments','ssl-plugin') ); \r\n $this->WP_Widget('ssl_widget', __('Siteshow Widget','ssl-plugin'), $widget_ops);\r\n }", "function widgetControlOutput( ) {\r\n\t\t\t$options = get_option( 'ILuvWalking.com Widget' );\r\n\t\t\tif( isset( $_POST[ \"iluvwalking-com-submit\" ] ) ) {\r\n\t\t\t\t$options[ 'title' ] = strip_tags( stripslashes( $_POST[ 'iluvwalking-com-title' ] ) );\r\n\t\t\t\t$options[ 'name' ] = strip_tags( stripslashes( $_POST[ 'iluvwalking-com-name' ] ) );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tupdate_option( 'ILuvWalking.com Widget', $options );\r\n\t\t\t\r\n\t\t\t$title = attribute_escape( $options[ 'title' ] );\r\n\t\t\t$name = attribute_escape( $options[ 'name' ] );\r\n\t\t\t\r\n\t\t\tinclude ( 'views/widget-control.php' );\r\n\t\t}", "public static function widget() {\n //require_once( 'widget.php' );\n require_once get_stylesheet_directory() . '/inc/templates/statistics_widget.php';\n }", "private function _render()\n {\n $content = '';\n\n if (is_array($this->widgets)) {\n // clean path vars\n self::_clean_paths();\n\n foreach ($this->widgets as $parts) {\n\n $content = '';\n\n $type = (array_key_exists('type', $parts)) ? $parts['type'] : '';\n $src = (array_key_exists('src', $parts)) ? $parts['src'] : '';\n $title = (array_key_exists('title', $parts)) ? $parts['title'] : '';\n $alt = (array_key_exists('alt', $parts)) ? $parts['alt'] : 1;\n $cols = (array_key_exists('cols', $parts)) ? $parts['cols'] : 1;\n\n // process action commands (these don't follow the convention of standard widgets)\n switch ($type) {\n case 'clear':\n // push content directly into dashboard array\n $content = \"<div style='clear:both'></div>\";\n $this->_dashboard[] = $content;\n continue 2;\n break;\n }\n\n // check if individual keys supplied instead of an array of values\n if (array_key_exists('src', $parts)) {\n\n // individual keys supplied so construct appropriate array\n $parts = array(array('type'=>$type, 'src'=>$src, 'alt'=>$alt));\n }\n\n // process each part\n foreach ($parts as $part) {\n\n if (! is_array($part)) continue;\n\n // add any part-specific sub-headings as <H3>\n $content .= (array_key_exists('title', $part)) ? \"<\".$this->widget_subheading.\">\".$part['title'].\"</\".$this->widget_subheading.\">\" : '';\n\n switch ($part['type']) {\n //======================================\n case 'oop':\n //======================================\n\n // run an external controller to produce widget contents\n if ($this->oop_alt) {\n // alternative location will be:\n // [oop_path]/[dashboard_folder]/[dashboard_name]/[controller_name].[ext]\n // eg. [application/controllers]/[dashboard]/[safety]/[test_dash].[php]\n $file_name = $this->_makepath($this->oop_path, $this->dash_fldr, $this->dash).$part['src'].EXT;\n\n } else {\n\n // normal location will be\n // [oop_path]/[dashboard_name]/[dashboard_folder]/[controller_name].[ext]\n // eg. [application/controllers]/[safety]/[dashboard]/[test_dash].[php]\n $file_name = $this->_makepath($this->oop_path, $this->dash, $this->dash_fldr).$part['src'].EXT;\n }\n\n if (file_exists($file_name)) {\n\n include_once $file_name;\n\n // create an instance of the controller so we can run it\n $cname = ucfirst($part['src']);\n $c = new $cname;\n\n // always run the index() method to build content\n $content .= $c->index();\n\n } else {\n\n $content .= 'WARNING: Unable to find controller: '.$file_name;\n }\n\n break;\n\n //======================================\n case 'html':\n //======================================\n\n // html or text content being directly supplied from controller\n $content .= $part['src'];\n\n break;\n\n //======================================\n case 'curl':\n //======================================\n\n // html or text content being directly supplied from controller\n $content .= $this->_curl_response($part['src']);\n\n break;\n\n //======================================\n case 'img':\n //======================================\n\n // create an <img> tag widget referencing an external image file\n // $img_file = (array_key_exists('src', $part)) ? $this->_makepath($this->asset_path, $this->img_path.PS.$this->dash.PS.$this->dash_fldr.PS.$part['src'] : '';\n $img_file = (array_key_exists('src', $part)) ? $this->_makepath($this->asset_path, $this->img_path, $this->dash, $this->dash_fldr).$part['src'] : '';\n $img_alt = (array_key_exists('alt', $part)) ? $part['alt'] : '';\n\n if (file_exists(FCPATH.$img_file)) {\n\n $content .= \"<img src='\".$img_file.\"' width='100%' alt='{$img_alt}' title='{$img_alt}' class='modalview' type='image' />\";\n\n } else {\n\n $content = 'WARNING: Unable to find img: '.FCPATH.$img_file;\n }\n\n break;\n\n //======================================\n case 'file':\n //======================================\n\n // pull widget contents directly from an external file\n $file_name = (array_key_exists('src', $part)) ? $this->_makepath(FCPATH.$this->asset_path, $this->file_path, $this->dash, $this->dash_fldr).$part['src'] : '';\n\n if (file_exists($file_name)) {\n $content .= file_get_contents($file_name);\n\n } else {\n\n $content .= 'WARNING: Unable to find file: '.$file_name;\n }\n\n break;\n }\n }\n\n // add this widget to dashboard\n $this->_dashboard[] = $this->_widget($title, $content, $cols);\n }\n }\n\n return $content;\n }", "function dashboard_widget() {\n\t\tif(!empty($this->options['stats_last_cache'])):\n\t\t\t$last_cache = '<em>Last Updated ' . date(\"m/d/y @ h:i:s\", $this->options['stats_last_cache']) . '</em>';\n\t\telse:\n\t\t\t$last_cache = '';\n\t\tendif;\n\t\twp_add_dashboard_widget('escalate_network_stats', 'Escalate Network Stats'.$last_cache, array($this,'dashboard_widget_display'));\t\n\t}", "function box_widget(){\n\t$CI=& get_instance();\n\treturn $CI->parser->parse('layout/ddi/box_widget.html', $CI->data,true);\n}", "protected function get_widgets()\n {\n }", "public function fetchWidget() {\n $html = '';\n $in_dashboard = $readonly = true;\n $store_in_session = false;\n $html .= $this->fetchCharts($this->report->getMatchingIds(), $in_dashboard, $readonly, $store_in_session);\n $html .= $this->fetchWidgetGoToReport();\n return $html;\n }", "function widget( $args, $instance ) {\n\n\t\t\textract( $args );\n\n\t\t\tstatic $counters = array();\n\n\t\t\t$label = $instance['type'].'-'.$instance['rsr-id'];\n\n\n\n\t\t\t/* reset offset counter if rsr-id or type has changed */\n\t\t\tif (!isset($counters[$label])) {\n \t\t\t$counters[$label] = 0;\n \t\t}\n\n\n\n \t\tif(!isset($instance['type-text'])){\n \t\t\t$instance['type-text'] = '';\n \t\t}\n\n \t\t$instance['offset'] = $counters[$label];\n\n \t\t/* get the ajax url for the card widget */\n \t\t$akvo_card_obj = new Akvo_Card;\n \t\t$url = $akvo_card_obj->get_ajax_url('akvo_card', $instance, array('panels_info'));\n\n\n \t\techo \"<div data-behaviour='reload-html' data-url='\".$url.\"'></div>\";\n\n \t\t$counters[$label]++;\n\t\t}", "function wp_render_widget_control($id)\n {\n }", "function rad_widget_content(){\n\t//show an RSS feed\n\twp_widget_rss_output( 'http://wordpress.melissacabral.com/feed/', array(\n\t\t'items' \t\t=> 7,\n\t\t'show_summary' \t=> true,\n\t\t'show_date'\t\t=> true,\n\t\t'show_author'\t=> true,\n\t) );\n}", "public function indexAction()\n {\n $this->view->widget = $this->_getWidget();\n }", "public function view() {\n \n // Get the user's plan\n $user_plan = get_user_option( 'plan', $this->CI->user_id );\n \n // Get plan end\n $plan_end = get_user_option( 'plan_end', $this->CI->user_id );\n \n // Get plan data\n $plan_data = $this->CI->plans->get_plan( $user_plan );\n \n // Set widgets\n $widgets = array();\n \n // Get default widgets\n $default_widgets = array();\n \n if ( get_option('app_dashboard_left_side_position') && get_option('app_dashboard_enable_default_widgets') ) {\n\n $full_size = 'col-xl-5';\n\n $plan_data[0]['size'] = 6;\n\n } else {\n\n $full_size = 'col-xl-12';\n\n $plan_data[0]['size'] = 3;\n\n } \n\n if ( get_option('app_dashboard_enable_default_widgets') ) {\n \n foreach ( glob(MIDRUB_DASHBOARD_APP_PATH . '/widgets/*.php') as $filename ) {\n\n $className = str_replace( array( MIDRUB_DASHBOARD_APP_PATH . '/widgets/', '.php' ), '', $filename );\n\n // Create an array\n $array = array(\n 'MidrubApps',\n 'Collection',\n 'Dashboard',\n 'Widgets',\n ucfirst($className)\n ); \n\n // Implode the array above\n $cl = implode('\\\\',$array);\n\n // Instantiate the class\n $response = (new $cl())->display_widget( $this->CI->user_id, $plan_end, $plan_data );\n\n // Add widget to $default_widgets array\n $default_widgets[$response['order']] = $response['widget'];\n\n }\n\n arsort($default_widgets);\n \n if ( $default_widgets ) {\n \n $widgets[0] = '<div class=\"' . $full_size . ' col-lg-12 col-md-12 stats\">'\n . '<div class=\"row\">';\n\n $i = 0;\n \n foreach ( $default_widgets as $widget ) {\n \n if ( get_option('app_dashboard_left_side_position') && $i % 1 ) {\n \n $widgets[0] .= '</div><div class=\"row\">';\n \n }\n \n $widgets[0] .= $widget;\n \n $i++;\n \n }\n \n $widgets[0] .= '</div>'\n . '</div>';\n \n }\n \n }\n \n $apps_widgets = array();\n \n foreach ( glob( MIDRUB_APPS_PATH . '/collection/*') as $directory ) {\n\n $dir = str_replace( MIDRUB_APPS_PATH . '/collection/', '', $directory );\n \n if ( !get_option('app_' . $dir . '_enable') || !plan_feature('app_' . $dir) ) {\n continue;\n }\n\n if ( $dir === 'dashboard' ) {\n \n continue;\n \n } else {\n \n // Create an array\n $array = array(\n 'MidrubApps',\n 'Collection',\n ucfirst($dir),\n 'Main'\n ); \n\n // Implode the array above\n $cl = implode('\\\\',$array);\n\n // Instantiate the class\n $response = (new $cl())->widgets( $this->CI->user_id, $plan_end, $plan_data );\n \n foreach ( $response as $key => $value ) {\n \n // Add widget to $apps_widgets array\n $apps_widgets[$key] = $value;\n \n }\n \n }\n\n }\n\n if ( $apps_widgets ) {\n \n arsort($apps_widgets);\n \n $e = 0;\n \n foreach ( $apps_widgets as $key_w => $value_w ) {\n\n if ( $full_size === 'col-xl-5' && $e === 0 ) {\n\n if ( !isset($widgets[0]) ) {\n $widgets[0] = '';\n }\n \n $widgets[0] .= str_replace( '[xl]', '7', $value_w['widget'] );\n \n } else {\n \n $widgets[$key_w] = str_replace( '[xl]', '12', $value_w['widget'] );\n \n }\n \n if ( $value_w['styles_url'] && !in_array( $value_w['styles_url'], $this->css_urls_widgets ) ) {\n $this->css_urls_widgets[] = $value_w['styles_url'];\n }\n \n if ( $value_w['js_url'] && !in_array( $value_w['js_url'], $this->js_urls_widgets ) ) {\n $this->js_urls_widgets[] = $value_w['js_url'];\n } \n \n $e++;\n \n }\n \n }\n \n $this->CI->user_header = user_header();\n \n $this->CI->user_header['app'] = 'dashboard';\n \n $expired = 0;\n \n $expires_soon = 0;\n \n if ( $plan_end ) {\n \n if ( strtotime($plan_end) < time() ) {\n \n $this->CI->plans->delete_user_plan($this->CI->user_id);\n redirect('user/app/dashboard');\n \n } elseif ( strtotime($plan_end) < time() + 432000 ) {\n \n $expires_soon = 1;\n \n }\n \n }\n \n // Making temlate and send data to view.\n $this->CI->template['header'] = $this->CI->load->view('user/layout/header', array('app_styles' => $this->assets_css(), 'title' => $this->CI->lang->line('dashboard')), true);\n $this->CI->template['left'] = $this->CI->load->view('user/layout/left', $this->CI->user_header, true);\n $this->CI->template['body'] = $this->CI->load->ext_view( MIDRUB_DASHBOARD_APP_PATH . '/views', 'main', array('widgets' => $widgets, 'expired' => $expired, 'expires_soon' => $expires_soon), true);\n $this->CI->template['footer'] = $this->CI->load->view('user/layout/footer', array('app_scripts' => $this->assets_js()), true);\n $this->CI->load->ext_view( MIDRUB_DASHBOARD_APP_PATH . '/views/layout', 'index', $this->CI->template);\n \n }", "public function widget( $args, $instance ){}", "function docuemtation_dashboard_widget_function() {\n\t// Display whatever it is you want to show\n\techo 'Make sure you watch the videos in 720p resolution.<br/>\n<a href=\"http://youtu.be/vA3fXuhbmjg\" target=\"_blank\">Welcome and Workflow</a> (1:32)<br/>\n<a href=\"http://youtu.be/1EYJ2xuJOB4\" target=\"_blank\">Resize Images</a> (3:55)<br/>\n<a href=\"http://youtu.be/KVGK5FKm-Ng\" target=\"_blank\">Upload Images to Dropbox</a> (1:10)<br/>\n<a href=\"http://youtu.be/g_XfK9iLv7s\" target=\"_blank\">The Dashboard</a> (3:53)<br/>\n<a href=\"http://youtu.be/ZntfnFEocn8\" target=\"_blank\">Writing and Saving a Draft</a> (6:10)<br/>\n<a href=\"http://youtu.be/vSx0xOQms78\" target=\"_blank\">Changing Post Status</a> (0:34)<br/>\n<a href=\"http://youtu.be/GZvMRQlP-9c\" target=\"_blank\">Upload to and Crop Images on Website</a> (5:46)<br/>\n<a href=\"http://youtu.be/zrBjk92WQB4\" target=\"_blank\">Publish Cat Profile</a> (1:12)<br/>\nCreate a PDF of profile (later, I have to make a few modifications first)';\n}", "function widget( $args, $instance ) {\n\n \textract($args);\n \t$title = apply_filters('widget_title', $instance['title'] );\n \t$num_articles = $instance['num_articles'];\n \t$display_image = $instance['display_image'];\n\n \t$options = get_option('pgnyt_articles');\n \t$pgnyt_results = $options['pgnyt_results'];\n\n \trequire ('inc/front-end.php');\n }", "public function render( ){\n\t\treturn $this->__childWidget->render();\n\t}", "public function widgets() {\r\n\t\t// Make sure the user has capability.\r\n\t\tif ( Permission::user_can( 'analytics' ) || ! is_admin() ) {\r\n\t\t\t// Most popular contents.\r\n\t\t\tregister_widget( Widgets\\Popular::instance() );\r\n\t\t}\r\n\t}", "public function render_content() {\n?>\n\t\t\t<label>\n <p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "public function tally_rendered_widgets($widget)\n {\n }", "abstract public function widget_markup( $args, $instance );", "public function output(WidgetInterface $widget);", "function dashboard_widget_display() {\n\t\techo '<div class=\"escalate-dashboard-loading\">Loading Stats</div>';\n\t}", "public function output_widget_control_templates()\n {\n }", "public function renderWidget()\n {\n if ($this->data !== null) {\n $this->htmlAttributes['value'] = $this->data;\n }\n\n // And to be sure to generate a proper html text input with the proper name...\n $this->htmlAttributes['type'] = $this->type;\n $this->htmlAttributes['name'] = $this->name;\n $this->htmlAttributes['id'] = $this->getId();\n\n $output = '<input ';\n\n $output .= $this->renderHtmlAttributes();\n\n $output .= '/>';\n\n return $output;\n }", "public function actionIndex()\n {\n return $this->render('@gilek/gtreetable/views/widget', ['options'=>[\n 'manyroots' => true,\n 'draggable' => true\n ]]);\n }", "public function render_content()\n\t\t{ ?>\n\t\t\t<label>\n <span class=\"customize-control-title\"><?php echo esc_html( $this->description ); ?></span>\n <p class=\"description\">\n <span class=\"typography-size-label\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\"><input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "function wf_template_widget($retData=false) {\n\t\tglobal $post;\n\t\t\n\t\t$error = 'Error while adding the widget, please report to <a href=\"http://blog.wanderfly.com/wordpress-plugin/\">http://blog.wanderfly.com/wordpress-plugin/</a>.';\n\t\t$widgetHTML = false;\n\t\t\n\t\tif($post) {\n\t\t\t//Get the Destination ID from the post's metas,\n\t\t\t$wf_meta = get_post_meta($post->ID, \"wf_destination\", true);\n\t\t\t\n\t\t\t//Display the wanderfly widget,\n\t\t\tif($wf_meta) {\n\t\t\t\t$wf_metas = explode(':', $wf_meta);\n\t\t\t\t$widgetHTML = wf_widget($wf_metas[0]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//Echo the widget,\n\t\tif($widgetHTML !== false) {\n\t\t\tif($retData) { return $widgetHTML; }\n\t\t\telse { echo $widgetHTML; }\n\t\t}\n\t\t//Return the widget's HTML,\n\t\telse {\n\t\t\tif($retData) { return $widgetHTML; }\n\t\t\telse { echo $error; }\n\t\t}\n\t\t\n\t}", "function widget( $args, $instance ) {\n // kick things off\n extract( $args );\n echo $before_widget; \n echo $before_title . $after_title; \n\n ?>\n <?php //Example html markup to show on the website ?>\n <ul class=\"infopage-list\">\n <li>\n <div>\n <img src=\"<?php echo get_stylesheet_directory_uri(); ?>/dist/img/ico_phone.svg\" alt=\"\">\n </div>\n <div>\n Llámanos<br><a href=\"tel:<?php echo $instance[\"phone\"]; ?>\"><?php echo $instance[\"phone\"]; ?></a>\n </div>\n </li>\n <li>\n <div>\n <img src=\"<?php echo get_stylesheet_directory_uri(); ?>/dist/img/ico_mail.svg\" alt=\"\">\n </div>\n <div>\n Escríbenos<br><a href=\"mailto:<?php echo $instance[\"email\"]; ?>\"><?php echo $instance[\"email\"]; ?></a>\n </div>\n </li>\n <li>\n <div>\n <img src=\"<?php echo get_stylesheet_directory_uri(); ?>/dist/img/ico_direccion.svg\" alt=\"\">\n </div>\n <div>\n Encuéntranos<br><a target=\"_blank\" href=\"<?php echo $instance[\"gmaps_link\"]; ?>\"><?php echo $instance[\"address\"]; ?></a>\n </div>\n </li>\n </ul>\n\t <?php\n\n }", "public function Show(){\n\t\techo(\"\n\t\t<div class='$this->claseCSS'>\n\t\t<div class='WidgetTitle'><a id='TitleBlock' href='$this->masURL'><div id='TitleText'>$this->Titulo</div></a></div>\n\t\t\t$this->Contenido\n\t\t\t<div class='footer'><a href='$this->masURL'>Ver m&aacute;s...</a></div>\n\t\t</div>\n\t\t\");\n\t}", "public function index()\n {\n $widgetsFrontend = Widgets::frontend()->all();\n $widgetsBackend = Widgets::backend()->all();\n\n return view_backend('widget.index', compact('widgetsFrontend', 'widgetsBackend'));\n }", "public function run()\n {\n $categories = \\App\\Models\\Category::with('categories')->where('id_parent', 0)->where('status', 1)->orderBy('sort')->get();\n\n return view(\"widgets.catalog_widget\", [\n 'config' => $this->config, 'categories' => $categories\n ]);\n }", "function widget($args, $instance) {\n $feedData = $this->_collect_data($instance);\n $this->_print_widget($args, $instance, $feedData);\n }", "public function render_content() { ?>\n\t\t\t<label>\n <p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n <span class=\"px\">&percnt;</span>\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "function scoreboard_widget() {\r\n\r\n\techo\"<div class='widget'><h2>Scoreboard</h2><img src='http://www.bollywoodjalwa.com/cricket-widget.php'></div>\";\r\n\r\n}", "public function dashboard_widget_control() {\n\t\tif ( !$widget_options = get_option( 'vfb_dashboard_widget_options' ) )\n\t\t\t$widget_options = array();\n\n\t\tif ( !isset( $widget_options['vfb_dashboard_recent_entries'] ) )\n\t\t\t$widget_options['vfb_dashboard_recent_entries'] = array();\n\n\t\tif ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['vfb-widget-recent-entries'] ) ) {\n\t\t\t$number = absint( $_POST['vfb-widget-recent-entries']['items'] );\n\t\t\t$widget_options['vfb_dashboard_recent_entries']['items'] = $number;\n\t\t\tupdate_option( 'vfb_dashboard_widget_options', $widget_options );\n\t\t}\n\n\t\t$number = isset( $widget_options['vfb_dashboard_recent_entries']['items'] ) ? (int) $widget_options['vfb_dashboard_recent_entries']['items'] : '';\n\n\t\techo sprintf(\n\t\t\t'<p>\n\t\t\t<label for=\"comments-number\">%1$s</label>\n\t\t\t<input id=\"comments-number\" name=\"vfb-widget-recent-entries[items]\" type=\"text\" value=\"%2$d\" size=\"3\" />\n\t\t\t</p>',\n\t\t\t__( 'Number of entries to show:', 'visual-form-builder-pro' ),\n\t\t\t$number\n\t\t);\n\t}", "function widget( $args, $instance ) {\r\n extract( $args );\r\n /* Our variables from the widget settings. */\r\n $title = apply_filters('widget_name', $instance['title'] );\r\n $type = $instance['type'];\r\n $style = $instance['style'];\r\n $limit = $instance['limit'];\r\n echo $before_widget;\r\n echo $this->showWidget($title, $type, $style, $limit);\r\n echo $after_widget;\r\n }", "function widget($args, $instance) {\n extract( $args, EXTR_SKIP );\n //echo $before_widget;\n include(plugin_dir_path(__FILE__) . '/views/'. $instance['display'] .'.php' );\n// echo $after_widget;\n}", "public function html()\n {\n $random_quote = $this->randomQuote();\n $cp_path = CP_ROUTE;\n return $this->view('widget', compact('random_quote','cp_path'))->render();\n }", "function wpb_load_widget() {\n\t\tregister_widget( 'dmv_widget' );\n\t}", "function widget( $args, $instance ) {\n\n\t\t$cache = wp_cache_get( $this->plugin_name, 'widget' );\n\n\t\tif ( ! is_array( $cache ) ) {\n\n\t\t\t$cache = array();\n\n\t\t}\n\n\t\tif ( ! isset ( $args['widget_id'] ) ) {\n\n\t\t\t$args['widget_id'] = $this->plugin_name;\n\n\t\t}\n\n\t\tif ( isset ( $cache[ $args['widget_id'] ] ) ) {\n\n\t\t\treturn print $cache[ $args['widget_id'] ];\n\n\t\t}\n\n\t\textract( $args, EXTR_SKIP );\n\n\t\t$widget_string = $before_widget;\n\n\t\t// Manipulate widget's values based on their input fields here\n\n\t\tob_start();\n\n\t\tinclude( plugin_dir_path( __FILE__ ) . 'partials/job-search-display-widget.php' );\n\n\t\t$widget_string .= ob_get_clean();\n\t\t$widget_string .= $after_widget;\n\n\t\t$cache[ $args['widget_id'] ] = $widget_string;\n\n\t\twp_cache_set( $this->plugin_name, $cache, 'widget' );\n\n\t\tprint $widget_string;\n\n\t}", "function ApontadorWidget() {\n $widget_ops = array('classname' => 'apontador_widget', 'description' => __( \"Display your reviews from Apontador\", \"wp-apontador\") );\n $control_ops = array('width' => 300, 'height' => 300);\n $this->WP_Widget('apontador', __('Apontador Reviews', \"wp-apontador\"), $widget_ops, $control_ops);\n\n }", "public function widget( $args, $instance ) {\n\t$title = apply_filters( 'widget_title', $instance['title'] );\n\t// before and after widget arguments are defined by themes\n\t\techo $args['before_widget'];\n\t\t\tif ( ! empty( $title ) )\n\t\t\t\techo $args['before_title'] . $title . $args['after_title'];\n\t// This is where you run the code and display the output\n\t\t\t\techo '<div class=\"schemabiz\" itemscope itemtype=\"https://schema.org/LocalBusiness\">';\n//Business image \nif (get_theme_mod('diz-nav-logo')) {\n echo '<figure itemprop=\"image\" itemscope itemtype=\"http://schema.org/ImageObject\"><img src=\"';\n echo get_theme_mod('diz-nav-logo');\n echo '\" alt=\"';\n if (get_theme_mod( 'ds_busname_setting', '' )) {\n echo get_theme_mod( 'ds_busname_setting', '' );\n } else { \n echo wp_title();\n }\n echo '\" itemprop=\"url\"/></figure>';\n }\n//Business name\nif (get_theme_mod('ds_busname_setting')) {\n echo '<h3 class=\"s-name\" itemprop=\"name\">';\n echo get_theme_mod( 'ds_busname_setting', '' );\n echo '</h3>';\n} else {\n echo '<h3 class=\"s-name\" itemprop=\"name\">';\n echo wp_title();\n echo '</h3>';\n}\n echo '<ul>';\n//Business address\nif (get_theme_mod('ds_busadd_setting')) {\n echo '<li itemprop=\"address\"><i class=\"fas fa-map-marker-alt prelo\"></i> <address>';\n if (get_theme_mod('ds_busadd_map_setting')) {\n echo '<a href=\"';\n echo get_theme_mod( 'ds_busadd_map_setting', '' );\n echo '\">';\n echo get_theme_mod( 'ds_busadd_setting', '' );\n echo '</a>';\n } else {\n echo get_theme_mod( 'ds_busadd_setting', '' );\n }\n echo '</address></li>';\n}\n//Hours\nif (get_theme_mod('ds_bushours_setting')) {\n echo '<li itemprop=\"openingHours\" datetime=\"';\n echo get_theme_mod( 'ds_bushours_setting', '' );\n echo '\"><i class=\"fas fa-clock prelo\"></i>';\n echo get_theme_mod( 'ds_bushours_setting', '' );\n echo '</li>';\n}\n//Phone\nif (get_theme_mod('ds_busphone_setting')) {\n echo '<li itemprop=\"telephone\"><i class=\"fas fa-mobile-alt prelo\"></i> <a href=\"tel:';\n echo get_theme_mod( 'ds_busphone_setting', '' );\n echo '\">';\n echo get_theme_mod( 'ds_busphone_setting', '' );\n echo '</a></li>';\n}\n//FAX\nif (get_theme_mod('ds_busfax_setting')) {\n echo '<li itemprop=\"faxNumber\"><i class=\"fas fa-fax prelo\"></i> ';\n echo get_theme_mod( 'ds_busfax_setting', '' );\n echo '</li>';\n}\n//Email\nif (get_theme_mod('ds_busemail_setting')) {\n echo '<li itemprop=\"email\"><i class=\"far fa-envelope-open prelo\"></i> <a href=\"mailto:';\n echo get_theme_mod( 'ds_busemail_setting', '' );\n echo '\">Email ';\n if (get_theme_mod('ds_busname_setting')) {\n echo get_theme_mod( 'ds_busname_setting', '' );\n } else {\n echo wp_title();\n }\n echo '</a></li>';\n}\n//Social networks\n echo '<li class=\"sch-social\"><h3>Connect On Social Media</h3>';\n echo do_shortcode(\"[dizzy-social]\");\n echo '</li></ul></div>';\n\techo $args['after_widget'];\n}", "function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}", "function skcw_widget_descriptions() {\n\t$templates = get_option('skcw_templates_list');\n\tinclude(SKCW_DIR.'views/widget-page-view.php');\n}", "public function dashboard_widget_control() {\n if (!$widget_options = get_option('swpm_dashboard_widget_options'))\n $widget_options = array();\n\n if (!isset($widget_options['swpm_dashboard_recent_entries']))\n $widget_options['swpm_dashboard_recent_entries'] = array();\n\n if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['swpm-widget-recent-entries'])) {\n $number = absint($_POST['swpm-widget-recent-entries']['items']);\n $widget_options['swpm_dashboard_recent_entries']['items'] = $number;\n update_option('swpm_dashboard_widget_options', $widget_options);\n }\n\n $number = isset($widget_options['swpm_dashboard_recent_entries']['items']) ? (int) $widget_options['swpm_dashboard_recent_entries']['items'] : '';\n\n echo sprintf(\n '<p>\n\t\t\t<label for=\"comments-number\">%1$s</label>\n\t\t\t<input id=\"comments-number\" name=\"swpm-widget-recent-entries[items]\" type=\"text\" value=\"%2$d\" size=\"3\" />\n\t\t\t</p>', __('Number of entries to show:', 'swpm-form-builder'), $number\n );\n }", "function sbc_connect_widget() {\n\n class connect_widget extends WP_Widget {\n\n function __construct() {\n parent::__construct(\n\n // Base ID of your widget\n 'connect_widget',\n\n // Widget name will appear in UI\n __('Connect', 'connect_widget_domain'),\n\n // Widget description\n array( 'description' => __( 'Insert your connect links with this widget', 'connect_widget_domain' ), )\n );\n }\n\n // Creating widget output\n public function widget( $args, $instance ) {\n $title = apply_filters( 'widget_title', $instance['title'] );\n\n // echo Title if Title\n echo $args['before_widget'];\n echo '<div class=\"connect-widget\">';\n if ( ! empty( $title ) ):\n echo $args['before_title'] . $title . $args['after_title'];\n endif;\n\n // echo social links if social links available in theme options\n if( have_rows('_about', 'option') ):\n while( have_rows('_about', 'option') ): the_row();\n if( have_rows('connect_media') ):\n// echo 'Follow Us: ';\n while( have_rows('connect_media') ): the_row();\n $link = get_sub_field('link');\n $platform = get_sub_field('platform');\n $icon = '<a href=\"' . $link . '\">' .\n '<i class=\"' . $platform . '\"></i>' .\n '</a>';\n echo $icon;\n endwhile;\n endif;\n endwhile;\n endif;\n\n // This is where you run the code and display the output\n// echo __( 'Hello, World!', 'connect_widget_domain' );\n echo $args['after_widget'];\n echo '</div>';\n }\n\n // Widget Backend\n public function form( $instance ) {\n if ( isset( $instance[ 'title' ] ) ) {\n $title = $instance[ 'title' ];\n }\n else {\n $title = __( 'New title', 'connect_widget_domain' );\n }\n // Widget admin form\n ?>\n <p>\n <label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" />\n </p>\n <?php\n }\n\n // Updating widget replacing old instances with new\n public function update( $new_instance, $old_instance ) {\n $instance = array();\n $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';\n return $instance;\n }\n\n } // close class\n\n // Register the widget\n register_widget( 'connect_widget' );\n\n}", "public function toHtml()\n {\n\n return access()->content ? view('admin.widgets.quick')->render() : null;\n\n }", "function itstar_widget() {\n register_widget( 'last_video_widget' );\n register_widget( 'last_posts_by_cat_widget' );\n register_widget( 'simple_button_widget' );\n}", "public function widget($args, $instance)\n {\n $title = apply_filters('widget_title', $instance['title']);\n// before and after widget arguments are defined by themes\n echo $args['before_widget'];\n if (!empty($title))\n echo $args['before_title'] . $title . $args['after_title'];\n?>\n <style>\n h4.ad-header-box{\n font-size: 14px;\n line-height: 30px;\n font-family: \"Helvetica\";\n color: #000000;\n border-bottom: none !important;\n text-align: center;\n font-weight: bold !important;\n }\n .widget-ad{\n text-align: center;\n }\n .clear{\n clear: both;\n }\n .title-box{\n line-height: 30px;\n }\n .title-box a{\n font-size: 17px;\n font-weight: bold;\n }\n .price{\n line-height: 20px;\n font-size: 15px;\n color: #e54d45 !important;\n }\n </style>\n <?php if(is_home()){ ?>\n <h4 class=\"ad-header-box\"><?php _e('Smart Box Gia Đình', 'mvp-text'); ?></h4>\n <div class=\"widget-ad\">\n <?php\n $f_api = \"https://nhacon.com/api/boxTemplate?nested=true&filter=[{'property':'root_category_id','value':8}]&ctime=1412737314465\";\n $family_box_data = $this->get_data_from_api($f_api);\n $f_box = $this->array_random($family_box_data->data->bundleTemplate);\n ?>\n <div class=\"image-box\">\n <img src=\"<?php echo $f_box->images[0]->image_url ?>\" />\n </div>\n <div class=\"clear\"></div>\n <div class=\"title-box\">\n <a target=\"_blank\" href=\"https://nhacon.com/boxdetail.html?id=<?php echo $f_box->id; ?>\">\n <?php echo $f_box->name; ?>\n </a>\n </div>\n <div class=\"clear\"></div>\n <div class=\"price\"><?php echo number_format($f_box->price,0,'.','.'); ?> VNĐ </div>\n </div><!--widget-ad-->\n <div class=\"clear\"></div>\n <h4 class=\"ad-header-box\"><?php _e('Smart Box Em Bé', 'mvp-text'); ?></h4>\n <div class=\"widget-ad\">\n <?php\n $b_api = \"https://nhacon.com/api/boxTemplate?nested=true&filter=[{'property':'root_category_id','value':1}]&ctime=1412737314465\";\n $baby_box_data = $this->get_data_from_api($b_api);\n $b_box = $this->array_random($baby_box_data->data->bundleTemplate);\n ?>\n <div class=\"image-box\">\n <img src=\"<?php echo $b_box->images[0]->image_url ?>\" />\n </div>\n <div class=\"clear\"></div>\n <div class=\"title-box\">\n <a target=\"_blank\" href=\"https://nhacon.com/boxdetail.html?id=<?php echo $b_box->id; ?>\">\n <?php echo $b_box->name; ?>\n </a>\n </div>\n <div class=\"clear\"></div>\n <div class=\"price\"><?php echo number_format($b_box->price,0,'.','.'); ?> VNĐ </div>\n </div>\n <div class=\"clear\"></div>\n <!--widget-ad-->\n <h4 class=\"ad-header-box\"><?php _e('Smart Box Làm Đẹp', 'mvp-text'); ?></h4>\n <div class=\"widget-ad\">\n <?php\n $m_api = \"https://nhacon.com/api/boxTemplate?nested=true&filter=[{'property':'root_category_id','value':2}]&ctime=1412737314465\";\n $beauty_box_data = $this->get_data_from_api($m_api);\n $m_box = $this->array_random($beauty_box_data->data->bundleTemplate);\n ?>\n <div class=\"image-box\">\n <img src=\"<?php echo $m_box->images[0]->image_url ?>\" />\n </div>\n <div class=\"clear\"></div>\n <div class=\"title-box\">\n <a target=\"_blank\" href=\"https://nhacon.com/boxdetail.html?id=<?php echo $m_box->id; ?>\">\n <?php echo $m_box->name; ?>\n </a>\n </div>\n <div class=\"clear\"></div>\n <div class=\"price\"><?php echo number_format($m_box->price,0,'.','.'); ?> VNĐ </div>\n </div><!--widget-ad-->\n <?php }else{ ?>\n <?php\n $category = get_the_category();\n if(empty($category[0]->parent)){\n $root_cat = $category[0];\n }else{\n $root_cat = $category[1];\n }\n ?>\n <?php if($root_cat->slug == 'em-be'){ ?>\n <h4 class=\"ad-header-box\"><?php _e('Smart Box Em Bé', 'mvp-text'); ?></h4>\n <div class=\"widget-ad\">\n <?php\n $b_api = \"https://nhacon.com/api/boxTemplate?nested=true&filter=[{'property':'root_category_id','value':1}]&ctime=1412737314465\";\n $baby_box_data = $this->get_data_from_api($b_api);\n $b_box = $this->array_random($baby_box_data->data->bundleTemplate);\n ?>\n <div class=\"image-box\">\n <img src=\"<?php echo $b_box->images[0]->image_url ?>\" />\n </div>\n <div class=\"clear\"></div>\n <div class=\"title-box\">\n <a target=\"_blank\" href=\"https://nhacon.com/boxdetail.html?id=<?php echo $b_box->id; ?>\">\n <?php echo $b_box->name; ?>\n </a>\n </div>\n <div class=\"clear\"></div>\n <div class=\"price\"><?php echo number_format($b_box->price,0,'.','.'); ?> VNĐ </div>\n </div>\n <?php } ?>\n <?php if($root_cat->slug == 'gia-dinh'){ ?>\n <h4 class=\"ad-header-box\"><?php _e('Smart Box Gia đình', 'mvp-text'); ?></h4>\n <div class=\"widget-ad\">\n <?php\n $f_api = \"https://nhacon.com/api/boxTemplate?nested=true&filter=[{'property':'root_category_id','value':8}]&ctime=1412737314465\";\n $family_box_data = $this->get_data_from_api($f_api);\n $f_box = $this->array_random($family_box_data->data->bundleTemplate);\n ?>\n <div class=\"image-box\">\n <img src=\"<?php echo $f_box->images[0]->image_url ?>\" />\n </div>\n <div class=\"clear\"></div>\n <div class=\"title-box\">\n <a target=\"_blank\" href=\"https://nhacon.com/boxdetail.html?id=<?php echo $f_box->id; ?>\">\n <?php echo $f_box->name; ?>\n </a>\n </div>\n <div class=\"clear\"></div>\n <div class=\"price\"><?php echo number_format($f_box->price,0,'.','.'); ?> VNĐ</div>\n </div>\n <?php } ?>\n <?php if($root_cat->slug == 'lam-dep'){ ?>\n <h4 class=\"ad-header-box\"><?php _e('Smart Box Làm đẹp', 'mvp-text'); ?></h4>\n <div class=\"widget-ad\">\n <?php\n $m_api = \"https://nhacon.com/api/boxTemplate?nested=true&filter=[{'property':'root_category_id','value':2}]&ctime=1412737314465\";\n $beauty_box_data = $this->get_data_from_api($m_api);\n $m_box = $this->array_random($beauty_box_data->data->bundleTemplate);\n ?>\n <div class=\"image-box\">\n <img src=\"<?php echo $m_box->images[0]->image_url ?>\" />\n </div>\n <div class=\"clear\"></div>\n <div class=\"title-box\">\n <a target=\"_blank\" href=\"https://nhacon.com/boxdetail.html?id=<?php echo $m_box->id; ?>\">\n <?php echo $m_box->name; ?>\n </a>\n </div>\n <div class=\"clear\"></div>\n <div class=\"price\"><?php echo number_format($m_box->price,0,'.','.'); ?> VNĐ </div>\n </div>\n <?php } ?>\n <?php } ?>\n <?php\n// This is where you run the code and display the output\n// echo __('Hello, World!', 'wpb_widget_domain');\n echo $args['after_widget'];\n }", "public function addWidget()\r\n {\r\n }", "function render_frontend(){\r\n if ($this -> type == 'textelement' || $this -> type == 'menu' || $this -> type == 'socialicons' || $this -> type == 'copyright' ) {\r\n if ($this -> text_align == 'left') {\r\n $text_align_class = 'align-left';\r\n }elseif ($this -> text_align == 'center'){\r\n $text_align_class = 'align-center';\r\n }elseif ($this -> text_align == 'right'){\r\n $text_align_class = 'align-right';\r\n }\r\n }else { $text_align_class = ''; } \r\n $type = $this -> type;\r\n echo '<div class=\"' . $this -> type . ' ' . $text_align_class . ' ' . LBRenderable::$words[ $this -> element_columns ] . ' columns\">';\r\n call_user_func( array ( $this, \"render_frontend_$type\" ) );\r\n echo '</div>';\r\n }", "public function render_content()\n\t\t{ ?>\n\t\t\t<label><p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?>\n </span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() );?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span></p></label> <?php // WPCS: XSS ok. ?>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "function widget( $args, $instance ) {\n extract( $args );\n\n /* Before widget (defined by themes). */\n echo $before_widget;\n\n echo $before_title . 'thunderstorm-stream' . $after_title;\n thunderstorm_stream_box();\n\n /* After widget (defined by themes). */\n echo $after_widget;\n }", "function spyropress_builder_render_widgets() {\n global $wp_registered_widgets;\n $content = '';\n\n // Sorting\n $sort = $wp_registered_widgets;\n usort( $sort, 'builder_module_name_sort' );\n $done = array();\n\n foreach ( $sort as $widget ) {\n $callback = $widget['callback'];\n if ( in_array( $callback, $done, true ) )\n continue;\n\n $done[] = $callback;\n $widget_obj = $callback[0];\n $class = get_class( $widget_obj );\n\n if( $class=='WP_Widget_Media_Image' || $class=='WP_Widget_Media_Gallery' || $class=='WP_Widget_Media_Audio' || $class=='WP_Widget_Media_Video')\n continue;\n /** Generate HTML **/\n $content .= sprintf( '\n <li class=\"module-item\">\n <a class=\"builder-module-insert\" href=\"#\" data-module-type=\"%1$s\">\n <span class=\"module-icon-widget\"></span>\n <span class=\"module-item-body\">\n <strong class=\"module-item-title\">%2$s</strong>\n <span class=\"module-item-description\">%3$s</span>\n </span>\n </a>\n </li>', $class, $widget_obj->name, esc_html( $widget_obj->\n widget_options['description'] ) );\n }\n\n echo tomato_html( $content );\n}", "function gardenia_load_widget() {\n\tregister_widget( 'gardenia_widget' );\n}", "public function _settings_field_webwidget_display() {\n global $zendesk_support;\n ?>\n <select name=\"zendesk-settings[webwidget_display]\" id=\"zendesk_webwidget_display\">\n <option\n value=\"none\" <?php selected( $zendesk_support->settings['webwidget_display'] == 'none' ); ?> ><?php _e( 'Do not display the Zendesk Widget anywhere', 'zendesk' ); ?></option>\n <option\n value=\"auto\" <?php selected( $zendesk_support->settings['webwidget_display'] == 'auto' ); ?> ><?php _e( 'Display the Zendesk Widget on all posts and pages', 'zendesk' ); ?></option>\n <option\n value=\"manual\" <?php selected( $zendesk_support->settings['webwidget_display'] == 'manual' ); ?> ><?php _e( 'I will decide where the Zendesk Widget displays using a template tag', 'zendesk' ); ?></option>\n </select>\n\n <?php\n }", "public function widget($args, $instance) {\n \n global $post;\n $meta = get_post_meta(get_the_ID());\n $categories = wp_get_post_terms($post->ID, 'components-category');\n $tags = get_the_terms($post->ID, 'components-tag');\n\n echo $args['before_widget'];\n echo $args['before_title'] . \"Component Overview\" . $args['after_title'];\n echo \"<ul>\";\n\n echo \"<li>\";\n echo \"<strong>Description</strong> : \";\n $description = get_post_meta($post->ID, \"_component_details_description\", true);\n if ($description) {\n echo $description;\n } else {\n echo \"No Description Available\";\n }\n echo \"</li>\";\n\n $version = get_post_meta($post->ID, \"_component_details_version\", true);\n if (!$version){\n $version = \"N/A\";\n }\n echo \"<li>\";\n echo \"<strong>Latest Version</strong> : $version\";\n echo \"</li>\";\n \n $itemCount = count($categories);\n $commaRange = $itemCount - 1;\n\n echo \"<li>\";\n echo \"<strong>Component Type</strong> : \";\n for ($i = 0; $i < $itemCount; $i++) {\n $name = $categories[$i]->name;\n $link = get_term_link($categories[$i]);\n echo \"<a href=\\\"$link\\\">$name</a>\";\n if ($i < $commaRange) {\n echo \", \";\n }\n }\n echo \"</li>\";\n\n\n if ($tags):\n echo \"<li> <strong>Keywords</strong> : \";\n $tagCount = count($tags);\n $commaRange = $tagCount - 1;\n for ($i = 0; $i < $tagCount; $i++) {\n $name = $tags[$i]->name;\n $link = get_term_link($tags[$i]);\n\n echo \"<a href=\\\"$link\\\">$name</a>\";\n if ($i < $commaRange)\n echo \", \";\n }\n\n echo \"</li>\";\n\n endif;\n\n echo \"</ul>\";\n \n\n echo $args['after_widget'];\n }", "function widget($args, $instance){\n\t\t\n\t\t$output = '<div id=\"fb_like_box\" class=\"xs-invisible hidden-xs hidden-sm widget fb_like_box clearfix\"><div class=\"mmb-vmenublockheader\"><h3 class=\"t\">facebook</h3></div><div id=\"fbHolder\" class=\"mmb-blockcontent\"><p>Carregant...</p></div></div>';\n\t\techo $args['before_widget'].$output.$args['after_widget'];\n\t}", "function gigx_dashboard_widget_function(){\n ?>\n <p>Enjoy your new website. If you've got any questions or encounter any bugs, please contact me at <a href=\"mailto:[email protected]\">[email protected]</a>.\n I will add a list of useful links and tutorials below, as well as any messages about updates.<br/><a href=\"http://axwax.de\" target=\"_blank\">Axel</a></p> \n <?php wp_widget_rss_output('http://www.axwax.de/category/support/history/feed/', array('items' => 5, 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1));\n}", "function portal_dashboard_overview_widget_function() {\n echo portal_populate_dashboard_widget();\n}", "function ftagementor_description_Widget() {\r\r\n register_widget( 'ftagementor_description_Widget' );\r\r\n}", "public function displayEventWidget($attrs) {\n $widget = new EventsWidget();\n \n ob_start();\n $widget->widget([], $attrs);\n return ob_get_clean();\n }", "function display() {\r\n\t\tparent::display ();\r\n\t}", "public function run() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\tif(\\Yii::app()->user->isGuest === true) {\n\t\t\techo $content;\n\t\t} else {\n\t\t\t$this->render('header');\n\t\t}\n\t}", "public function widgetContents($array);", "public function indexAction()\n {\n $contentTypes = $this->contentTypes();\n $model = $this->getModel('widget');\n $rowset = $model->select(array('type' => array_keys($contentTypes)));\n $widgets = array();\n foreach ($rowset as $row) {\n $widgets[$row->block] = $row->toArray();\n }\n if ($widgets) {\n $blocks = Pi::model('block_root')\n ->select(array('id' => array_keys($widgets)))->toArray();\n foreach ($blocks as $block) {\n $widgets[$block['id']]['block'] = $block;\n }\n }\n\n $data = array(\n 'widgets' => array_values($widgets)\n );\n\n $this->view()->assign('data', $data);\n $this->view()->setTemplate('ng');\n }", "public function widgetPopupHtml()\n {\n $widgetId = ipRequest()->getQuery('widgetId');\n $widgetRecord = \\Ip\\Internal\\Content\\Model::getWidgetRecord($widgetId);\n $widgetData = $widgetRecord['data'];\n\n // Populate form with proper fields\n switch ($widgetRecord['name']) {\n case 'ContentSection':\n //create form prepopulated with current widget data\n $form = $this->contentSectionManagementForm($widgetData);\n break;\n case 'ThreeItemListSection':\n $form = $this->threeItemManagementForm($widgetData);\n break;\n\n case 'Slider':\n $form = $this->sliderManagementForm($widgetData);\n break;\n case 'TopThreeSection':\n $form = $this->topThreeSectionManagementForm($widgetData);\n break;\n case 'ThumbnailCard':\n $form = $this->cardManagementForm($widgetData);\n break;\n default:\n $err = new \\Ip\\Response\\Json([\n 'error' => 'Unknown widget',\n 'widget' => $widgetRecord\n ]);\n $err->setStatusCode(400);\n return $err;\n }\n\n //Render form and popup HTML\n $viewData = array(\n 'form' => $form\n );\n $popupHtml = ipView('view/editPopup.php', $viewData)->render();\n $data = array(\n 'popup' => $popupHtml\n );\n //Return rendered widget management popup HTML in JSON format\n return new \\Ip\\Response\\Json($data);\n }", "function wpb_load_widget() {\n register_widget( 'lrq_widget' );\n }", "public function getWidget()\n\t{\n\t\treturn $this->widget;\n\t}", "public function getWidget(): \\WP_Widget{\n return $this->widget;\n }", "function radium_bbpress_widget_area_content() {\n\n echo '<div class=\"widget widget_text\"><div class=\"widget-wrap\">';\n\n echo '<div class=\"section-title\"><h4 class=\"widget-title\">';\n __( 'Forum Sidebar Widget Area', 'newsfront-bbpress' );\n echo '</h4></div>';\n\n echo '<div class=\"textwidget\"><p>';\n printf( __( 'This is the Forum Sidebar Widget Area. You can add content to this area by visiting your <a href=\"%s\">Widgets Panel</a> and adding new widgets to this area.', 'newsfront-bbpress' ), admin_url( 'widgets.php' ) );\n echo '</p></div>';\n echo '</div></div>';\n\n }", "function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}", "function widget($args, $instance) \r\n\t{\r\n extract( $args ); // Don't worry about this\r\n // Get our variables\r\n $title = apply_filters( 'widget_title', $instance['title'] );\r\n\t\t$icon_size = $instance['icon_size'];\r\n\t\t$icon_theme = $instance['icon_theme'];\r\n\t\t$icon_align = $instance['icon_align'];\r\n // This is defined when you register a sidebar\r\n echo $before_widget;\r\n // If our title isn't empty then show it\r\n if ( $title ) \r\n\t\t{\r\n echo $before_title . $title . $after_title;\r\n }\r\n\t\techo \"<style>\\n\";\r\n\t\techo \".\" . $this->get_field_id('widget') . \" img \\n{\\n\";\r\n\t\techo \"width:\" . $icon_size . \"px; \\n } \\n\";\r\n\t\techo \"</style>\";\r\n\t\techo \"<div id='acurax_si_widget_simple' class='acx_smw_float_fix \" . $this->get_field_id('widget') . \"'\";\r\n\t\tif($icon_align != \"\") { echo \" style='text-align:\" . $icon_align . \";'>\"; } else { echo \" style='text-align:center;'>\"; }\r\n\t\tacurax_si_widget_simple($icon_theme);\r\n\t\techo \"</div>\";\r\n // This is defined when you register a sidebar\r\n echo $after_widget;\r\n }", "function anariel_homesponsorstext_Widget() {\n\t\n\t\t/* Widget settings. */\n\t\t$widget_ops = array( 'classname' => 'anariel_homesponsorstext_widget', 'description' => __('Sponsors Text Block - place to add sposors text (we used this widget on home and about pages)', 'anariel') );\n\n\t\t/* Widget control settings. */\n\t\t$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'anariel_homesponsorstext_widget' );\n\n\t\t/* Create the widget. */\n\t\t$this->WP_Widget( 'anariel_homesponsorstext_widget', __('Anariel-Sponsors Text Widget', 'anariel'), $widget_ops, $control_ops );\n\t}", "function showWidget($login) {\n\t\t\n\t\t$window = HeadsUpWidget::Create($login);\n\t\t$window->setSize($this->config->width, 50);\n\t\t$window->setText($this->config->text);\n\t\t$window->setUrl($this->config->url);\n\t\t$pos = explode(\",\", $this->config->pos);\n\t\t$window->setPosition($pos[0], $pos[1]);\n\t\t$window->show();\n\t}", "function widget( $args, $instance ) {\r\n\t\textract( $args, EXTR_SKIP );\r\n\t\techo $before_widget;\r\n\t\techo '<p class=\"title\">Mt. Horeb United Methodist Church.</p>';\r\n\t\techo '<p>P: (803) 359-3495 &#124; F: (803) 359-2029</p>';\r\n\t\techo '<p>1205 Old Cherokee Rd.</p>';\r\n\t\techo '<p>Lexington, SC 29072</p>';\r\n\t\techo $after_widget;\r\n\t}", "function msdlab_homepage_widgets(){\n\tprint '<div id=\"homepage-widgets\" class=\"widget-area\">';\n\tprint '<div class=\"wrap\"><div class=\"row\">';\n dynamic_sidebar('homepage-widgets');\n \tprint '</div></div>';\n\tprint '</div>';\n}", "function widget($args, $instance) {\n extract($args, EXTR_SKIP);\n\n $divider = empty($instance['divider']) ? '' : $instance['divider'];\n // Before widget code, if any\n echo (isset($before_widget)?$before_widget:'');\n \n // PART 2: The title and the text output\n if ($divider == 'Solid') {\n echo '<div class=\"widget__divider\" id=\"widget__divider-solid\"><span></span></div>';\n } elseif ($divider == 'Dotted') {\n echo '<div class=\"widget__divider\" id=\"widget__divider-dotted\"><span></span></div>';\n } elseif ($divider == 'Dashed') {\n echo '<div class=\"widget__divider\" id=\"widget__divider-dashed\"><span></span></div>';\n } \n \n \n // KEEP: After widget code, if any \n echo (isset($after_widget)?$after_widget:'');\n }", "public function dashboard_widget() {\n\t\tglobal $wpdb;\n\n\t\t// Get the date/time format that is saved in the options table\n\t\t$date_format = get_option( 'date_format' );\n\t\t$time_format = get_option( 'time_format' );\n\n\t\t$widgets = get_option( 'vfb_dashboard_widget_options' );\n\t\t$total_items = isset( $widgets['vfb_dashboard_recent_entries'] ) && isset( $widgets['vfb_dashboard_recent_entries']['items'] ) ? absint( $widgets['vfb_dashboard_recent_entries']['items'] ) : 5;\n\n\t\t$forms = $wpdb->get_var( \"SELECT COUNT(*) FROM {$this->form_table_name}\" );\n\n\t\tif ( !$forms ) :\n\t\t\techo sprintf(\n\t\t\t\t'<p>%1$s <a href=\"%2$s\">%3$s</a></p>',\n\t\t\t\t__( 'You currently do not have any forms.', 'visual-form-builder-pro' ),\n\t\t\t\tesc_url( admin_url( 'admin.php?page=vfb-add-new' ) ),\n\t\t\t\t__( 'Get started!', 'visual-form-builder-pro' )\n\t\t\t);\n\n\t\t\treturn;\n\t\tendif;\n\n\t\t$entries = $wpdb->get_results( $wpdb->prepare( \"SELECT forms.form_title, entries.entries_id, entries.form_id, entries.sender_name, entries.sender_email, entries.date_submitted FROM $this->form_table_name AS forms INNER JOIN $this->entries_table_name AS entries ON entries.form_id = forms.form_id ORDER BY entries.date_submitted DESC LIMIT %d\", $total_items ) );\n\n\t\tif ( current_user_can( 'vfb_edit_entries' ) )\n\t\t\t$action = 'edit';\n\t\telseif ( current_user_can( 'vfb_view_entries' ) )\n\t\t\t$action = 'view';\n\n\t\tif ( !$entries ) :\n\t\t\techo sprintf( '<p>%1$s</p>', __( 'You currently do not have any entries.', 'visual-form-builder-pro' ) );\n\t\telse :\n\n\t\t\t$content = '';\n\n\t\t\tforeach ( $entries as $entry ) :\n\n\t\t\t\t$content .= sprintf(\n\t\t\t\t\t'<li><a href=\"%1$s\">%4$s</a> via <a href=\"%2$s\">%5$s</a> <span class=\"rss-date\">%6$s</span><cite>%3$s</cite></li>',\n\t\t\t\t\tesc_url( add_query_arg( array( 'action' => $action, 'entry' => absint( $entry->entries_id ) ), admin_url( 'admin.php?page=vfb-entries' ) ) ),\n\t\t\t\t\tesc_url( add_query_arg( 'form-filter', absint( $entry->form_id ), admin_url( 'admin.php?page=vfb-entries' ) ) ),\n\t\t\t\t\tesc_html( $entry->sender_name ),\n\t\t\t\t\tesc_html( $entry->sender_email ),\n\t\t\t\t\tesc_html( $entry->form_title ),\n\t\t\t\t\tdate( \"$date_format $time_format\", strtotime( $entry->date_submitted ) )\n\t\t\t\t);\n\n\t\t\tendforeach;\n\n\t\t\techo \"<div class='rss-widget'><ul>$content</ul></div>\";\n\n\t\tendif;\n\t}", "function widget($args, $inst)\n {\n// $title = apply_filters( 'widget_title', $instance['title'] );\n// $title_color = apply_filters( 'widget_title', $instance['title_color'] );\n $image_about = $this->getVal( $inst, 'image_about' );\n $title_color = $this->getVal( $inst, 'title_color' );\n $title = $this->getVal( $inst, 'title' );\n $desc = $this->getVal( $inst, 'desc' );\n ?>\n <section class=\"ftco-section services-section\" id=\"about\">\n <div class=\"container\">\n <div class=\"row no-gutters\">\n <div class=\"col-md-6 p-md-5 img img-2 d-flex justify-content-center align-items-center\" style=\"background-image: url(<?php echo $image_about; ?>);\">\n </div>\n <div class=\"col-md-6 wrap-about py-md-5 ftco-animate\">\n <div class=\"heading-section mb-5 pl-md-5\">\n <span class=\"subheading\"><?php echo $title_color; ?></span>\n <h2 class=\"mb-4\"><?php echo $title; ?></h2>\n <p><?php echo $desc; ?></p>\n </div>\n </div>\n </div>\n </div>\n </section>\n<?php\n }", "public function widget( $args, $instance ) {\r\n\t$title = apply_filters( 'widget_title', $instance['title'] );\r\n\t// before and after widget arguments are defined by themes\r\n\techo $args['before_widget']; ?>\r\n\t\r\n\t\t<p><img src=\"/app/uploads/2016/10/logo-alt.png\"/></p>\r\n\t\t<p><img src=\"/app/uploads/2016/10/oaklins-blue.png\"/></p>\r\n\t\t<ul>\r\n\t\t\t<li class=\"address\">\r\n\t\t\t\tMain Office 475 Park Avenue South, 22nd Floor<br />\r\n\t\t\t\tNew York, NY 10016\r\n\t\t\t</li>\r\n\t\t\t<li class=\"phone\">212.686.9700</li>\t\r\n\t\t\t<li class=\"mail\"><a href=\"/contact\">Email Us</a></li>\r\n\t\t</ul>\t\r\n\t\t<?php gravity_form( 3, true, false, false, '', false ); ?>\r\n\t<?php echo $args['after_widget'];\r\n}", "public function widget($args, $instance) {\n extract( $args );\n\n?>\n <div class=\"an-catlinks-container\">\n <div class=\"an-catlinks-element\">\n <img src=\"<?php _e($instance['image1']); ?>\" />\n <a href=\"<?php _e(get_category_link($instance['cat1'])); ?>\">\n <?php _e(get_cat_name($instance['cat1'])); ?>\n </a>\n </div>\n\n <div class=\"an-catlinks-element\">\n <img src=\"<?php _e($instance['image2']); ?>\" />\n <a href=\"<?php _e(get_category_link($instance['cat2'])); ?>\">\n <?php _e(get_cat_name($instance['cat2'])); ?>\n </a>\n </div>\n\n <div class=\"an-catlinks-element\">\n <img src=\"<?php _e($instance['image3']); ?>\" />\n <a href=\"<?php _e(get_category_link($instance['cat3'])); ?>\">\n <?php _e(get_cat_name($instance['cat3'])); ?>\n </a>\n </div>\n </div>\n\n<?php\n }" ]
[ "0.7544606", "0.73311025", "0.72837144", "0.7251682", "0.7220104", "0.7095844", "0.70149666", "0.6908474", "0.6893132", "0.6893132", "0.6889531", "0.68773836", "0.6865939", "0.6865939", "0.6839554", "0.6814955", "0.68108886", "0.6784918", "0.67652696", "0.67451906", "0.6724089", "0.6700466", "0.6694043", "0.66894054", "0.66768116", "0.6672807", "0.6662263", "0.66524947", "0.6640937", "0.6640617", "0.66405195", "0.66309667", "0.66296345", "0.66227245", "0.6556245", "0.6554257", "0.653626", "0.6525833", "0.6525755", "0.65223014", "0.651319", "0.64984304", "0.6478594", "0.6477184", "0.64738214", "0.6469374", "0.6468568", "0.646292", "0.6462703", "0.6441542", "0.643178", "0.64307827", "0.64204794", "0.6406741", "0.640503", "0.64045286", "0.639601", "0.6392194", "0.63901925", "0.63864756", "0.6383968", "0.637855", "0.6375579", "0.6371679", "0.6370081", "0.635806", "0.6355441", "0.6352118", "0.63497573", "0.6347342", "0.6347276", "0.63440394", "0.63353455", "0.63287914", "0.63227373", "0.63102514", "0.63096553", "0.6302147", "0.6297961", "0.6288665", "0.6286894", "0.6286613", "0.6276043", "0.62744707", "0.6269997", "0.62699217", "0.62660074", "0.6257913", "0.6253843", "0.62517923", "0.62489", "0.6246913", "0.6246157", "0.6245358", "0.6239007", "0.62348676", "0.62328464", "0.6231417", "0.6228585", "0.6221488", "0.6218903" ]
0.0
-1